mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Use enums in pvoutput (#62073)
This commit is contained in:
parent
438fd79d23
commit
5a268419f5
@ -9,10 +9,10 @@ import voluptuous as vol
|
||||
|
||||
from homeassistant.components.rest.data import RestData
|
||||
from homeassistant.components.sensor import (
|
||||
DEVICE_CLASS_ENERGY,
|
||||
PLATFORM_SCHEMA,
|
||||
STATE_CLASS_TOTAL_INCREASING,
|
||||
SensorDeviceClass,
|
||||
SensorEntity,
|
||||
SensorStateClass,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
ATTR_DATE,
|
||||
@ -74,8 +74,8 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
||||
class PvoutputSensor(SensorEntity):
|
||||
"""Representation of a PVOutput sensor."""
|
||||
|
||||
_attr_state_class = STATE_CLASS_TOTAL_INCREASING
|
||||
_attr_device_class = DEVICE_CLASS_ENERGY
|
||||
_attr_state_class = SensorStateClass.TOTAL_INCREASING
|
||||
_attr_device_class = SensorDeviceClass.ENERGY
|
||||
_attr_native_unit_of_measurement = ENERGY_WATT_HOUR
|
||||
|
||||
def __init__(self, rest, name):
|
||||
|
Loading…
x
Reference in New Issue
Block a user