Use opening and occupancy device class in various integrations (#39965)
This commit is contained in:
1 parent
4c0f075d6a
commit
cee96ae207
14 files changed
+62
-25
No files matched your search
@@ -4,7 +4,11 @@ import logging
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
|
||||
from homeassistant.components.binary_sensor import (
|
||||
DEVICE_CLASS_OCCUPANCY,
|
||||
PLATFORM_SCHEMA,
|
||||
BinarySensorEntity,
|
||||
)
|
||||
from homeassistant.const import CONF_ENTITY_NAMESPACE, CONF_MONITORED_CONDITIONS
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
@@ -16,7 +20,7 @@ SCAN_INTERVAL = timedelta(seconds=5)
|
||||
|
||||
# Sensor types: Name, device_class, event
|
||||
SENSOR_TYPES = {
|
||||
"button": ["Button", "occupancy", "device:sensor:button"],
|
||||
"button": ["Button", DEVICE_CLASS_OCCUPANCY, "device:sensor:button"],
|
||||
"motion": ["Motion", "motion", "device:sensor:motion"],
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user