Use new DeviceClass enums in blebox (#61361)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2021-12-09 15:38:32 +01:00 committed by GitHub
parent fa38a2d0bf
commit 2db1013620
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,16 +1,15 @@
"""Constants for the BleBox devices integration."""
from homeassistant.components.cover import (
DEVICE_CLASS_DOOR,
DEVICE_CLASS_GATE,
DEVICE_CLASS_SHUTTER,
STATE_CLOSED,
STATE_CLOSING,
STATE_OPEN,
STATE_OPENING,
CoverDeviceClass,
)
from homeassistant.components.switch import DEVICE_CLASS_SWITCH
from homeassistant.const import DEVICE_CLASS_TEMPERATURE, TEMP_CELSIUS
from homeassistant.components.sensor import SensorDeviceClass
from homeassistant.components.switch import SwitchDeviceClass
from homeassistant.const import TEMP_CELSIUS
DOMAIN = "blebox"
PRODUCT = "product"
@ -24,11 +23,11 @@ UNSUPPORTED_VERSION = "unsupported_version"
UNKNOWN = "unknown"
BLEBOX_TO_HASS_DEVICE_CLASSES = {
"shutter": DEVICE_CLASS_SHUTTER,
"gatebox": DEVICE_CLASS_DOOR,
"gate": DEVICE_CLASS_GATE,
"relay": DEVICE_CLASS_SWITCH,
"temperature": DEVICE_CLASS_TEMPERATURE,
"shutter": CoverDeviceClass.SHUTTER,
"gatebox": CoverDeviceClass.DOOR,
"gate": CoverDeviceClass.GATE,
"relay": SwitchDeviceClass.SWITCH,
"temperature": SensorDeviceClass.TEMPERATURE,
}
BLEBOX_TO_HASS_COVER_STATES = {