mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Guard against future unknown SimpliSafe entity types (#30059)
* Guard against future unknown SimpliSafe entity types * Updated log message
This commit is contained in:
parent
5ea4ba6a2e
commit
9e5de1a106
@ -177,11 +177,23 @@ class SimpliSafeAlarm(SimpliSafeEntity, AlarmControlPanel):
|
|||||||
self._state = None
|
self._state = None
|
||||||
|
|
||||||
last_event = self._simplisafe.last_event_data[self._system.system_id]
|
last_event = self._simplisafe.last_event_data[self._system.system_id]
|
||||||
|
|
||||||
|
try:
|
||||||
|
last_event_sensor_type = EntityTypes(last_event["sensorType"]).name
|
||||||
|
except ValueError:
|
||||||
|
_LOGGER.warning(
|
||||||
|
'Encountered unknown entity type: %s ("%s"). Please report it at'
|
||||||
|
"https://github.com/home-assistant/home-assistant/issues.",
|
||||||
|
last_event["sensorType"],
|
||||||
|
last_event["sensorName"],
|
||||||
|
)
|
||||||
|
last_event_sensor_type = None
|
||||||
|
|
||||||
self._attrs.update(
|
self._attrs.update(
|
||||||
{
|
{
|
||||||
ATTR_LAST_EVENT_INFO: last_event["info"],
|
ATTR_LAST_EVENT_INFO: last_event["info"],
|
||||||
ATTR_LAST_EVENT_SENSOR_NAME: last_event["sensorName"],
|
ATTR_LAST_EVENT_SENSOR_NAME: last_event["sensorName"],
|
||||||
ATTR_LAST_EVENT_SENSOR_TYPE: EntityTypes(last_event["sensorType"]).name,
|
ATTR_LAST_EVENT_SENSOR_TYPE: last_event_sensor_type,
|
||||||
ATTR_LAST_EVENT_TIMESTAMP: utc_from_timestamp(
|
ATTR_LAST_EVENT_TIMESTAMP: utc_from_timestamp(
|
||||||
last_event["eventTimestamp"]
|
last_event["eventTimestamp"]
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user