Use DEVICE_CLASS_DOOR and DEVICE_CLASS_SMOKE in various integrations (#39950)
This commit is contained in:
1 parent
cf6b84790f
commit
1bb5d4754f
7 files changed
+29
-14
No files matched your search
@@ -8,6 +8,7 @@ import voluptuous as vol
|
||||
|
||||
from homeassistant.components.binary_sensor import (
|
||||
DEVICE_CLASS_SAFETY,
|
||||
DEVICE_CLASS_SMOKE,
|
||||
DEVICE_CLASSES,
|
||||
PLATFORM_SCHEMA,
|
||||
BinarySensorEntity,
|
||||
@@ -90,7 +91,7 @@ def get_opening_type(zone):
|
||||
if "KEY" in zone["name"]:
|
||||
return DEVICE_CLASS_SAFETY
|
||||
if "SMOKE" in zone["name"]:
|
||||
return "smoke"
|
||||
return DEVICE_CLASS_SMOKE
|
||||
if "WATER" in zone["name"]:
|
||||
return "water"
|
||||
return "opening"
|
||||
|
||||
Reference in new issue
Block a user