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:
Daniel Hjelseth Høyer 2021-05-25 14:47:09 +02:00 committed by GitHub
parent 028a07d86f
commit 7c9d8cfdec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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."""