Commit graph

81 commits

Author SHA1 Message Date
jjlawren
a8b7a32578
Handle failed Sonos subscriptions better (#87240)
Catch unsubscribe failure separately from ZGS poll
2023-02-02 23:42:36 -05:00
Marc Mueller
6397138589
Update Optional typing (1) [Py310] (#86417)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-01-23 09:56:10 +01:00
jjlawren
9d7e99eeb7
Handle timeouts in Sonos, reduce logging noise (#85461) 2023-01-08 13:39:26 -10:00
jjlawren
90e55cd711
Bump soco to 0.29.0 (#85473) 2023-01-09 00:52:22 +02:00
jjlawren
1b592e6885
Use subscription callbacks to discover Sonos speakers (#85411)
fixes undefined
2023-01-08 09:50:18 -10:00
Franck Nijhof
f39f3b612a
String formatting and max line length - Part 5 (#84501)
Co-authored-by: jjlawren <jjlawren@users.noreply.github.com>
2022-12-23 16:43:17 +01:00
Robert Hillis
73ba7a989b
Make Sonos typing more complete (#68072) 2022-09-05 13:12:37 -05:00
jjlawren
bbdce93291
Fix error on shutdown when no Sonos devices available (#75798) 2022-07-27 10:01:44 +02:00
J. Nick Koston
cd03c49fc2
Wait for config entry platform forwards (#73806) 2022-07-09 17:27:42 +02:00
jjlawren
4bfdb1433e
Optimize Sonos unjoin behavior when using media_player.unjoin (#74086)
* Coalesce Sonos unjoins to process together

* Refactor for readability

* Skip unjoin call if already ungrouped

* Store unjoin data in a dedicated dataclass

* Revert import adjustment
2022-06-28 13:19:27 -07:00
jjlawren
8d66623036
Add ZoneGroupState statistics to Sonos diagnostics (#73848) 2022-06-22 12:29:34 -05:00
jjlawren
90e402eca5
Allow removing Sonos devices (#73567) 2022-06-15 19:21:39 -10:00
jjlawren
e339f43322
Add a timeout during Sonos speaker setup (#71973) 2022-05-16 18:03:39 -05:00
jjlawren
532b3d780f
Rework Sonos battery and ping activity tracking (#70942) 2022-05-14 13:40:26 -05:00
jjlawren
c53aa50093
Rework Sonos discovery & availability (#70066) 2022-04-17 22:54:51 -07:00
Marc Mueller
53245c6523
Update pylint to 2.13.0 (#68656) 2022-03-25 15:14:48 -07:00
jjlawren
a4ba71408b
Adjust Sonos visibility checks (#67196) 2022-02-25 08:27:06 -08:00
jjlawren
47af256610
Schedule activity checks when using manual hosts (#65970) 2022-02-09 16:55:00 -06:00
jjlawren
a7fd477c64
Refactor Sonos polling (#65722)
* Refactor Sonos polling

Explicitly rename fallback polling
Catch soco exceptions centrally where possible
Create SonosPollingEntity subclass
Remove unnecessary soco_error fixture argument
Remove unnecessary polling in update_volume()
Adjust log levels and wording
Set explicit timeout on library

* Adjust logging to use raised exceptions

* Simplify availabiliity checks when using built-in poller

* Fix typing for return values
2022-02-08 12:17:05 -06:00
jjlawren
40857bda90
Use SSDP byebye to mark Sonos as offline (#65686) 2022-02-04 11:41:24 -08:00
jjlawren
2129972904
Add activity statistics to Sonos diagnostics (#65214) 2022-01-30 13:15:51 -08:00
jjlawren
ec88897d04
Add event statistics to Sonos diagnostics (#64845) 2022-01-24 22:52:40 -10:00
jjlawren
754f4c52c2
Support media_player grouping services for Sonos (#63256) 2022-01-05 16:22:36 +01:00
epenet
e01b0a3625
Add setup type hints to sonos, unifi and wake_on_lan (#62876)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-27 23:42:24 +01:00
J. Nick Koston
8e0ef52cc8
Ensure sonos ssdp callbacks use dataclass methods (#60782) 2021-12-02 09:53:08 -08:00
jjlawren
e56a676fd5
Import helpers in Sonos instead of accessing hass (#60848) 2021-12-02 18:21:49 +01:00
jjlawren
aa5cf175f4
Set Sonos availability based on activity and discovery (#59994) 2021-11-21 18:48:57 -06:00
jjlawren
81e02a39df
Ignore non-Sonos SSDP devices with Sonos-like identifiers (#59809) 2021-11-19 10:14:12 -06:00
Marc Mueller
9561c51276
Use assignment expressions 16 (#57962) 2021-10-18 19:36:35 -07:00
J. Nick Koston
0363c22dd8
Fix Sonos going offline with 13.3 firmware (#56590) 2021-09-23 20:39:20 -07:00
Steven Looman
73260c5b88
Move parts of ssdp to async_upnp_client (#55540)
* Move parts of ssdp to async_upnp_client

* Fix test for environments with multiple sources

* Fix sonos tests

* More fixes/changes

* More fixes

* Use async_upnp_client==0.21.0

* Pylint/test fixes

* More changes after review

* Fix tests

* Improve testing

* Fix mypy

* Fix yamaha_musiccast tests?

* Changes after review

* Pylint

* Reduce calls to combined_headers

* Update to async_upnp_client==0.21.1

* Update to async_upnp_client==0.21.2

* use as_dict

Co-authored-by: J. Nick Koston <nick@koston.org>
2021-09-11 13:38:16 -10:00
jjlawren
87e0b14282
Log gathered exceptions during Sonos unsubscriptions (#54190) 2021-08-12 11:46:07 -05:00
jjlawren
1eeb12ba1c
Support unloading/reloading Sonos (#54418) 2021-08-10 10:57:39 -07:00
jjlawren
214920f486
Ignore Sonos Boost devices during discovery v2 (#53358) 2021-07-27 09:50:46 -05:00
Anders Melchiorsen
e85b0ec052
Move Sonos to upstream SoCo (#53351) 2021-07-23 00:40:30 +02:00
jjlawren
a2fbc4218d
Cleanup regroup handling in Sonos (#53241)
Check event before creating coroutine
Remove unnecessary regrouping dispatcher
Update typing to reflect actual behavior
Add optimizations for polling mode
2021-07-20 20:21:48 +02:00
Marc Mueller
f6b162bc39
Add pylint CodeStyle extension (#53147) 2021-07-19 06:57:06 -07:00
Ville Skyttä
470f2dd73f
Upgrade pyupgrade to 2.21.2, apply its changes (#52987) 2021-07-19 10:46:09 +02:00
jjlawren
0277a645f1
Log source of discovery in Sonos (#53101) 2021-07-16 11:12:01 -10:00
J. Nick Koston
98109caee9
Add zeroconf discovery to Sonos (#52655) 2021-07-12 18:24:12 +02:00
jjlawren
2b6a3716e8
Ignore Sonos Boost devices during discovery (#52845) 2021-07-12 17:09:45 +02:00
jjlawren
dabb50f7ee
Warn if interface_addr remains in Sonos configuration (#52652) 2021-07-08 09:15:56 +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
c362ffd384
Clean up unused Sonos subscriptions (#51583) 2021-06-09 23:31:14 -05:00
jjlawren
4ffa0dd199
Detect Sonos reboots and recreate subscriptions (#51377) 2021-06-07 20:51:42 -05:00
jjlawren
e5309e89ea
Skip processed Sonos alarm updates (#51217)
* Skip processed Sonos alarm updates

* Fix bad conflict merge
2021-05-30 21:03:53 -07:00
jjlawren
1a5d35d7bf
Only debug log new Sonos SSDP discoveries (#51247)
* 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>
2021-05-30 20:28:22 -05:00
J. Nick Koston
c5e5787e1d
Replace sonos discovery thread with ssdp callback registration (#51033)
Co-authored-by: jjlawren <jjlawren@users.noreply.github.com>
2021-05-29 08:31:22 -05: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
jjlawren
b84cf915f3
Centralize storage and updating of Sonos favorites (#50581)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-05-16 11:11:35 +02:00