Add device condition support to sensor entities (#27163)
* Add device condition support to sensor entities * Fix typing
This commit is contained in:
1 parent
45d4586bc2
commit
b8f41dbb75
3 files changed
+434
-1
No files matched your search
@@ -121,7 +121,8 @@ async def async_get_triggers(hass, device_id):
|
||||
if not state or not unit_of_measurement:
|
||||
continue
|
||||
|
||||
device_class = state.attributes.get(ATTR_DEVICE_CLASS)
|
||||
if ATTR_DEVICE_CLASS in state.attributes:
|
||||
device_class = state.attributes[ATTR_DEVICE_CLASS]
|
||||
|
||||
templates = ENTITY_TRIGGERS.get(
|
||||
device_class, ENTITY_TRIGGERS[DEVICE_CLASS_NONE]
|
||||
|
||||
Reference in new issue
Block a user