mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Use new SensorDeviceClass enum in emonitor (#61385)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
497f036af6
commit
f512bacfc7
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
from aioemonitor.monitor import EmonitorChannel
|
from aioemonitor.monitor import EmonitorChannel
|
||||||
|
|
||||||
from homeassistant.components.sensor import DEVICE_CLASS_POWER, SensorEntity
|
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
|
||||||
from homeassistant.const import POWER_WATT
|
from homeassistant.const import POWER_WATT
|
||||||
from homeassistant.helpers import device_registry as dr
|
from homeassistant.helpers import device_registry as dr
|
||||||
from homeassistant.helpers.entity import DeviceInfo
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
@ -37,7 +37,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
|||||||
class EmonitorPowerSensor(CoordinatorEntity, SensorEntity):
|
class EmonitorPowerSensor(CoordinatorEntity, SensorEntity):
|
||||||
"""Representation of an Emonitor power sensor entity."""
|
"""Representation of an Emonitor power sensor entity."""
|
||||||
|
|
||||||
_attr_device_class = DEVICE_CLASS_POWER
|
_attr_device_class = SensorDeviceClass.POWER
|
||||||
_attr_native_unit_of_measurement = POWER_WATT
|
_attr_native_unit_of_measurement = POWER_WATT
|
||||||
|
|
||||||
def __init__(self, coordinator: DataUpdateCoordinator, channel_number: int) -> None:
|
def __init__(self, coordinator: DataUpdateCoordinator, channel_number: int) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user