From 237a8a833148d1574d0f5fcbd45bd88db0250da4 Mon Sep 17 00:00:00 2001
From: epenet <6771947+epenet@users.noreply.github.com>
Date: Tue, 14 Dec 2021 13:06:55 +0100
Subject: [PATCH] Use new enums in hydrawise (#61781)

Co-authored-by: epenet <epenet@users.noreply.github.com>
---
 homeassistant/components/hydrawise/binary_sensor.py | 7 +++----
 homeassistant/components/hydrawise/sensor.py        | 9 +++------
 homeassistant/components/hydrawise/switch.py        | 6 +++---
 3 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/homeassistant/components/hydrawise/binary_sensor.py b/homeassistant/components/hydrawise/binary_sensor.py
index 7a673a1e7ae..1c201b532f5 100644
--- a/homeassistant/components/hydrawise/binary_sensor.py
+++ b/homeassistant/components/hydrawise/binary_sensor.py
@@ -6,9 +6,8 @@ import logging
 import voluptuous as vol
 
 from homeassistant.components.binary_sensor import (
-    DEVICE_CLASS_CONNECTIVITY,
-    DEVICE_CLASS_MOISTURE,
     PLATFORM_SCHEMA,
+    BinarySensorDeviceClass,
     BinarySensorEntity,
     BinarySensorEntityDescription,
 )
@@ -22,14 +21,14 @@ _LOGGER = logging.getLogger(__name__)
 BINARY_SENSOR_STATUS = BinarySensorEntityDescription(
     key="status",
     name="Status",
-    device_class=DEVICE_CLASS_CONNECTIVITY,
+    device_class=BinarySensorDeviceClass.CONNECTIVITY,
 )
 
 BINARY_SENSOR_TYPES: tuple[BinarySensorEntityDescription, ...] = (
     BinarySensorEntityDescription(
         key="is_watering",
         name="Watering",
-        device_class=DEVICE_CLASS_MOISTURE,
+        device_class=BinarySensorDeviceClass.MOISTURE,
     ),
 )
 
diff --git a/homeassistant/components/hydrawise/sensor.py b/homeassistant/components/hydrawise/sensor.py
index ee9e931a351..a3ff0fef871 100644
--- a/homeassistant/components/hydrawise/sensor.py
+++ b/homeassistant/components/hydrawise/sensor.py
@@ -7,14 +7,11 @@ import voluptuous as vol
 
 from homeassistant.components.sensor import (
     PLATFORM_SCHEMA,
+    SensorDeviceClass,
     SensorEntity,
     SensorEntityDescription,
 )
-from homeassistant.const import (
-    CONF_MONITORED_CONDITIONS,
-    DEVICE_CLASS_TIMESTAMP,
-    TIME_MINUTES,
-)
+from homeassistant.const import CONF_MONITORED_CONDITIONS, TIME_MINUTES
 import homeassistant.helpers.config_validation as cv
 from homeassistant.util import dt
 
@@ -26,7 +23,7 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
     SensorEntityDescription(
         key="next_cycle",
         name="Next Cycle",
-        device_class=DEVICE_CLASS_TIMESTAMP,
+        device_class=SensorDeviceClass.TIMESTAMP,
     ),
     SensorEntityDescription(
         key="watering_time",
diff --git a/homeassistant/components/hydrawise/switch.py b/homeassistant/components/hydrawise/switch.py
index 8b3707ad5a0..8dc91fd1c65 100644
--- a/homeassistant/components/hydrawise/switch.py
+++ b/homeassistant/components/hydrawise/switch.py
@@ -6,8 +6,8 @@ import logging
 import voluptuous as vol
 
 from homeassistant.components.switch import (
-    DEVICE_CLASS_SWITCH,
     PLATFORM_SCHEMA,
+    SwitchDeviceClass,
     SwitchEntity,
     SwitchEntityDescription,
 )
@@ -28,12 +28,12 @@ SWITCH_TYPES: tuple[SwitchEntityDescription, ...] = (
     SwitchEntityDescription(
         key="auto_watering",
         name="Automatic Watering",
-        device_class=DEVICE_CLASS_SWITCH,
+        device_class=SwitchDeviceClass.SWITCH,
     ),
     SwitchEntityDescription(
         key="manual_watering",
         name="Manual Watering",
-        device_class=DEVICE_CLASS_SWITCH,
+        device_class=SwitchDeviceClass.SWITCH,
     ),
 )