Correct state class of ecowitt hourly rain rate sensors (#110475)

* Update sensor.py for Hourly Rain Rates mm and in

hourly_rain_rate from integration ecowitt has state class total_increasing, but its state is not strictly increasing

* Update sensor.py format
pull/116943/head^2
Peter Antonvich 2024-05-08 11:19:16 -04:00 committed by GitHub
parent cc99a9b62a
commit 189c07d502
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -241,7 +241,12 @@ async def async_setup_entry(
)
# Hourly rain doesn't reset to fixed hours, it must be measurement state classes
if sensor.key in ("hrain_piezomm", "hrain_piezo"):
if sensor.key in (
"hrain_piezomm",
"hrain_piezo",
"hourlyrainmm",
"hourlyrainin",
):
description = dataclasses.replace(
description,
state_class=SensorStateClass.MEASUREMENT,