Commit Graph

9 Commits (3672889609c79704bd1e8198dc0a43b0cdd5bce6)

Author SHA1 Message Date
jjlawren 084fd2d19f
Expose Sonos features as switch entities (#54502)
Co-authored-by: Tobias Sauerwein <cgtobi@users.noreply.github.com>
2021-10-23 23:11:27 +02:00
jjlawren 0d6aa89fd4
Refactor Sonos alarms and favorites updating (#55529) 2021-09-28 09:49:32 +02:00
Anders Melchiorsen e85b0ec052
Move Sonos to upstream SoCo (#53351) 2021-07-23 00:40:30 +02:00
jjlawren 31db3fcb23
Refactor Sonos alarms and favorites into system-level coordinators (#51757)
* 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>
2021-06-16 10:30:05 -05:00
jjlawren bd34059c11
Fix use of async in Sonos switch (#51210)
* Fix use of async in Sonos switch

* Simplify

* Convert to callback
2021-05-28 23:28:07 -05:00
jjlawren 4b2831ddde
Improve Sonos alarm logging (#51212) 2021-05-29 00:45:43 +02:00
jjlawren 39e62f9c90
Improve Sonos polling (#51170)
* 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
2021-05-28 12:07:58 +02:00
Aaron David Schneider f7f8672eea
Add tests for sonos switch platform (#51142)
* add tests

* refactor async_added_to_hass

* fix tests and race condition

* use async_get

* typo
2021-05-27 19:56:59 +02:00
Aaron David Schneider 9bf6ea60db
Add Sonos alarm to sonos component (#50719)
* 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>
2021-05-25 11:32:25 -05:00