From 599c8f4757c5e91bcf9a8383d07715eb069b719b Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 16 Dec 2021 15:49:11 +0100 Subject: [PATCH] Use new enums in neato (#61939) --- homeassistant/components/neato/sensor.py | 10 +++++----- homeassistant/components/neato/switch.py | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/neato/sensor.py b/homeassistant/components/neato/sensor.py index 3f7b925ef7f..7cc2d0f171a 100644 --- a/homeassistant/components/neato/sensor.py +++ b/homeassistant/components/neato/sensor.py @@ -8,11 +8,11 @@ from typing import Any from pybotvac.exceptions import NeatoRobotException from pybotvac.robot import Robot -from homeassistant.components.sensor import DEVICE_CLASS_BATTERY, SensorEntity +from homeassistant.components.sensor import SensorDeviceClass, SensorEntity from homeassistant.config_entries import ConfigEntry -from homeassistant.const import ENTITY_CATEGORY_DIAGNOSTIC, PERCENTAGE +from homeassistant.const import PERCENTAGE from homeassistant.core import HomeAssistant -from homeassistant.helpers.entity import DeviceInfo +from homeassistant.helpers.entity import DeviceInfo, EntityCategory from homeassistant.helpers.entity_platform import AddEntitiesCallback from . import NeatoHub @@ -81,12 +81,12 @@ class NeatoSensor(SensorEntity): @property def device_class(self) -> str: """Return the device class.""" - return DEVICE_CLASS_BATTERY + return SensorDeviceClass.BATTERY @property def entity_category(self) -> str: """Device entity category.""" - return ENTITY_CATEGORY_DIAGNOSTIC + return EntityCategory.DIAGNOSTIC @property def available(self) -> bool: diff --git a/homeassistant/components/neato/switch.py b/homeassistant/components/neato/switch.py index c34eea492e9..f66765ecf0d 100644 --- a/homeassistant/components/neato/switch.py +++ b/homeassistant/components/neato/switch.py @@ -9,9 +9,9 @@ from pybotvac.exceptions import NeatoRobotException from pybotvac.robot import Robot from homeassistant.config_entries import ConfigEntry -from homeassistant.const import ENTITY_CATEGORY_CONFIG, STATE_OFF, STATE_ON +from homeassistant.const import STATE_OFF, STATE_ON from homeassistant.core import HomeAssistant -from homeassistant.helpers.entity import DeviceInfo, ToggleEntity +from homeassistant.helpers.entity import DeviceInfo, EntityCategory, ToggleEntity from homeassistant.helpers.entity_platform import AddEntitiesCallback from . import NeatoHub @@ -109,7 +109,7 @@ class NeatoConnectedSwitch(ToggleEntity): @property def entity_category(self) -> str: """Device entity category.""" - return ENTITY_CATEGORY_CONFIG + return EntityCategory.CONFIG @property def device_info(self) -> DeviceInfo: