Use DEVICE_CLASS_DOOR and DEVICE_CLASS_SMOKE in various integrations (#39950)

This commit is contained in:
springstan authored and GitHub committed 2020-09-12 07:35:24 -05:00
1 parent cf6b84790f
commit 1bb5d4754f
7 files changed
+29 -14

No files matched your search

@@ -3,7 +3,10 @@ import logging
from pyspcwebgw.const import ZoneInput, ZoneType
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_SMOKE,
BinarySensorEntity,
)
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
@@ -16,7 +19,7 @@ def _get_device_class(zone_type):
return {
ZoneType.ALARM: "motion",
ZoneType.ENTRY_EXIT: "opening",
ZoneType.FIRE: "smoke",
ZoneType.FIRE: DEVICE_CLASS_SMOKE,
ZoneType.TECHNICAL: "power",
}.get(zone_type)