mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 02:37:08 +00:00
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
@ -8,7 +8,11 @@ from btlewrap import BluetoothBackendException
|
|||||||
from miflora import miflora_poller
|
from miflora import miflora_poller
|
||||||
import voluptuous as vol
|
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 (
|
from homeassistant.const import (
|
||||||
CONDUCTIVITY,
|
CONDUCTIVITY,
|
||||||
CONF_FORCE_UPDATE,
|
CONF_FORCE_UPDATE,
|
||||||
@ -197,6 +201,11 @@ class MiFloraSensor(SensorEntity):
|
|||||||
"""Return the device class."""
|
"""Return the device class."""
|
||||||
return self._device_class
|
return self._device_class
|
||||||
|
|
||||||
|
@property
|
||||||
|
def state_class(self):
|
||||||
|
"""Return the state class of this entity."""
|
||||||
|
return STATE_CLASS_MEASUREMENT
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def unit_of_measurement(self):
|
def unit_of_measurement(self):
|
||||||
"""Return the units of measurement."""
|
"""Return the units of measurement."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user