Use opening and occupancy device class in various integrations (#39965)

This commit is contained in:
springstan
2020-09-12 18:07:13 +02:00
committed by GitHub
parent 4c0f075d6a
commit cee96ae207
14 changed files with 62 additions and 25 deletions

View File

@@ -1,9 +1,15 @@
"""Support for the Hive binary sensors."""
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_OPENING,
BinarySensorEntity,
)
from . import DATA_HIVE, DOMAIN, HiveEntity
DEVICETYPE_DEVICE_CLASS = {"motionsensor": "motion", "contactsensor": "opening"}
DEVICETYPE_DEVICE_CLASS = {
"motionsensor": "motion",
"contactsensor": DEVICE_CLASS_OPENING,
}
def setup_platform(hass, config, add_entities, discovery_info=None):