diff --git a/homeassistant/components/ring/sensor.py b/homeassistant/components/ring/sensor.py index 1aaa073064f..10736c7b85c 100644 --- a/homeassistant/components/ring/sensor.py +++ b/homeassistant/components/ring/sensor.py @@ -206,7 +206,7 @@ SENSOR_TYPES: tuple[RingSensorEntityDescription, ...] = ( name="Battery", category=["doorbots", "authorized_doorbots", "stickup_cams"], native_unit_of_measurement=PERCENTAGE, - device_class="battery", + device_class=SensorDeviceClass.BATTERY, cls=RingSensor, ), RingSensorEntityDescription( @@ -255,7 +255,7 @@ SENSOR_TYPES: tuple[RingSensorEntityDescription, ...] = ( category=["chimes", "doorbots", "authorized_doorbots", "stickup_cams"], native_unit_of_measurement=SIGNAL_STRENGTH_DECIBELS_MILLIWATT, icon="mdi:wifi", - device_class="signal_strength", + device_class=SensorDeviceClass.SIGNAL_STRENGTH, cls=HealthDataRingSensor, ), ) diff --git a/homeassistant/components/vultr/binary_sensor.py b/homeassistant/components/vultr/binary_sensor.py index 4ef35d4f410..1d877216e93 100644 --- a/homeassistant/components/vultr/binary_sensor.py +++ b/homeassistant/components/vultr/binary_sensor.py @@ -5,7 +5,11 @@ import logging import voluptuous as vol -from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity +from homeassistant.components.binary_sensor import ( + PLATFORM_SCHEMA, + BinarySensorDeviceClass, + BinarySensorEntity, +) from homeassistant.const import CONF_NAME from homeassistant.core import HomeAssistant import homeassistant.helpers.config_validation as cv @@ -32,7 +36,6 @@ from . import ( _LOGGER = logging.getLogger(__name__) -DEFAULT_DEVICE_CLASS = "power" DEFAULT_NAME = "Vultr {}" PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( { @@ -64,7 +67,7 @@ def setup_platform( class VultrBinarySensor(BinarySensorEntity): """Representation of a Vultr subscription sensor.""" - _attr_device_class = DEFAULT_DEVICE_CLASS + _attr_device_class = BinarySensorDeviceClass.POWER def __init__(self, vultr, subscription, name): """Initialize a new Vultr binary sensor.""" diff --git a/homeassistant/components/wirelesstag/sensor.py b/homeassistant/components/wirelesstag/sensor.py index fb54c90cc1f..cb5f3c59f57 100644 --- a/homeassistant/components/wirelesstag/sensor.py +++ b/homeassistant/components/wirelesstag/sensor.py @@ -47,7 +47,7 @@ SENSOR_TYPES: dict[str, SensorEntityDescription] = { ), SENSOR_MOISTURE: SensorEntityDescription( key=SENSOR_MOISTURE, - device_class=SENSOR_MOISTURE, + device_class=SensorDeviceClass.MOISTURE, state_class=SensorStateClass.MEASUREMENT, ), SENSOR_LIGHT: SensorEntityDescription(