Skip to content

Commit

Permalink
Merge pull request #122 from kratz00/state_class
Browse files Browse the repository at this point in the history
Add 'state_class' property to Sensor class (fixes #96).
  • Loading branch information
unixorn authored Sep 23, 2023
2 parents 9901a43 + 458a214 commit 91e06e3
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 91e06e3

Please sign in to comment.