Commit Graph
85 Commits
Author SHA1 Message Date
J. Nick Koston 905a0f2eb6 Fix sonos blocking I/O in the event loop (#88554) 2023-02-21 13:54:08 -06:00
jjlawren beaa36c36e Guard against duplicate Sonos discoveries (#88305) 2023-02-18 10:41:25 +01:00
Paulus Schoutsen 3a32d2bdcb Add background tasks to config entries (#88335)
* Use a set for config entries task tracking

* Allow adding background tasks to config entries

* Add tests for config entry add tasks

* Update docstrings on core create task

* Migrate roon and august

* Use in more places

* Guard for None
2023-02-17 13:50:05 -05:00
Paulus Schoutsen baee6b1f5e Fix dangling task for sonos (#88298) 2023-02-16 23:07:35 -05:00
jjlawren a8b7a32578 Handle failed Sonos subscriptions better (#87240)
Catch unsubscribe failure separately from ZGS poll
2023-02-02 23:42:36 -05:00
Marc MuellerandFranck Nijhof 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 Nijhofandjjlawren 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
epenetandepenet 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 LoomanandJ. Nick Koston 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
jjlawrenandMartin Hjelmare 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