Use enums in tradfri (#62025)
This commit is contained in:
parent
db4721bfba
commit
357d91fb0e
1 changed files with 3 additions and 3 deletions
|
@ -6,9 +6,9 @@ from typing import Any, cast
|
|||
|
||||
from pytradfri.command import Command
|
||||
|
||||
from homeassistant.components.sensor import SensorEntity
|
||||
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import DEVICE_CLASS_BATTERY, PERCENTAGE
|
||||
from homeassistant.const import PERCENTAGE
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
|
@ -43,7 +43,7 @@ async def async_setup_entry(
|
|||
class TradfriSensor(TradfriBaseDevice, SensorEntity):
|
||||
"""The platform class required by Home Assistant."""
|
||||
|
||||
_attr_device_class = DEVICE_CLASS_BATTERY
|
||||
_attr_device_class = SensorDeviceClass.BATTERY
|
||||
_attr_native_unit_of_measurement = PERCENTAGE
|
||||
|
||||
def __init__(
|
||||
|
|
Loading…
Add table
Reference in a new issue