Commit Graph
66 Commits
Author SHA1 Message Date
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
jjlawrenandJ. Nick Koston 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 Kostonandjjlawren 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 Schneiderandjjlawren 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
jjlawrenandMartin Hjelmare 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
jjlawren d6a202bd74 Move core Sonos functionality out of entities (#50277) 2021-05-11 10:36:40 -07:00
jjlawren dc50524f32 Cleanup implementation of new Sonos sensors (#49716) 2021-04-26 23:59:04 +02:00
3be8c9c1c0 Add battery support for Sonos speakers (#49441)
Co-authored-by: Walter Huf <hufman@gmail.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-04-25 07:20:21 -10:00
jjlawren 411cc6542c Move Plex->Sonos playback to built-in service (#45066)
* Move Plex->Sonos playback service from integration to platform

* Test against 'native' Plex media_players

* Add Plex to Sonos after_dependencies

* Remove circular dependency

* Raise exceptions in failed service calls

* Add test to forward service call from Sonos

* Additional Sonos->Plex tests

* Fix docstring
2021-01-13 15:24:44 +01:00
jjlawren a7dfa60208 Fix Sonos speaker lookup for Plex (#37942) 2020-07-17 18:18:53 -07:00
jjlawrenandPaulus Schoutsen 4e74fae615 Playback on Sonos speakers from Plex integration (#36177)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-05-27 15:36:08 -07:00
Paulus SchoutsenandAnders Melchiorsen 0c3ffbe282 Add foundation for integration services (#30813)
* Add foundation for integration services

* Fix tests

* Remove async_get_platform

* Migrate Sonos partially to EntityPlatform.async_register_entity_service

* Tweaks

* Move other Sonos services to media player domain

* Move other Sonos services to media player domain

* Address comments

* Remove lock

* Fix typos

* Use make_entity_service_schema

* Add area extraction to async_extract_entities

Co-authored-by: Anders Melchiorsen <amelchio@nogoto.net>
2020-01-19 17:55:18 -08:00
Michał Mrozek bfba46d64a move imports in sonos component (#27938) 2019-10-19 23:52:42 +02:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
Adriaan Peeters 412910ca65 Add sonos.play_queue service (#24974)
* Add sonos.play_queue service

* Add SERVICE_PLAY_QUEUE import in alphabetical order

* Add queue_position parameter for sonos.play_queue service

* Move queue_position default to schema definition
2019-07-06 17:19:03 +02:00
Paulus Schoutsen 1e22c8daca Automatically generate config flow list (#23802)
* Add config flow to manifest.json

* Still load config flows via config flow platform

* Fix typo

* Lint

* Update config_flows.py"

* Catch import error when setting up entry

* Lint

* Fix tests

* Fix imports

* Lint

* Fix Unifi tests

* Fix translation test

* Add homekit_controller config flow
2019-05-13 01:16:55 -07:00
Anders Melchiorsen 34f6245e74 Synchronize Sonos service calls (#23791) 2019-05-10 22:37:03 +02:00
Anders Melchiorsen 2efc1de349 Move Sonos services to sonos domain (#23670) 2019-05-05 14:25:57 -05:00
Anders Melchiorsen 5dbf58d67f Remove support for deprecated Sonos configuration (#23385) 2019-04-26 08:56:43 +02:00
cgtobi 2c07bfb9e0 Remove dependencies and requirements (#23024)
* Remove dependencies and requirements

* Revert "Remove dependencies and requirements"

This reverts commit fe7171b4cd30889bad5adc9a4fd60059d05ba5a7.

* Remove dependencies and requirements

* Revert "Remove dependencies and requirements"

This reverts commit 391355ee2cc53cbe6954f940062b18ae34b05621.

* Remove dependencies and requirements

* Fix flake8 complaints

* Fix more flake8 complaints

* Revert non-component removals
2019-04-12 10:13:30 -07:00