<commit_before>/*
svalue1 = temp
svalue2 = humidity
svalue3 = hum stat (0=Normal, 1=Comfortable, 2=Dry, 3=Wet)
svalue4 = baro hPa
svalue5 = forecast (0 = No info, 1 = Sunny, 2 = Partly cloudy, 3 = Cloudy, 4 = Rain)
*/

import React, { Component } from 'react';

import './WeatherWidget.css';

class WeatherWidget extends Component {

  getProperties() {
    const device = this.props.device;
    const temp = Number(device.svalue1).toFixed(1);
    switch (device.dtype) {
      case "Humidity" :
        return { humonly: device.nvalue, humstat: device.svalue1 };
      case "Temp" :
        return { temp: temp };
      case "Temp + Humidity" :
        return { temp: temp, hum: device.svalue2 };
      case "Temp + Humidity + Baro" :
        return { temp: temp, hum: device.svalue2, baro: this.props.hidePressure ? null : device.svalue4, forecast: device.svalue5 };<commit_msg>Fix null baro value in weather widget causing baro to be shown<commit_after>/*
svalue1 = temp
svalue2 = humidity
svalue3 = hum stat (0=Normal, 1=Comfortable, 2=Dry, 3=Wet)
svalue4 = baro hPa
svalue5 = forecast (0 = No info, 1 = Sunny, 2 = Partly cloudy, 3 = Cloudy, 4 = Rain)
*/

import React, { Component } from 'react';

import './WeatherWidget.css';

class WeatherWidget extends Component {

  getProperties() {
    const device = this.props.device;
    const temp = Number(device.svalue1).toFixed(1);
    switch (device.dtype) {
      case "Humidity" :
        return { humonly: device.nvalue, humstat: device.svalue1 };
      case "Temp" :
        return { temp: temp };
      case "Temp + Humidity" :
        return { temp: temp, hum: device.svalue2 };
      case "Temp + Humidity + Baro" :
        return { temp: temp, hum: device.svalue2, baro: this.props.hidePressure ? undefined : device.svalue4, forecast: device.svalue5 };
{'fraction_non_alphanumeric': 0.12679162072767364, 'fraction_numerical': 0.023153252480705624, 'mean_word_length': 3.201388888888889, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6585816', 'n_tokens_mistral': 624, 'n_tokens_neox': 599, 'n_words': 179}