mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Add state_class to OHM sensors (#125567)
* Minimum change required to get OHW into statistics Not sure if there is any reason not to have this, my only idea would be that there would be that there are A LOT of values, but as far as I can see there are already long term data being stored about them anyway * Update sensor.py Guess that was an old way of doing it -_- * Update sensor.py remove spaces the break ruff -_- * Update sensor.py ruff is rough
This commit is contained in:
parent
d8bb8f1efb
commit
379a8f2f86
@ -11,6 +11,7 @@ import voluptuous as vol
|
||||
from homeassistant.components.sensor import (
|
||||
PLATFORM_SCHEMA as SENSOR_PLATFORM_SCHEMA,
|
||||
SensorEntity,
|
||||
SensorStateClass,
|
||||
)
|
||||
from homeassistant.const import CONF_HOST, CONF_PORT
|
||||
from homeassistant.core import HomeAssistant
|
||||
@ -60,6 +61,8 @@ def setup_platform(
|
||||
class OpenHardwareMonitorDevice(SensorEntity):
|
||||
"""Device used to display information from OpenHardwareMonitor."""
|
||||
|
||||
_attr_state_class = SensorStateClass.MEASUREMENT
|
||||
|
||||
def __init__(self, data, name, path, unit_of_measurement):
|
||||
"""Initialize an OpenHardwareMonitor sensor."""
|
||||
self._name = name
|
||||
|
Loading…
x
Reference in New Issue
Block a user