From 42dd0cabb35920732bc1ceb52f37d5ae875df74c Mon Sep 17 00:00:00 2001 From: Shay Levy Date: Mon, 8 Aug 2022 07:52:39 +0300 Subject: [PATCH] Fix Shelly H&T sensors rounding (#76426) --- homeassistant/components/shelly/sensor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/homeassistant/components/shelly/sensor.py b/homeassistant/components/shelly/sensor.py index 5a36b5e99bf..c37bbbd5ff8 100644 --- a/homeassistant/components/shelly/sensor.py +++ b/homeassistant/components/shelly/sensor.py @@ -362,6 +362,7 @@ RPC_SENSORS: Final = { sub_key="tC", name="Temperature", native_unit_of_measurement=TEMP_CELSIUS, + value=lambda status, _: round(status, 1), device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, entity_registry_enabled_default=True, @@ -392,6 +393,7 @@ RPC_SENSORS: Final = { sub_key="rh", name="Humidity", native_unit_of_measurement=PERCENTAGE, + value=lambda status, _: round(status, 1), device_class=SensorDeviceClass.HUMIDITY, state_class=SensorStateClass.MEASUREMENT, entity_registry_enabled_default=True,