Mark temperature sensors as STATE_CLASS_MEASUREMENT (#50889)
* Mark temperature sensors as STATE_CLASS_MEASUREMENT * Fix broadlink tests * Tweak Hue changes
This commit is contained in:
parent
6f26687aa7
commit
73d7a754e8
10 changed files with 113 additions and 19 deletions
|
@ -6,7 +6,7 @@ from aiohue.sensors import (
|
|||
TYPE_ZLL_TEMPERATURE,
|
||||
)
|
||||
|
||||
from homeassistant.components.sensor import SensorEntity
|
||||
from homeassistant.components.sensor import STATE_CLASS_MEASUREMENT, SensorEntity
|
||||
from homeassistant.const import (
|
||||
DEVICE_CLASS_BATTERY,
|
||||
DEVICE_CLASS_ILLUMINANCE,
|
||||
|
@ -87,6 +87,11 @@ class HueTemperature(GenericHueGaugeSensorEntity):
|
|||
|
||||
return self.sensor.temperature / 100
|
||||
|
||||
@property
|
||||
def state_class(self):
|
||||
"""Return the state class of the sensor."""
|
||||
return STATE_CLASS_MEASUREMENT
|
||||
|
||||
|
||||
class HueBattery(GenericHueSensor, SensorEntity):
|
||||
"""Battery class for when a batt-powered device is only represented as an event."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue