diff --git a/ecowitt2mqtt/const.py b/ecowitt2mqtt/const.py index 9dfb4563..3ea9ea29 100644 --- a/ecowitt2mqtt/const.py +++ b/ecowitt2mqtt/const.py @@ -91,6 +91,7 @@ DATA_POINT_HUMIDEX: Final = "humidex" DATA_POINT_HUMIDEX_PERCEPTION: Final = "humidex_perception" DATA_POINT_HUMIDITY: Final = "humidity" +DATA_POINT_HUMIDITYIN: Final = "humidityin" DATA_POINT_HUMIDITY_ABS: Final = "humidityabs" DATA_POINT_HUMIDITY_ABS_IN: Final = "humidityabsin" DATA_POINT_HUMI_CO2: Final = "humi_co2" @@ -116,6 +117,7 @@ DATA_POINT_SOLARRADIATION: Final = "solarradiation" DATA_POINT_SOLARRADIATION_PERCEIVED: Final = "solarradiation_perceived" DATA_POINT_TEMP: Final = "temp" +DATA_POINT_TEMPIN: Final = "tempin" DATA_POINT_TF_CO2: Final = "tf_co2" DATA_POINT_THERMAL_PERCEPTION: Final = "thermalperception" DATA_POINT_TOTAL_RAIN: Final = "totalrain" diff --git a/ecowitt2mqtt/data.py b/ecowitt2mqtt/data.py index e8dde947..7cf530ba 100644 --- a/ecowitt2mqtt/data.py +++ b/ecowitt2mqtt/data.py @@ -77,6 +77,7 @@ from ecowitt2mqtt.helpers.calculator.heap import HeapCalculator from ecowitt2mqtt.helpers.calculator.humidity import ( AbsoluteHumidityCalculator, + IndoorAbsoluteHumidityCalculator, RelativeHumidityCalculator, ) from ecowitt2mqtt.helpers.calculator.illuminance import ( @@ -158,7 +159,7 @@ DATA_POINT_HUMIDEX_PERCEPTION: HumidexPerceptionCalculator, DATA_POINT_HUMIDITY: RelativeHumidityCalculator, DATA_POINT_HUMIDITY_ABS: AbsoluteHumidityCalculator, - DATA_POINT_HUMIDITY_ABS_IN: AbsoluteHumidityCalculator, + DATA_POINT_HUMIDITY_ABS_IN: IndoorAbsoluteHumidityCalculator, DATA_POINT_HUMI_CO2: RelativeHumidityCalculator, DATA_POINT_INTERVAL: UpdateIntervalCalculator, DATA_POINT_LIGHTNING: LightningStrikeDistanceCalculator, diff --git a/ecowitt2mqtt/helpers/calculator/humidity.py b/ecowitt2mqtt/helpers/calculator/humidity.py index 51bf70e7..7085e2da 100644 --- a/ecowitt2mqtt/helpers/calculator/humidity.py +++ b/ecowitt2mqtt/helpers/calculator/humidity.py @@ -7,7 +7,9 @@ from ecowitt2mqtt.const import ( CONF_OUTPUT_UNIT_HUMIDITY, DATA_POINT_HUMIDITY, + DATA_POINT_HUMIDITYIN, DATA_POINT_TEMP, + DATA_POINT_TEMPIN, PERCENTAGE, UnitOfVolume, ) @@ -48,6 +50,15 @@ def output_unit_metric(self) -> str: """ return UnitOfVolume.GRAMS_PER_CUBIC_METER + def _calculate_value(self, temp: float, humidity: float) -> CalculatedDataPoint: + """Calculate the absolute humidity.""" + temp_obj = get_temperature_meteocalc_object( + temp, self._config.input_unit_system + ) + + value = get_absolute_humidity_in_metric(temp_obj, humidity) + return self.get_calculated_data_point(value, unit_converter=VolumeConverter) + @Calculator.requires_keys(DATA_POINT_TEMP, DATA_POINT_HUMIDITY) def calculate_from_payload( self, payload: dict[str, PreCalculatedValueType] @@ -62,13 +73,27 @@ def calculate_from_payload( """ temp = cast(float, payload[DATA_POINT_TEMP]) humidity = cast(float, payload[DATA_POINT_HUMIDITY]) + return self._calculate_value(temp, humidity) - temp_obj = get_temperature_meteocalc_object( - temp, self._config.input_unit_system - ) - value = get_absolute_humidity_in_metric(temp_obj, humidity) - return self.get_calculated_data_point(value, unit_converter=VolumeConverter) +class IndoorAbsoluteHumidityCalculator(AbsoluteHumidityCalculator): + """Define an absolute humidity calculator.""" + + @Calculator.requires_keys(DATA_POINT_TEMPIN, DATA_POINT_HUMIDITYIN) + def calculate_from_payload( + self, payload: dict[str, PreCalculatedValueType] + ) -> CalculatedDataPoint: + """Perform the calculation. + + Args: + payload: An Ecowitt data payload. + + Returns: + A parsed CalculatedDataPoint object. + """ + temp = cast(float, payload[DATA_POINT_TEMPIN]) + humidity = cast(float, payload[DATA_POINT_HUMIDITY]) + return self._calculate_value(temp, humidity) class RelativeHumidityCalculator(SimpleCalculator): diff --git a/tests/data/test_battery.py b/tests/data/test_battery.py index 4c6e479f..b4308dcf 100644 --- a/tests/data/test_battery.py +++ b/tests/data/test_battery.py @@ -358,7 +358,7 @@ def test_battery_config(device_data: dict[str, Any], ecowitt: Ecowitt) -> None: ), "humidityabsin": CalculatedDataPoint( data_point_key="humidityabsin", - value=0.0010682941088042506, + value=0.0006792489921019872, unit=UnitOfVolume.POUNDS_PER_CUBIC_FOOT, attributes={}, data_type=DataPointType.NON_BOOLEAN, @@ -741,7 +741,7 @@ def test_default_battery_strategy( ), "humidityabsin": CalculatedDataPoint( data_point_key="humidityabsin", - value=0.0010682941088042506, + value=0.0006792489921019872, unit=UnitOfVolume.POUNDS_PER_CUBIC_FOOT, attributes={}, data_type=DataPointType.NON_BOOLEAN, @@ -1110,7 +1110,7 @@ def test_unknown_battery(device_data: dict[str, Any], ecowitt: Ecowitt) -> None: ), "humidityabsin": CalculatedDataPoint( data_point_key="humidityabsin", - value=0.001501643470436062, + value=0.0009950279348870004, unit=UnitOfVolume.POUNDS_PER_CUBIC_FOOT, attributes={}, data_type=DataPointType.NON_BOOLEAN, diff --git a/tests/data/test_data_processing.py b/tests/data/test_data_processing.py index b095db34..edf52e72 100644 --- a/tests/data/test_data_processing.py +++ b/tests/data/test_data_processing.py @@ -562,7 +562,7 @@ def test_missing_distance(device_data: dict[str, Any], ecowitt: Ecowitt) -> None ), "humidityabsin": CalculatedDataPoint( data_point_key="humidityabsin", - value=0.0006244952780717129, + value=0.0005621776693578237, unit=UnitOfVolume.POUNDS_PER_CUBIC_FOOT, attributes={}, data_type=DataPointType.NON_BOOLEAN, @@ -960,7 +960,7 @@ def test_nonnumeric_value(device_data: dict[str, Any], ecowitt: Ecowitt) -> None ), "humidityabsin": CalculatedDataPoint( data_point_key="humidityabsin", - value=0.001501643470436062, + value=0.0009950279348870004, unit=UnitOfVolume.POUNDS_PER_CUBIC_FOOT, attributes={}, data_type=DataPointType.NON_BOOLEAN, @@ -1745,7 +1745,7 @@ def test_precision(device_data: dict[str, Any], ecowitt: Ecowitt) -> None: ), "humidityabsin": CalculatedDataPoint( data_point_key="humidityabsin", - value=0.001501643470436062, + value=0.0009950279348870004, unit=UnitOfVolume.POUNDS_PER_CUBIC_FOOT, attributes={}, data_type=DataPointType.NON_BOOLEAN, @@ -2075,7 +2075,7 @@ def test_precision(device_data: dict[str, Any], ecowitt: Ecowitt) -> None: ), "humidityabsin": CalculatedDataPoint( data_point_key="humidityabsin", - value=0.0000665641018299439, + value=0.00038568684485373834, unit=UnitOfVolume.POUNDS_PER_CUBIC_FOOT, attributes={}, data_type=DataPointType.NON_BOOLEAN, @@ -2468,7 +2468,7 @@ def test_precision(device_data: dict[str, Any], ecowitt: Ecowitt) -> None: ), "humidityabsin": CalculatedDataPoint( data_point_key="humidityabsin", - value=0.0010682941088042506, + value=0.0006792489921019872, unit=UnitOfVolume.POUNDS_PER_CUBIC_FOOT, attributes={}, data_type=DataPointType.NON_BOOLEAN, @@ -2872,7 +2872,7 @@ def test_precision(device_data: dict[str, Any], ecowitt: Ecowitt) -> None: ), "humidityabsin": CalculatedDataPoint( data_point_key="humidityabsin", - value=0.0006244952780717129, + value=0.0005621776693578237, unit=UnitOfVolume.POUNDS_PER_CUBIC_FOOT, attributes={}, data_type=DataPointType.NON_BOOLEAN, @@ -3625,7 +3625,7 @@ def test_precision(device_data: dict[str, Any], ecowitt: Ecowitt) -> None: ), "humidityabsin": CalculatedDataPoint( data_point_key="humidityabsin", - value=0.0005325592736717602, + value=0.000820898950357005, unit=UnitOfVolume.POUNDS_PER_CUBIC_FOOT, attributes={}, data_type=DataPointType.NON_BOOLEAN, @@ -4103,7 +4103,7 @@ def test_precision(device_data: dict[str, Any], ecowitt: Ecowitt) -> None: ), "humidityabsin": CalculatedDataPoint( data_point_key="humidityabsin", - value=0.00020514236695062975, + value=0.000575127755994321, unit=UnitOfVolume.POUNDS_PER_CUBIC_FOOT, attributes={}, data_type=DataPointType.NON_BOOLEAN, @@ -4478,7 +4478,7 @@ def test_precision(device_data: dict[str, Any], ecowitt: Ecowitt) -> None: ), "humidityabsin": CalculatedDataPoint( data_point_key="humidityabsin", - value=0.0007588986415738014, + value=0.0006467356391665706, unit=UnitOfVolume.POUNDS_PER_CUBIC_FOOT, attributes={}, data_type=DataPointType.NON_BOOLEAN, @@ -4800,7 +4800,7 @@ def test_precision(device_data: dict[str, Any], ecowitt: Ecowitt) -> None: ), "humidityabsin": CalculatedDataPoint( data_point_key="humidityabsin", - value=0.0002045744433384171, + value=0.0012629214620876999, unit=UnitOfVolume.POUNDS_PER_CUBIC_FOOT, attributes={}, data_type=DataPointType.NON_BOOLEAN, diff --git a/tests/data/test_units.py b/tests/data/test_units.py index 36b44e6e..3a370e34 100644 --- a/tests/data/test_units.py +++ b/tests/data/test_units.py @@ -362,7 +362,7 @@ def test_output_units(device_data: dict[str, Any], ecowitt: Ecowitt) -> None: ), "humidityabsin": CalculatedDataPoint( data_point_key="humidityabsin", - value=24.054020931926463, + value=15.938818531054617, unit=UnitOfVolume.GRAMS_PER_CUBIC_METER, attributes={}, data_type=DataPointType.NON_BOOLEAN, @@ -765,7 +765,7 @@ def test_unit_conversion_to_imperial( ), "humidityabsin": CalculatedDataPoint( data_point_key="humidityabsin", - value=0.00016449986246231337, + value=0.0011505010497130945, unit=UnitOfVolume.POUNDS_PER_CUBIC_FOOT, attributes={}, data_type=DataPointType.NON_BOOLEAN, @@ -1159,7 +1159,7 @@ def test_unit_conversion_to_imperial( ), "humidityabsin": CalculatedDataPoint( data_point_key="humidityabsin", - value=24.054020931926463, + value=15.938818531054617, unit=UnitOfVolume.GRAMS_PER_CUBIC_METER, attributes={}, data_type=DataPointType.NON_BOOLEAN, @@ -1489,7 +1489,7 @@ def test_unit_conversion_to_imperial( ), "humidityabsin": CalculatedDataPoint( data_point_key="humidityabsin", - value=1.0662546271835098, + value=6.178110598107857, unit=UnitOfVolume.GRAMS_PER_CUBIC_METER, attributes={}, data_type=DataPointType.NON_BOOLEAN, diff --git a/tests/helpers/publisher/mqtt/test_hass_discovery.py b/tests/helpers/publisher/mqtt/test_hass_discovery.py index 226a822d..ad89c46e 100644 --- a/tests/helpers/publisher/mqtt/test_hass_discovery.py +++ b/tests/helpers/publisher/mqtt/test_hass_discovery.py @@ -1992,7 +1992,7 @@ async def test_publish( ), call( "homeassistant/sensor/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/humidityabsin/state", - payload=b"0.0005325592736717602", + payload=b"0.000820898950357005", retain=False, ), call( @@ -4226,7 +4226,7 @@ async def test_publish_custom_entity_id_prefix( ), call( "homeassistant/sensor/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/humidityabsin/state", - payload=b"0.0005325592736717602", + payload=b"0.000820898950357005", retain=False, ), call( @@ -6486,7 +6486,7 @@ async def test_publish_numeric_battery_strategy( ), call( "homeassistant/sensor/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/humidityabsin/state", - payload=b"0.0005325592736717602", + payload=b"0.000820898950357005", retain=False, ), call( @@ -8736,7 +8736,7 @@ async def test_no_entity_description( ), call( "homeassistant/sensor/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/humidityabsin/state", - payload=b"0.0005325592736717602", + payload=b"0.000820898950357005", retain=False, ), call( diff --git a/tests/helpers/publisher/mqtt/test_topic_publisher.py b/tests/helpers/publisher/mqtt/test_topic_publisher.py index 37193d3b..e255e4dd 100644 --- a/tests/helpers/publisher/mqtt/test_topic_publisher.py +++ b/tests/helpers/publisher/mqtt/test_topic_publisher.py @@ -41,7 +41,7 @@ async def test_publish_processed( await publishers[0].async_publish(device_data) mock_aiomqtt_client.publish.assert_awaited_with( TEST_MQTT_TOPIC, - payload=b'{"runtime": 319206.0, "tempin": 79.52, "humidityin": 31.0, "baromrel": 24.74, "baromabs": 24.74, "temp": 93.2, "humidity": 64.0, "winddir": 139.0, "windspeed": 20.89, "windgust": 1.12, "maxdailygust": 8.05, "solarradiation": 264.61, "uv": 2.0, "rainrate": 0.0, "eventrain": 0.0, "hourlyrain": 0.0, "dailyrain": 0.0, "weeklyrain": 0.0, "monthlyrain": 2.177, "yearlyrain": 4.441, "lightning_num": 13.0, "lightning": 0.6213711922373341, "lightning_time": "2022-04-20T17:17:17+00:00", "wh65batt": "OFF", "beaufortscale": 5, "dewpoint": 79.19328776816637, "feelslike": 111.0553021896001, "frostpoint": 70.28882284994654, "frostrisk": "No risk", "heatindex": 111.0553021896001, "humidex": 48, "humidex_perception": "Dangerous", "humidityabs": 0.001501643470436062, "humidityabsin": 0.001501643470436062, "relative_strain_index": 0.54, "relative_strain_index_perception": "Extreme discomfort", "safe_exposure_time_skin_type_1": 83.3, "safe_exposure_time_skin_type_2": 100.0, "safe_exposure_time_skin_type_3": 133.3, "safe_exposure_time_skin_type_4": 166.7, "safe_exposure_time_skin_type_5": 266.7, "safe_exposure_time_skin_type_6": 433.3, "simmerindex": 113.90619200000002, "simmerzone": "Danger of heatstroke", "solarradiation_perceived": 90.49958322993245, "thermalperception": "Severely high", "windchill": null, "winddir_name": "SE"}', # noqa: E501 + payload=b'{"runtime": 319206.0, "tempin": 79.52, "humidityin": 31.0, "baromrel": 24.74, "baromabs": 24.74, "temp": 93.2, "humidity": 64.0, "winddir": 139.0, "windspeed": 20.89, "windgust": 1.12, "maxdailygust": 8.05, "solarradiation": 264.61, "uv": 2.0, "rainrate": 0.0, "eventrain": 0.0, "hourlyrain": 0.0, "dailyrain": 0.0, "weeklyrain": 0.0, "monthlyrain": 2.177, "yearlyrain": 4.441, "lightning_num": 13.0, "lightning": 0.6213711922373341, "lightning_time": "2022-04-20T17:17:17+00:00", "wh65batt": "OFF", "beaufortscale": 5, "dewpoint": 79.19328776816637, "feelslike": 111.0553021896001, "frostpoint": 70.28882284994654, "frostrisk": "No risk", "heatindex": 111.0553021896001, "humidex": 48, "humidex_perception": "Dangerous", "humidityabs": 0.001501643470436062, "humidityabsin": 0.0009950279348870004, "relative_strain_index": 0.54, "relative_strain_index_perception": "Extreme discomfort", "safe_exposure_time_skin_type_1": 83.3, "safe_exposure_time_skin_type_2": 100.0, "safe_exposure_time_skin_type_3": 133.3, "safe_exposure_time_skin_type_4": 166.7, "safe_exposure_time_skin_type_5": 266.7, "safe_exposure_time_skin_type_6": 433.3, "simmerindex": 113.90619200000002, "simmerzone": "Danger of heatstroke", "solarradiation_perceived": 90.49958322993245, "thermalperception": "Severely high", "windchill": null, "winddir_name": "SE"}', retain=False, ) diff --git a/tests/test_runtime.py b/tests/test_runtime.py index 36539e8f..87138a17 100644 --- a/tests/test_runtime.py +++ b/tests/test_runtime.py @@ -96,7 +96,7 @@ async def test_publish_ambient_weather_new_format_success( assert resp.status == 204 mock_aiomqtt_client.publish.assert_awaited_with( TEST_MQTT_TOPIC, - payload=b'{"tempin": 67.3, "humidityin": 33.0, "baromrel": 29.616, "baromabs": 24.679, "temp": 53.8, "humidity": 30.0, "winddir": 99.0, "windspeed": 4.5, "windgust": 6.9, "maxdailygust": 14.8, "hourlyrain": 0.0, "eventrain": 0.0, "dailyrain": 0.0, "weeklyrain": 0.024, "monthlyrain": 0.311, "totalrain": 48.811, "solarradiation": 39.02, "uv": 0.0, "batt_co2": "ON", "beaufortscale": 2, "dewpoint": 23.12793817902528, "feelslike": 53.8, "frostpoint": 20.34536144435649, "frostrisk": "No risk", "heatindex": 50.28999999999999, "humidex": 9, "humidex_perception": "Comfortable", "humidityabs": 0.00020090062644380612, "humidityabsin": 0.00020090062644380612, "relative_strain_index": null, "relative_strain_index_perception": null, "safe_exposure_time_skin_type_1": null, "safe_exposure_time_skin_type_2": null, "safe_exposure_time_skin_type_3": null, "safe_exposure_time_skin_type_4": null, "safe_exposure_time_skin_type_5": null, "safe_exposure_time_skin_type_6": null, "simmerindex": null, "simmerzone": null, "solarradiation_perceived": 73.87320347536115, "thermalperception": "Dry", "windchill": null, "winddir_name": "E"}', # noqa: E501 + payload=b'{"tempin": 67.3, "humidityin": 33.0, "baromrel": 29.616, "baromabs": 24.679, "temp": 53.8, "humidity": 30.0, "winddir": 99.0, "windspeed": 4.5, "windgust": 6.9, "maxdailygust": 14.8, "hourlyrain": 0.0, "eventrain": 0.0, "dailyrain": 0.0, "weeklyrain": 0.024, "monthlyrain": 0.311, "totalrain": 48.811, "solarradiation": 39.02, "uv": 0.0, "batt_co2": "ON", "beaufortscale": 2, "dewpoint": 23.12793817902528, "feelslike": 53.8, "frostpoint": 20.34536144435649, "frostrisk": "No risk", "heatindex": 50.28999999999999, "humidex": 9, "humidex_perception": "Comfortable", "humidityabs": 0.00020090062644380612, "humidityabsin": 0.00031629579586392367, "relative_strain_index": null, "relative_strain_index_perception": null, "safe_exposure_time_skin_type_1": null, "safe_exposure_time_skin_type_2": null, "safe_exposure_time_skin_type_3": null, "safe_exposure_time_skin_type_4": null, "safe_exposure_time_skin_type_5": null, "safe_exposure_time_skin_type_6": null, "simmerindex": null, "simmerzone": null, "solarradiation_perceived": 73.87320347536115, "thermalperception": "Dry", "windchill": null, "winddir_name": "E"}', retain=False, ) @@ -138,7 +138,7 @@ async def test_publish_ambient_weather_old_format_success( assert resp.status == 204 mock_aiomqtt_client.publish.assert_awaited_with( TEST_MQTT_TOPIC, - payload=b'{"tempin": 67.3, "humidityin": 33.0, "baromrel": 29.616, "baromabs": 24.679, "temp": 53.8, "humidity": 30.0, "winddir": 99.0, "windspeed": 4.5, "windgust": 6.9, "maxdailygust": 14.8, "hourlyrain": 0.0, "eventrain": 0.0, "dailyrain": 0.0, "weeklyrain": 0.024, "monthlyrain": 0.311, "totalrain": 48.811, "solarradiation": 39.02, "uv": 0.0, "batt_co2": "ON", "beaufortscale": 2, "dewpoint": 23.12793817902528, "feelslike": 53.8, "frostpoint": 20.34536144435649, "frostrisk": "No risk", "heatindex": 50.28999999999999, "humidex": 9, "humidex_perception": "Comfortable", "humidityabs": 0.00020090062644380612, "humidityabsin": 0.00020090062644380612, "relative_strain_index": null, "relative_strain_index_perception": null, "safe_exposure_time_skin_type_1": null, "safe_exposure_time_skin_type_2": null, "safe_exposure_time_skin_type_3": null, "safe_exposure_time_skin_type_4": null, "safe_exposure_time_skin_type_5": null, "safe_exposure_time_skin_type_6": null, "simmerindex": null, "simmerzone": null, "solarradiation_perceived": 73.87320347536115, "thermalperception": "Dry", "windchill": null, "winddir_name": "E"}', # noqa: E501 + payload=b'{"tempin": 67.3, "humidityin": 33.0, "baromrel": 29.616, "baromabs": 24.679, "temp": 53.8, "humidity": 30.0, "winddir": 99.0, "windspeed": 4.5, "windgust": 6.9, "maxdailygust": 14.8, "hourlyrain": 0.0, "eventrain": 0.0, "dailyrain": 0.0, "weeklyrain": 0.024, "monthlyrain": 0.311, "totalrain": 48.811, "solarradiation": 39.02, "uv": 0.0, "batt_co2": "ON", "beaufortscale": 2, "dewpoint": 23.12793817902528, "feelslike": 53.8, "frostpoint": 20.34536144435649, "frostrisk": "No risk", "heatindex": 50.28999999999999, "humidex": 9, "humidex_perception": "Comfortable", "humidityabs": 0.00020090062644380612, "humidityabsin": 0.00031629579586392367, "relative_strain_index": null, "relative_strain_index_perception": null, "safe_exposure_time_skin_type_1": null, "safe_exposure_time_skin_type_2": null, "safe_exposure_time_skin_type_3": null, "safe_exposure_time_skin_type_4": null, "safe_exposure_time_skin_type_5": null, "safe_exposure_time_skin_type_6": null, "simmerindex": null, "simmerzone": null, "solarradiation_perceived": 73.87320347536115, "thermalperception": "Dry", "windchill": null, "winddir_name": "E"}', retain=False, ) @@ -184,7 +184,7 @@ async def test_publish_ecowitt_success( assert resp.status == 204 mock_aiomqtt_client.publish.assert_awaited_with( TEST_MQTT_TOPIC, - payload=b'{"runtime": 319206.0, "tempin": 79.52, "humidityin": 31.0, "baromrel": 24.74, "baromabs": 24.74, "temp": 93.2, "humidity": 64.0, "winddir": 139.0, "windspeed": 20.89, "windgust": 1.12, "maxdailygust": 8.05, "solarradiation": 264.61, "uv": 2.0, "rainrate": 0.0, "eventrain": 0.0, "hourlyrain": 0.0, "dailyrain": 0.0, "weeklyrain": 0.0, "monthlyrain": 2.177, "yearlyrain": 4.441, "lightning_num": 13.0, "lightning": 0.6213711922373341, "lightning_time": "2022-04-20T17:17:17+00:00", "wh65batt": "OFF", "beaufortscale": 5, "dewpoint": 79.19328776816637, "feelslike": 111.0553021896001, "frostpoint": 70.28882284994654, "frostrisk": "No risk", "heatindex": 111.0553021896001, "humidex": 48, "humidex_perception": "Dangerous", "humidityabs": 0.001501643470436062, "humidityabsin": 0.001501643470436062, "relative_strain_index": 0.54, "relative_strain_index_perception": "Extreme discomfort", "safe_exposure_time_skin_type_1": 83.3, "safe_exposure_time_skin_type_2": 100.0, "safe_exposure_time_skin_type_3": 133.3, "safe_exposure_time_skin_type_4": 166.7, "safe_exposure_time_skin_type_5": 266.7, "safe_exposure_time_skin_type_6": 433.3, "simmerindex": 113.90619200000002, "simmerzone": "Danger of heatstroke", "solarradiation_perceived": 90.49958322993245, "thermalperception": "Severely high", "windchill": null, "winddir_name": "SE"}', # noqa: E501 + payload=b'{"runtime": 319206.0, "tempin": 79.52, "humidityin": 31.0, "baromrel": 24.74, "baromabs": 24.74, "temp": 93.2, "humidity": 64.0, "winddir": 139.0, "windspeed": 20.89, "windgust": 1.12, "maxdailygust": 8.05, "solarradiation": 264.61, "uv": 2.0, "rainrate": 0.0, "eventrain": 0.0, "hourlyrain": 0.0, "dailyrain": 0.0, "weeklyrain": 0.0, "monthlyrain": 2.177, "yearlyrain": 4.441, "lightning_num": 13.0, "lightning": 0.6213711922373341, "lightning_time": "2022-04-20T17:17:17+00:00", "wh65batt": "OFF", "beaufortscale": 5, "dewpoint": 79.19328776816637, "feelslike": 111.0553021896001, "frostpoint": 70.28882284994654, "frostrisk": "No risk", "heatindex": 111.0553021896001, "humidex": 48, "humidex_perception": "Dangerous", "humidityabs": 0.001501643470436062, "humidityabsin": 0.0009950279348870004, "relative_strain_index": 0.54, "relative_strain_index_perception": "Extreme discomfort", "safe_exposure_time_skin_type_1": 83.3, "safe_exposure_time_skin_type_2": 100.0, "safe_exposure_time_skin_type_3": 133.3, "safe_exposure_time_skin_type_4": 166.7, "safe_exposure_time_skin_type_5": 266.7, "safe_exposure_time_skin_type_6": 433.3, "simmerindex": 113.90619200000002, "simmerzone": "Danger of heatstroke", "solarradiation_perceived": 90.49958322993245, "thermalperception": "Severely high", "windchill": null, "winddir_name": "SE"}', retain=False, ) @@ -275,7 +275,7 @@ async def test_publish_wunderground_success( assert resp.status == 204 mock_aiomqtt_client.publish.assert_awaited_with( TEST_MQTT_TOPIC, - payload=b'{"ID": "MCKEAN", "PASSWORD": 1909.0, "temp": 89.42, "humidity": 54.0, "dewptf": 70.7, "winddir": 269.0, "windspeed": 0.0, "windgust": 9.17, "rain": 0.0, "dailyrain": 0.0, "weeklyrain": 0.476, "monthlyrain": 4.831, "yearlyrain": 4.831, "solarradiation": 732.04, "UV": 6.0, "indoortemp": 79.34, "indoorhumidity": 55.0, "barom": 30.135, "lowbatt": "OFF", "action": "updateraw", "realtime": 1.0, "rtfreq": 5.0, "beaufortscale": 0, "dewpoint": 70.5763744258485, "feelslike": 95.3087917601561, "frostpoint": 62.320677884203384, "frostrisk": "No risk", "heatindex": 95.3087917601561, "humidex": 41, "humidex_perception": "Great discomfort", "humidityabs": 0.0011334789215741161, "humidityabsin": 0.0011334789215741161, "relative_strain_index": 0.34, "relative_strain_index_perception": "Discomfort", "simmerindex": 104.48206520000001, "simmerzone": "Caution: Heat exhaustion", "solarradiation_perceived": 99.33815442116924, "thermalperception": "Quite uncomfortable", "windchill": null, "winddir_name": "W"}', # noqa: E501 + payload=b'{"ID": "MCKEAN", "PASSWORD": 1909.0, "temp": 89.42, "humidity": 54.0, "dewptf": 70.7, "winddir": 269.0, "windspeed": 0.0, "windgust": 9.17, "rain": 0.0, "dailyrain": 0.0, "weeklyrain": 0.476, "monthlyrain": 4.831, "yearlyrain": 4.831, "solarradiation": 732.04, "UV": 6.0, "indoortemp": 79.34, "indoorhumidity": 55.0, "barom": 30.135, "lowbatt": "OFF", "action": "updateraw", "realtime": 1.0, "rtfreq": 5.0, "beaufortscale": 0, "dewpoint": 70.5763744258485, "feelslike": 95.3087917601561, "frostpoint": 62.320677884203384, "frostrisk": "No risk", "heatindex": 95.3087917601561, "humidex": 41, "humidex_perception": "Great discomfort", "humidityabs": 0.0011334789215741161, "relative_strain_index": 0.34, "relative_strain_index_perception": "Discomfort", "simmerindex": 104.48206520000001, "simmerzone": "Caution: Heat exhaustion", "solarradiation_perceived": 99.33815442116924, "thermalperception": "Quite uncomfortable", "windchill": null, "winddir_name": "W"}', retain=False, )