Skip to content

Commit

Permalink
Update sensor.py (#269)
Browse files Browse the repository at this point in the history
Added sensor state class of "measurement" to the Nest Protect temperature sensor definition, so that HA recognizes and collects min/mean/max statistical information for these sensors.
  • Loading branch information
AzimuthMiridian authored Nov 13, 2023
1 parent b2c9be0 commit 1baf10a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions custom_components/nest_protect/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
SensorDeviceClass,
SensorEntity,
SensorEntityDescription,
SensorStateClass,
)
from homeassistant.const import PERCENTAGE, TEMP_CELSIUS
from homeassistant.helpers.entity import EntityCategory
Expand Down Expand Up @@ -49,6 +50,7 @@ class NestProtectSensorDescription(SensorEntityDescription):
value_fn=lambda state: round(state, 2),
device_class=SensorDeviceClass.TEMPERATURE,
native_unit_of_measurement=TEMP_CELSIUS,
state_class=SensorStateClass.MEASUREMENT,
),
# TODO Add Color Status (gray, green, yellow, red)
# TODO Smoke Status (OK, Warning, Emergency)
Expand Down

0 comments on commit 1baf10a

Please sign in to comment.