diff --git a/homeassistant/components/lookin/media_player.py b/homeassistant/components/lookin/media_player.py index 9aa105e8f87..a0eceb62f15 100644 --- a/homeassistant/components/lookin/media_player.py +++ b/homeassistant/components/lookin/media_player.py @@ -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, diff --git a/homeassistant/components/lookin/sensor.py b/homeassistant/components/lookin/sensor.py index 7b3972b7ce3..6dee2f2c0ac 100644 --- a/homeassistant/components/lookin/sensor.py +++ b/homeassistant/components/lookin/sensor.py @@ -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, ), )