Use new SensorDeviceClass enum in homeassistant-triggers (#61764)

Co-authored-by: epenet <epenet@users.noreply.github.com>
pull/61791/head
epenet 2021-12-14 11:24:32 +01:00 committed by GitHub
parent eddc1ae0ed
commit adc0c6523f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -128,7 +128,7 @@ async def async_attach_trigger(hass, config, action, automation_info):
elif ( elif (
new_state.domain == "sensor" new_state.domain == "sensor"
and new_state.attributes.get(ATTR_DEVICE_CLASS) 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) and new_state.state not in (STATE_UNAVAILABLE, STATE_UNKNOWN)
): ):
trigger_dt = dt_util.parse_datetime(new_state.state) trigger_dt = dt_util.parse_datetime(new_state.state)