From 7560c7b3de28b4cb7d567e3aa22f4a0fddd1d2a4 Mon Sep 17 00:00:00 2001 From: Tobias Sauerwein Date: Fri, 1 Oct 2021 07:24:55 +0200 Subject: [PATCH] Add long-term statistics support for rain sensors (#56847) --- homeassistant/components/netatmo/sensor.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/homeassistant/components/netatmo/sensor.py b/homeassistant/components/netatmo/sensor.py index a1f7b2ac079..8a4078d3d22 100644 --- a/homeassistant/components/netatmo/sensor.py +++ b/homeassistant/components/netatmo/sensor.py @@ -9,6 +9,7 @@ import pyatmo from homeassistant.components.sensor import ( STATE_CLASS_MEASUREMENT, + STATE_CLASS_TOTAL_INCREASING, SensorEntity, SensorEntityDescription, ) @@ -143,6 +144,7 @@ SENSOR_TYPES: tuple[NetatmoSensorEntityDescription, ...] = ( netatmo_name="Rain", entity_registry_enabled_default=True, native_unit_of_measurement=LENGTH_MILLIMETERS, + state_class=STATE_CLASS_MEASUREMENT, icon="mdi:weather-rainy", ), NetatmoSensorEntityDescription( @@ -151,6 +153,7 @@ SENSOR_TYPES: tuple[NetatmoSensorEntityDescription, ...] = ( netatmo_name="sum_rain_1", entity_registry_enabled_default=False, native_unit_of_measurement=LENGTH_MILLIMETERS, + state_class=STATE_CLASS_TOTAL_INCREASING, icon="mdi:weather-rainy", ), NetatmoSensorEntityDescription( @@ -159,6 +162,7 @@ SENSOR_TYPES: tuple[NetatmoSensorEntityDescription, ...] = ( netatmo_name="sum_rain_24", entity_registry_enabled_default=True, native_unit_of_measurement=LENGTH_MILLIMETERS, + state_class=STATE_CLASS_TOTAL_INCREASING, icon="mdi:weather-rainy", ), NetatmoSensorEntityDescription(