From 3404be8bb0d2272c9d12f5dde5ce32f2c16c7c05 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 14 Dec 2021 19:42:12 +0100 Subject: [PATCH] Use SensorDeviceClass in icloud (#61804) Co-authored-by: epenet --- homeassistant/components/icloud/sensor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/icloud/sensor.py b/homeassistant/components/icloud/sensor.py index 699f3e9baa3..bf5ff5860e3 100644 --- a/homeassistant/components/icloud/sensor.py +++ b/homeassistant/components/icloud/sensor.py @@ -3,9 +3,9 @@ from __future__ import annotations from typing import Any -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, callback from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.entity import DeviceInfo @@ -53,7 +53,7 @@ def add_entities(account, async_add_entities, tracked): class IcloudDeviceBatterySensor(SensorEntity): """Representation of a iCloud device battery sensor.""" - _attr_device_class = DEVICE_CLASS_BATTERY + _attr_device_class = SensorDeviceClass.BATTERY _attr_native_unit_of_measurement = PERCENTAGE def __init__(self, account: IcloudAccount, device: IcloudDevice) -> None: