mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 06:17:07 +00:00
Use new enums in spc (#62384)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
c18c58f560
commit
c7a3a0da9f
@ -2,9 +2,7 @@
|
||||
from pyspcwebgw.const import ZoneInput, ZoneType
|
||||
|
||||
from homeassistant.components.binary_sensor import (
|
||||
DEVICE_CLASS_MOTION,
|
||||
DEVICE_CLASS_OPENING,
|
||||
DEVICE_CLASS_SMOKE,
|
||||
BinarySensorDeviceClass,
|
||||
BinarySensorEntity,
|
||||
)
|
||||
from homeassistant.core import callback
|
||||
@ -15,9 +13,9 @@ from . import DATA_API, SIGNAL_UPDATE_SENSOR
|
||||
|
||||
def _get_device_class(zone_type):
|
||||
return {
|
||||
ZoneType.ALARM: DEVICE_CLASS_MOTION,
|
||||
ZoneType.ENTRY_EXIT: DEVICE_CLASS_OPENING,
|
||||
ZoneType.FIRE: DEVICE_CLASS_SMOKE,
|
||||
ZoneType.ALARM: BinarySensorDeviceClass.MOTION,
|
||||
ZoneType.ENTRY_EXIT: BinarySensorDeviceClass.OPENING,
|
||||
ZoneType.FIRE: BinarySensorDeviceClass.SMOKE,
|
||||
ZoneType.TECHNICAL: "power",
|
||||
}.get(zone_type)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user