Miflora, add STATE_CLASS_MEASUREMENT (#50971)
* Miflora, add STATE_CLASS_MEASUREMENT Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net> * Miflora, add STATE_CLASS_MEASUREMENT Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>
This commit is contained in:
parent
028a07d86f
commit
7c9d8cfdec
1 changed files with 10 additions and 1 deletions
|
@ -8,7 +8,11 @@ from btlewrap import BluetoothBackendException
|
|||
from miflora import miflora_poller
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
|
||||
from homeassistant.components.sensor import (
|
||||
PLATFORM_SCHEMA,
|
||||
STATE_CLASS_MEASUREMENT,
|
||||
SensorEntity,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
CONDUCTIVITY,
|
||||
CONF_FORCE_UPDATE,
|
||||
|
@ -197,6 +201,11 @@ class MiFloraSensor(SensorEntity):
|
|||
"""Return the device class."""
|
||||
return self._device_class
|
||||
|
||||
@property
|
||||
def state_class(self):
|
||||
"""Return the state class of this entity."""
|
||||
return STATE_CLASS_MEASUREMENT
|
||||
|
||||
@property
|
||||
def unit_of_measurement(self):
|
||||
"""Return the units of measurement."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue