mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 14:57:09 +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 pyspcwebgw.const import ZoneInput, ZoneType
|
||||||
|
|
||||||
from homeassistant.components.binary_sensor import (
|
from homeassistant.components.binary_sensor import (
|
||||||
DEVICE_CLASS_MOTION,
|
BinarySensorDeviceClass,
|
||||||
DEVICE_CLASS_OPENING,
|
|
||||||
DEVICE_CLASS_SMOKE,
|
|
||||||
BinarySensorEntity,
|
BinarySensorEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
@ -15,9 +13,9 @@ from . import DATA_API, SIGNAL_UPDATE_SENSOR
|
|||||||
|
|
||||||
def _get_device_class(zone_type):
|
def _get_device_class(zone_type):
|
||||||
return {
|
return {
|
||||||
ZoneType.ALARM: DEVICE_CLASS_MOTION,
|
ZoneType.ALARM: BinarySensorDeviceClass.MOTION,
|
||||||
ZoneType.ENTRY_EXIT: DEVICE_CLASS_OPENING,
|
ZoneType.ENTRY_EXIT: BinarySensorDeviceClass.OPENING,
|
||||||
ZoneType.FIRE: DEVICE_CLASS_SMOKE,
|
ZoneType.FIRE: BinarySensorDeviceClass.SMOKE,
|
||||||
ZoneType.TECHNICAL: "power",
|
ZoneType.TECHNICAL: "power",
|
||||||
}.get(zone_type)
|
}.get(zone_type)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user