Use new DeviceClass enums in hive (#61758)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
3404be8bb0
commit
67ddfcb218
2 changed files with 9 additions and 13 deletions
|
@ -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)
|
||||
|
|
|
@ -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},
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue