Skip to content

Commit

Permalink
Add 'state_class' property to Sensor class (fixes #96).
Browse files Browse the repository at this point in the history
Signed-off-by: Steffen Pankratz <kratz00@gmx.de>
  • Loading branch information
kratz00 committed Sep 22, 2023
1 parent e72d672 commit 458a214
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ha_mqtt_discoverable/sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ class SensorInfo(EntityInfo):
component: str = "sensor"
unit_of_measurement: Optional[str] = None
"""Defines the units of measurement of the sensor, if any."""
state_class: Optional[str] = None
"""Defines the type of state.
If not None, the sensor is assumed to be numerical
and will be displayed as a line-chart
in the frontend instead of as discrete values."""


class SwitchInfo(EntityInfo):
Expand Down

0 comments on commit 458a214

Please sign in to comment.