Commit Graph

124 Commits (e5b0031103deaba1348657c9fbc0d67a2782b6c0)

Author SHA1 Message Date
jjlawren cdad1a9f27
Use local Sonos API for Plex music playback (#63357) 2022-01-25 21:10:11 -08:00
Paulus Schoutsen a371f8f788
Allow browsing the Spotify media player in Sonos (#64921) 2022-01-25 12:43:43 -08:00
jjlawren a046cef734
Bump soco to 0.26.0 (#64819) 2022-01-24 14:54:27 +01:00
Paulus Schoutsen ed2e1f431c
Allow Sonos to browse and play local media via media browser (#64603) 2022-01-21 13:49:06 -08:00
Paulus Schoutsen 2f18058fe7
Allow browsing favorites in Sonos media browser (#64082)
* Allow browsing favorites in Sonos media browser

* Group favorites by type, add thumbnails

* Update homeassistant/components/sonos/media_player.py

* Apply suggestions from code review

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Keep favorite groups ordering consistent

* Skip root folder if only one child available

Co-authored-by: Jason Lawrence <jjlawren@users.noreply.github.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-01-14 09:28:25 -08:00
epenet ed5e1af10a
Add type hints to media_player (part 2) (#64006) 2022-01-13 10:43:52 +01:00
jjlawren 754f4c52c2
Support media_player grouping services for Sonos (#63256) 2022-01-05 16:22:36 +01:00
jjlawren 4475e88707
Fix Sonos updating when entities are disabled (#62456)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-12-21 20:36:12 -08:00
jjlawren 171b57bf32
Use _attrs where possible in Sonos (#60931) 2021-12-03 10:57:19 -08:00
jjlawren a88cc8b98c
Move Sonos bass & treble controls to number entities (#60498) 2021-11-29 16:00:37 +01:00
Marc Mueller 4c68662612
Use assignment expressions 34 (#58823) 2021-10-31 19:01:16 +01:00
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
Robert Hillis 98c8782c2b
Fix sonos alarm schema (#55318) 2021-08-27 09:25:40 -07:00
Ben Edmunds b167e05a56
Sonos add bass & treble EQ option (#53978) 2021-08-25 17:42:40 +02:00
jjlawren 88cffc86bb
Add crossfade control support to Sonos (#53228) 2021-07-26 21:58:13 +02:00
Anders Melchiorsen e85b0ec052
Move Sonos to upstream SoCo (#53351) 2021-07-23 00:40:30 +02:00
jjlawren d3724355cf
Improve Sonos Spotify/Tidal support, add service exceptions (#51871) 2021-06-17 11:09:57 +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 d755952148
Set playlist name on playing Sonos media (#51685)
* Use playlist name as media_channel if available

* Use proper playlist attribute
2021-06-13 17:24:46 -05:00
jjlawren 2c9e6bd927
Handle Sonos connection issues better when polling (#51376) 2021-06-02 21:10:27 -07: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
Anders Melchiorsen fdfb84e8e2
Upgrade pysonos to 0.0.50 (#51125) 2021-05-27 08:13:10 +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
mountainsandcode 2d29959a52
Add control of hardware buttons to Sonos (#49977) 2021-05-17 11:12:01 +02: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
jjlawren afe02a4ad2
Fix Sonos const comparison (#50482)
* Fix Sonos const comparison

* Use constants for playback states
2021-05-11 16:06:51 -05:00
jjlawren d6a202bd74
Move core Sonos functionality out of entities (#50277) 2021-05-11 10:36:40 -07:00
jjlawren 0cdb8ad892
Fix location of current_play_mode (#50386) 2021-05-10 14:49:11 +02:00
J. Nick Koston 016a4433d2
Handle missing transport_state on media update in sonos (#50051) 2021-05-04 08:54:31 +02:00
Franck Nijhof 2ed386f9e6
Migrate to async_get_current_platform everywhere (#50034) 2021-05-03 09:34:28 -07:00
jjlawren adba82de8b
Do not pass hass.data to Sonos entities (#49881) 2021-04-30 07:01:09 +02:00
Ruslan Sayfutdinov 0301706fc6
Define AddEntitiesCallback type (#49812) 2021-04-29 12:28:14 +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 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 3fa8ffa731
Enable mccabe complexity checks in flake8 (#49616)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-04-25 12:38:40 +02:00
Marc Mueller c07646db5d
Update typing syntax (#49480)
* Update typing syntax

* Replace typing imports with ones from collections where possible

* Changes after review
2021-04-20 17:40:41 +02:00
J. Nick Koston 19e047e801
Fix logic reversal in sonos update_media_radio (#48900) 2021-04-09 07:24:35 +02:00
J. Nick Koston 6dc1414b69
Fix sonos volume always showing 0 (#48685) 2021-04-04 20:26:55 -07:00
J. Nick Koston e008e80bcf
Cleanup sonos (#48684)
- Remove unused code
- Use async_add_executor_job
- Enforce typing
2021-04-04 23:28:29 +02:00
J. Nick Koston bc06100dd8
Make sonos event asyncio (#48618) 2021-04-03 17:10:48 -07:00
Anders Melchiorsen 96c391af09
Fix Sonos Line-in favorites (#48524) 2021-03-31 07:22:54 +02:00
Franck Nijhof 6932cf9534
Use contextlib.suppress where possible (#48189) 2021-03-23 14:36:43 +01:00
J. Nick Koston c820dd4cb5
Have pylint warn when user visible log messages do not start with capital letter or end with a period (#48064)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-03-19 09:26:36 -05:00
Erik Montnemery 14ff6d4d1f
Update integrations p-s to override extra_state_attributes() (#47759) 2021-03-11 21:23:20 +01:00
Anders Melchiorsen c7718f2b3b
Fix Sonos polling mode (#47498) 2021-03-06 10:21:00 +01:00
Tobias Sauerwein 39baeb62f2
Add Sonos media browser image proxy (#46902) 2021-02-24 20:51:12 +01:00
J. Nick Koston 41332493b5
Add suggested area support to Sonos (#46794) 2021-02-19 21:28:52 -10:00
Anders Melchiorsen 1fd3a86239
Upgrade pysonos to 0.0.40 (#45743) 2021-01-30 15:38:43 +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
Anders Melchiorsen 47ff04d9ad
Optimize reading of Sonos source mode (#43541) 2020-11-23 10:20:06 +01:00