Use opening and occupancy device class in various integrations (#39965)
This commit is contained in:
parent
4c0f075d6a
commit
cee96ae207
14 changed files with 62 additions and 25 deletions
|
@ -4,6 +4,7 @@ import logging
|
|||
from pyspcwebgw.const import ZoneInput, ZoneType
|
||||
|
||||
from homeassistant.components.binary_sensor import (
|
||||
DEVICE_CLASS_OPENING,
|
||||
DEVICE_CLASS_SMOKE,
|
||||
BinarySensorEntity,
|
||||
)
|
||||
|
@ -18,7 +19,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||
def _get_device_class(zone_type):
|
||||
return {
|
||||
ZoneType.ALARM: "motion",
|
||||
ZoneType.ENTRY_EXIT: "opening",
|
||||
ZoneType.ENTRY_EXIT: DEVICE_CLASS_OPENING,
|
||||
ZoneType.FIRE: DEVICE_CLASS_SMOKE,
|
||||
ZoneType.TECHNICAL: "power",
|
||||
}.get(zone_type)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue