diff --git a/homeassistant/components/hive/binary_sensor.py b/homeassistant/components/hive/binary_sensor.py index cd1bef406d2..5a346c2cc01 100644 --- a/homeassistant/components/hive/binary_sensor.py +++ b/homeassistant/components/hive/binary_sensor.py @@ -2,11 +2,7 @@ from datetime import timedelta from homeassistant.components.binary_sensor import ( - DEVICE_CLASS_CONNECTIVITY, - DEVICE_CLASS_MOTION, - DEVICE_CLASS_OPENING, - DEVICE_CLASS_SMOKE, - DEVICE_CLASS_SOUND, + BinarySensorDeviceClass, BinarySensorEntity, ) from homeassistant.helpers.entity import DeviceInfo @@ -15,12 +11,12 @@ from . import HiveEntity from .const import ATTR_MODE, DOMAIN DEVICETYPE = { - "contactsensor": DEVICE_CLASS_OPENING, - "motionsensor": DEVICE_CLASS_MOTION, - "Connectivity": DEVICE_CLASS_CONNECTIVITY, - "SMOKE_CO": DEVICE_CLASS_SMOKE, - "DOG_BARK": DEVICE_CLASS_SOUND, - "GLASS_BREAK": DEVICE_CLASS_SOUND, + "contactsensor": BinarySensorDeviceClass.OPENING, + "motionsensor": BinarySensorDeviceClass.MOTION, + "Connectivity": BinarySensorDeviceClass.CONNECTIVITY, + "SMOKE_CO": BinarySensorDeviceClass.SMOKE, + "DOG_BARK": BinarySensorDeviceClass.SOUND, + "GLASS_BREAK": BinarySensorDeviceClass.SOUND, } PARALLEL_UPDATES = 0 SCAN_INTERVAL = timedelta(seconds=15) diff --git a/homeassistant/components/hive/sensor.py b/homeassistant/components/hive/sensor.py index bca144cd59c..764c83cfff0 100644 --- a/homeassistant/components/hive/sensor.py +++ b/homeassistant/components/hive/sensor.py @@ -2,7 +2,7 @@ from datetime import timedelta -from homeassistant.components.sensor import DEVICE_CLASS_BATTERY, SensorEntity +from homeassistant.components.sensor import SensorDeviceClass, SensorEntity from homeassistant.helpers.entity import DeviceInfo from . import HiveEntity @@ -11,7 +11,7 @@ from .const import DOMAIN PARALLEL_UPDATES = 0 SCAN_INTERVAL = timedelta(seconds=15) DEVICETYPE = { - "Battery": {"unit": " % ", "type": DEVICE_CLASS_BATTERY}, + "Battery": {"unit": " % ", "type": SensorDeviceClass.BATTERY}, }