diff --git a/homeassistant/components/logi_circle/sensor.py b/homeassistant/components/logi_circle/sensor.py index 148dd88b41a..cd1dcfa2ede 100644 --- a/homeassistant/components/logi_circle/sensor.py +++ b/homeassistant/components/logi_circle/sensor.py @@ -4,7 +4,11 @@ from __future__ import annotations import logging from typing import Any -from homeassistant.components.sensor import SensorEntity, SensorEntityDescription +from homeassistant.components.sensor import ( + SensorDeviceClass, + SensorEntity, + SensorEntityDescription, +) from homeassistant.config_entries import ConfigEntry from homeassistant.const import ( ATTR_BATTERY_CHARGING, @@ -17,7 +21,6 @@ from homeassistant.const import ( from homeassistant.core import HomeAssistant from homeassistant.helpers.device_registry import DeviceInfo from homeassistant.helpers.entity_platform import AddEntitiesCallback -from homeassistant.helpers.icon import icon_for_battery_level from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType from homeassistant.util.dt import as_local @@ -29,9 +32,8 @@ _LOGGER = logging.getLogger(__name__) SENSOR_TYPES: tuple[SensorEntityDescription, ...] = ( SensorEntityDescription( key="battery_level", - name="Battery", native_unit_of_measurement=PERCENTAGE, - icon="mdi:battery-50", + device_class=SensorDeviceClass.BATTERY, ), SensorEntityDescription( key="last_activity_time", @@ -135,10 +137,6 @@ class LogiSensor(SensorEntity): def icon(self): """Icon to use in the frontend, if any.""" sensor_type = self.entity_description.key - if sensor_type == "battery_level" and self._attr_native_value is not None: - return icon_for_battery_level( - battery_level=int(self._attr_native_value), charging=False - ) if sensor_type == "recording_mode" and self._attr_native_value is not None: return "mdi:eye" if self._attr_native_value == STATE_ON else "mdi:eye-off" if sensor_type == "streaming_mode" and self._attr_native_value is not None: