Use new enums in lookin (#61885)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
232d793661
commit
61a6d278b8
2 changed files with 11 additions and 10 deletions
|
@ -10,8 +10,7 @@ from aiolookin import Remote
|
|||
from aiolookin.models import UDPCommandType, UDPEvent
|
||||
|
||||
from homeassistant.components.media_player import (
|
||||
DEVICE_CLASS_RECEIVER,
|
||||
DEVICE_CLASS_TV,
|
||||
MediaPlayerDeviceClass,
|
||||
MediaPlayerEntity,
|
||||
)
|
||||
from homeassistant.components.media_player.const import (
|
||||
|
@ -34,7 +33,10 @@ from .models import LookinData
|
|||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
|
||||
_TYPE_TO_DEVICE_CLASS = {"01": DEVICE_CLASS_TV, "02": DEVICE_CLASS_RECEIVER}
|
||||
_TYPE_TO_DEVICE_CLASS = {
|
||||
"01": MediaPlayerDeviceClass.TV,
|
||||
"02": MediaPlayerDeviceClass.RECEIVER,
|
||||
}
|
||||
|
||||
_FUNCTION_NAME_TO_FEATURE = {
|
||||
"power": SUPPORT_TURN_OFF,
|
||||
|
|
|
@ -4,11 +4,10 @@ from __future__ import annotations
|
|||
import logging
|
||||
|
||||
from homeassistant.components.sensor import (
|
||||
DEVICE_CLASS_HUMIDITY,
|
||||
DEVICE_CLASS_TEMPERATURE,
|
||||
STATE_CLASS_MEASUREMENT,
|
||||
SensorDeviceClass,
|
||||
SensorEntity,
|
||||
SensorEntityDescription,
|
||||
SensorStateClass,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import PERCENTAGE, TEMP_CELSIUS
|
||||
|
@ -27,15 +26,15 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
|||
key="temperature",
|
||||
name="Temperature",
|
||||
native_unit_of_measurement=TEMP_CELSIUS,
|
||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
device_class=SensorDeviceClass.TEMPERATURE,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="humidity",
|
||||
name="Humidity",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
device_class=DEVICE_CLASS_HUMIDITY,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
device_class=SensorDeviceClass.HUMIDITY,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue