Use new SensorDeviceClass enum in homeassistant-triggers (#61764)
Co-authored-by: epenet <epenet@users.noreply.github.com>pull/61791/head
parent
eddc1ae0ed
commit
adc0c6523f
|
@ -128,7 +128,7 @@ async def async_attach_trigger(hass, config, action, automation_info):
|
|||
elif (
|
||||
new_state.domain == "sensor"
|
||||
and new_state.attributes.get(ATTR_DEVICE_CLASS)
|
||||
== sensor.DEVICE_CLASS_TIMESTAMP
|
||||
== sensor.SensorDeviceClass.TIMESTAMP
|
||||
and new_state.state not in (STATE_UNAVAILABLE, STATE_UNKNOWN)
|
||||
):
|
||||
trigger_dt = dt_util.parse_datetime(new_state.state)
|
||||
|
|
Loading…
Reference in New Issue