Improve sonos alarms typing (#137078)

pull/137089/head
Marc Mueller 2025-02-01 14:48:46 +01:00 committed by GitHub
parent 37daa57818
commit da7ba85ee6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -66,7 +66,10 @@ class SonosAlarms(SonosHouseholdCoordinator):
event_id = event.variables["alarm_list_version"].split(":")[-1]
event_id = int(event_id)
async with self.cache_update_lock:
if event_id <= self.last_processed_event_id:
if (
self.last_processed_event_id
and event_id <= self.last_processed_event_id
):
# Skip updates if this event_id has already been seen
return
speaker.event_stats.process(event)