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
1 changed files with 2 additions and 2 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
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.helpers import device_registry as dr
|
||||
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):
|
||||
"""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
|
||||
|
||||
def __init__(self, coordinator: DataUpdateCoordinator, channel_number: int) -> None:
|
||||
|
|
Loading…
Add table
Reference in a new issue