Check event before creating coroutine
Remove unnecessary regrouping dispatcher
Update typing to reflect actual behavior
Add optimizations for polling mode
* Refactor alarms and favorites into household-level coordinators
Create SonosHouseholdCoodinator class for system-level data
Fix polling for both alarms and favorites
Adjust tests
* Fix docstring
* Review cleanup
* Move exception handling up a level, do not save a failed coordinator
* Apply suggestions from code review
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Only debug log new SSDP discoveries
* Use existing reference
* Remove from known on unseen
* Update homeassistant/components/sonos/speaker.py
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: J. Nick Koston <nick@koston.org>
* Improve Sonos polling
Warn user if polling is being used
Provide callback IP:port to help user fix networking
Fix radio handling when polling (no event payload)
Clarify dispatch target to reflect polling action
* Lint
* Revert method removal
* add sonos_alarm
* bug fix for _update_device
* fix pylint and black and co
* small bug fix in speaker.available_alarms
* cleanup and add _LOGGER.debug statements, fix pylint
* fix pylint
* _alarm_id to alarm_id
* fixed rare bug due to raceconditions
* Part 2 of raceconditionfix
* address review suggestions
* readd check for not yet subscribed
* - platforms_ready fix
- add alarmClock to pytest mock
* fixture for ListAlarms
* cleanup mock and match UUID for test
* add simple tests for sonos_alarm
* extend test for attributes
* typhint fix
* typo
* use get_alarms() directly
* refactor available_alarms
* fix attributes
* some cleanup
* change logic of fetch_alarms_for_speaker and rename to update_alarms_for_speaker
* update_alarms_for_speaker is now a method
* Update homeassistant/components/sonos/switch.py
Co-authored-by: jjlawren <jjlawren@users.noreply.github.com>
* Update homeassistant/components/sonos/speaker.py
Co-authored-by: jjlawren <jjlawren@users.noreply.github.com>
Co-authored-by: jjlawren <jjlawren@users.noreply.github.com>
* Add power binary_sensor support to Sonos
* Prepare for future unloading of config entries
* Remove unnecessary calls to super() inits
* Add binary_sensor to tests, remove invalid test for empty battery payload
* Move sensor added_to_hass to common sensor class
* Avoid dispatching sensors if no battery
* Use proper attributes property
* Remove power source fallback
* Update homeassistant/components/sonos/speaker.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>