mirror of
https://github.com/home-assistant/core.git
synced 2025-05-29 10:17:08 +00:00
Add long term stats support to Withings sensors (#74829)
This commit is contained in:
parent
4453241176
commit
a38b36cf34
@ -1,7 +1,11 @@
|
||||
"""Sensors flow for Withings."""
|
||||
from __future__ import annotations
|
||||
|
||||
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN, SensorEntity
|
||||
from homeassistant.components.sensor import (
|
||||
DOMAIN as SENSOR_DOMAIN,
|
||||
SensorEntity,
|
||||
SensorStateClass,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
@ -37,3 +41,8 @@ class WithingsHealthSensor(BaseWithingsSensor, SensorEntity):
|
||||
def native_unit_of_measurement(self) -> str:
|
||||
"""Return the unit of measurement of this entity, if any."""
|
||||
return self._attribute.unit_of_measurement
|
||||
|
||||
@property
|
||||
def state_class(self) -> str:
|
||||
"""Return the state_class of this entity, if any."""
|
||||
return SensorStateClass.MEASUREMENT
|
||||
|
Loading…
x
Reference in New Issue
Block a user