mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Use enums in tradfri (#62025)
This commit is contained in:
parent
db4721bfba
commit
357d91fb0e
@ -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…
x
Reference in New Issue
Block a user