Commit Graph

53 Commits (ee80ccf7a64122506ef91bd630e73d8af8a2c1f8)

Author SHA1 Message Date
Paulus Schoutsen a4d9019ffc
Refactor persistent notification to no longer route all data via a service (#57157)
* Convert persistent notification tests to async

* Create/dismiss persistent notifications in exposed functions, not service calls

* Fix notify persistent_notification

* Remove setting up persistent_notification

* Drop more setups

* Empty methods

* Undeprecate sync methods because too big task

* Fix setup clearing notifications

* Fix a bunch of tests

* Fix more tests

* Uno mas

* Test persistent notification events

* Clean up stale comment

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-10-07 12:58:00 +02:00
jjlawren 0d6aa89fd4
Refactor Sonos alarms and favorites updating (#55529) 2021-09-28 09:49:32 +02:00
Michael Chisholm 805e73f78c
Add UPNP device connection for Sonos (#56702) 2021-09-27 17:36:47 +02:00
J. Nick Koston 0363c22dd8
Fix Sonos going offline with 13.3 firmware (#56590) 2021-09-23 20:39:20 -07:00
Erik Montnemery be0819b456
Mock out network.util.async_get_source_ip in tests (#56339) 2021-09-17 21:40:58 -10: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 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
J. Nick Koston 98109caee9
Add zeroconf discovery to Sonos (#52655) 2021-07-12 18:24:12 +02:00
jjlawren 578c897161
Ignore unused keys from Sonos device properties callback (#52660)
* Ignore known but unused keys from device callback

* Fix bug, add test
2021-07-08 11:56:50 +02:00
jjlawren 7b5ed8faa8
Catch unexpected battery update payloads on Sonos (#52040) 2021-06-20 21:38:07 -07: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 e257dd4d07
Fix Sonos battery sensors on S1 firmware (#51585) 2021-06-08 00:29:17 +02: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
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
jjlawren 84f0d3f961
Centralize Sonos subscription logic (#51172)
* Centralize Sonos subscription logic

* Clean up mocked Sonos Service instances, use subscription callback

* Use existing mocked attributes

* Use event dispatcher dict, move methods together, make update_alarms sync

* Create dispatcher dict once
2021-05-28 21:32:50 -05: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
jjlawren 1e86818f85
Add battery support for Sonos S1 speakers (#50864) 2021-05-25 18:39:31 +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
jjlawren 29205a9239
Sonos use common firmware version (#50861) 2021-05-23 08:43:49 -05:00
jjlawren d6a202bd74
Move core Sonos functionality out of entities (#50277) 2021-05-11 10:36:40 -07:00
Ville Skyttä 77d5244577
Use device registry CONNECTION_* constants (#49923) 2021-04-30 23:58:50 +02:00
jjlawren d4ed65e0f5
Add power binary_sensor support to Sonos (#49730)
* 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>
2021-04-27 04:52:05 -10:00
jjlawren dc50524f32
Cleanup implementation of new Sonos sensors (#49716) 2021-04-26 23:59:04 +02:00
jjlawren 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
J. Nick Koston 6dc1414b69
Fix sonos volume always showing 0 (#48685) 2021-04-04 20:26:55 -07:00
J. Nick Koston bc06100dd8
Make sonos event asyncio (#48618) 2021-04-03 17:10:48 -07:00
Erik Montnemery ba2978c693
Update tests p-s to use async_get() instead of async_get_registry() (#47654) 2021-03-09 14:28:32 +01:00
J. Nick Koston 41332493b5
Add suggested area support to Sonos (#46794) 2021-02-19 21:28:52 -10:00
jjlawren 1f66457a34
Separate Plex/Sonos cross-integration tests (#45370) 2021-01-21 11:22:19 +01: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
Ville Skyttä 2fb3be50ab
Make DeviceRegistry.async_get_device connections arg optional (#44897)
* Make async_get_device connections Optional, default None

* Remove unnecessary async_get_device connections arg usages

Some of these were using an incorrect collection type, which didn't
cause issues mostly just due to luck.
2021-01-07 13:49:45 +01:00
Franck Nijhof 65cf2fcb6f
Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
Anders Melchiorsen 30b454ddb7
Fix Sonos shuffle/repeat state with Spotify Connect (#41939) 2020-10-17 09:40:43 +02:00
Franck Nijhof 1c2ebdf307
Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
J. Nick Koston 03b14c9aae
Add sw_version and connections to sonos devices (#35743) 2020-05-17 16:16:50 -05:00
Paulus Schoutsen ec47216388
Use built-in test helpers on 3.8 (#34901) 2020-04-30 13:29:50 -07:00
Paulus Schoutsen 8d2086d076
Sonos services to work without admin access (#31506) 2020-02-05 15:50:20 -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
Anders Melchiorsen 0ecf152153 Continuous discovery of Sonos speakers (#23484) 2019-04-29 10:20:09 +02:00
Anders Melchiorsen 5dbf58d67f
Remove support for deprecated Sonos configuration (#23385) 2019-04-26 08:56:43 +02:00
Anders Melchiorsen c8692fe70c
Use asyncio lock (#21985) 2019-03-13 10:17:09 +01:00
Anders Melchiorsen 193cab4f62 Improve new Sonos snapshot/restore (#21509)
* Fine-tune new Sonos snapshot/restore

* Move into class
2019-02-28 10:25:31 -08:00
Anders Melchiorsen 095a0d19d1 Fix Sonos snapshot/restore (#21411) 2019-02-25 13:03:15 -08:00
Anders Melchiorsen a4bb35142c
Add Sonos discovery of multiple households (#21337)
* Remove confusing device naming

* Add discovery of multiple households

* Rename SonosDevice to SonosEntity
2019-02-24 18:45:08 +01:00
Joakim Plate d16d14b648 Media player const.py move (#20822)
* Move more constants to const.py

* Import constants directly from const

* ATTR_ENTITY_ID is not defined in media_player

* MEDIA_PLAYER_PLAY_MEDIA_SCHEMA is still in __init__.py

* Correct imports in tts

* PLATFORM_SCHEMA, SCHEMA is still defined in __init__.py

* Pandora imports several services

* Some additional fixes for move of const in media_player

* Fix hound lengths
2019-02-08 14:18:18 -08:00
Paulus Schoutsen ec57db78b5
Consolidate config flow components (#20635)
* Consolidate config flow components

* Fix tests

* Fix tests

* Put unifi back

* Fix reqs

* Update coveragerc
2019-02-01 15:45:44 -08:00
Paulus Schoutsen 8b42d0c471 Add confirmation to Cast/Sonos/iOS config entries (#16769)
* Add confirmation to Cast/Sonos/iOS config entries

* Remove redundant code
2018-09-21 16:34:37 +02:00
Anders Melchiorsen 78b6439ee6 Use pysonos for Sonos media player (#16753) 2018-09-20 23:50:11 +02:00