Commit Graph

307 Commits (ce9385d4421613e7f6d9d24946163724153122ee)

Author SHA1 Message Date
jjlawren db82808466
Skip adding battery on S1 Sonos devices (#50536) 2021-05-12 20:40:10 +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 897dd012cd
Handle transport errors when updating media via events (#50481) 2021-05-11 16:00:56 -05:00
jjlawren d6a202bd74
Move core Sonos functionality out of entities (#50277) 2021-05-11 10:36:40 -07:00
jjlawren 9ae021a284
Bump pysonos to 0.0.45 (#50407) 2021-05-10 08:56:18 -07:00
jjlawren 0cdb8ad892
Fix location of current_play_mode (#50386) 2021-05-10 14:49:11 +02:00
jjlawren 85d782808c
Fix Sonos polling bug (#50265) 2021-05-09 11:09:56 +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
Milan Meulemans 29d72714f3
Replace dict with DeviceInfo (#49950)
* Replace dict with DeviceInfo

* Clean up

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-05-02 00:37:19 +02:00
J. Nick Koston 4bebedb658
Bump pysonos to 0.0.44 to fix client session race (#49964)
Fixes #49954
2021-05-01 12:26:10 -10:00
jjlawren adba82de8b
Do not pass hass.data to Sonos entities (#49881) 2021-04-30 07:01:09 +02:00
Franck Nijhof c68b259bd3
Cleanup of unused connection_class logic (#49865)
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-04-29 23:12:58 +02:00
jjlawren db886ef03a
Add additional Sonos codeowner (#49879) 2021-04-29 13:50:16 -07: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 dc50524f32
Cleanup implementation of new Sonos sensors (#49716) 2021-04-26 23:59:04 +02:00
tkdrob d24cbde913
Add target and selectors to sonos services (#49536) 2021-04-25 10:28:42 -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 f7b7a805f5
Bump pysonos to 0.0.43 (#49330)
- Downgrade asyncio log severity
2021-04-16 20:19:50 -10:00
Franck Nijhof 055cdc64c0
Add support for IoT class in manifest (#46935) 2021-04-15 10:21:38 +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 d417dcb8f4
Bump pysonos to 0.0.42 to fix I/O in event loop (#48743)
fixes #48732

Changelog: https://github.com/amelchio/pysonos/compare/v0.0.41...v0.0.42
2021-04-07 00:15:36 +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
HomeAssistant Azure c11b85af2f [ci skip] Translation update 2021-03-16 00:04:36 +00: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
Franck Nijhof ea4bbd771f
Add service names to previously enriched services (#46929)
Co-authored-by: Tobias Sauerwein <cgtobi@users.noreply.github.com>
2021-02-23 14:10:13 +01:00
HomeAssistant Azure 0cb1f61deb [ci skip] Translation update 2021-02-21 00:07:04 +00:00
J. Nick Koston 41332493b5
Add suggested area support to Sonos (#46794) 2021-02-19 21:28:52 -10:00
Bram Kragten 6986fa4eb6
Add target to services.yaml (#46410)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-02-16 09:35:27 +01:00
Paulus Schoutsen 959ed6d077 Update translations 2021-02-03 11:46:49 +01: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
HomeAssistant Azure 42f00cff30 [ci skip] Translation update 2020-12-04 00:05:42 +00:00
Anders Melchiorsen 47ff04d9ad
Optimize reading of Sonos source mode (#43541) 2020-11-23 10:20:06 +01:00
Anders Melchiorsen 9ffdec63cc
Optimize Sonos current playing state (#43517) 2020-11-22 22:16:03 +01:00
Anders Melchiorsen 62da64867c
Optimize Sonos favorites updates (#43516) 2020-11-22 14:04:46 +01:00
Anders Melchiorsen 7319c4692d
Optimize Sonos queue position (#43514) 2020-11-22 12:25:13 +01:00
Paulus Schoutsen bae026a6fe
Add support for selectors in services.yaml (#43162)
* Add support for selectors in services.yaml

* Add base schema validation
2020-11-13 22:53:55 +01:00
Anders Melchiorsen 96641cab02
Fix playing of Spotify URIs on Sonos (#43154) 2020-11-13 09:40:00 +01:00
HomeAssistant Azure aab0ff2ea5 [ci skip] Translation update 2020-11-03 00:04:39 +00:00
HomeAssistant Azure ed232ac733 [ci skip] Translation update 2020-10-24 00:05:17 +00:00
Anders Melchiorsen 30b454ddb7
Fix Sonos shuffle/repeat state with Spotify Connect (#41939) 2020-10-17 09:40:43 +02:00
HomeAssistant Azure 994ae09f69 [ci skip] Translation update 2020-10-15 00:03:50 +00:00
Anders Melchiorsen b5308bda09
Add Sonos support for media_player.repeat_set service (#41735)
* Add Sonos support for media_player.repeat_set service

* Update homeassistant/components/sonos/media_player.py

* Remove else for pylint

Co-authored-by: cgtobi <cgtobi@users.noreply.github.com>
2020-10-13 00:30:38 +02:00
HomeAssistant Azure 80522f1bdc [ci skip] Translation update 2020-10-11 00:03:37 +00:00
HomeAssistant Azure 6ae12c3faf [ci skip] Translation update 2020-10-10 00:05:05 +00:00
HomeAssistant Azure 29aea5a66c [ci skip] Translation update 2020-10-09 00:04:33 +00:00
tkdrob 1ed6133ee6
Add update_alarm to sonos services.yaml (#41376) 2020-10-07 08:18:13 +02:00
Anders Melchiorsen a65dcbf204
Allow playing Spotify URLs with Sonos (#41366) 2020-10-07 00:15:09 +02:00
HomeAssistant Azure bcfa4ac959 [ci skip] Translation update 2020-10-06 00:08:09 +00:00
HomeAssistant Azure 8d1d585b40 [ci skip] Translation update 2020-10-05 00:04:23 +00:00
HomeAssistant Azure f8c2d877aa [ci skip] Translation update 2020-10-04 00:05:05 +00:00
Jason Madigan ed867955f4
Use reference strings in sonos (#41122) 2020-10-03 12:02:12 +02:00
Anders Melchiorsen e08934ee4c
Support adding Spotify share links to the Sonos queue (#40802) 2020-09-30 21:19:41 +02:00
cgtobi 689f1519c0
Add cgtobi to sonos code owners (#40204)
* Add myself to Sonos code owners

* Run hassfest
2020-09-17 20:16:29 -05:00
cgtobi 8236394b85
Check Sonos for local library before browsing (#40085) 2020-09-15 09:30:00 +02:00
Martin Hjelmare e96fed20c8
Add children media class (#39902)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-09-11 13:08:13 +02:00
Martin Hjelmare 586d7eaba6
Add media class browse media attribute (#39770) 2020-09-08 16:42:01 +02:00
cgtobi 973524a4e6
Fix Sonos issue (#39790) 2020-09-08 14:13:48 +02:00
cgtobi 21dbce1554
Make Sonos use BrowseMedia (#39742) 2020-09-07 11:24:31 +02:00
Paulus Schoutsen df8daf561e
Browse media class (#39698) 2020-09-06 15:52:59 +02:00
Anders Melchiorsen da82d171e0
Add radio channel attribute to Sonos (#39631) 2020-09-03 23:47:32 +02:00
cgtobi 603707aa85
Add Sonos media browser capability (#39239) 2020-09-02 10:57:12 +02:00
Franck Nijhof 1c2ebdf307
Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
jjlawren a7dfa60208
Fix Sonos speaker lookup for Plex (#37942) 2020-07-17 18:18:53 -07:00
Anders Melchiorsen 2d93f8eae8
Upgrade pysonos to 0.0.32 (#37923) 2020-07-16 17:26:29 -07:00
HomeAssistant Azure b15caf31a9 [ci skip] Translation update 2020-06-15 00:03:32 +00:00
Ian 5b2bf8fd17
Add status_light to Sonos set_option service (#35515) 2020-06-08 23:41:12 +02:00
Giel Janssens af4fb03230
Sonos queue (#35817)
* Add playbase as a model

* Sonos queue

* Match counting of the queue with service play_queue

* Add service remove_from_queue

* Change description of remove_from_queue

* Use ATTR_QUEUE_POSITION instead of ATTR_CURRENT_QUEUE_POSITION

* Removed queue and show queue_position only when playing local

* Add property queue_position

* Return None instead of -1

* Change docstring from -1 to None
2020-06-08 16:37:35 +02:00
J. Nick Koston c0307dca3a
Upgrade pysonos to 0.0.31 (#36483) 2020-06-05 10:30:20 -07:00
HomeAssistant Azure 564fb1d1e5 [ci skip] Translation update 2020-05-29 00:04:16 +00:00
jjlawren 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
Anders Melchiorsen 275c8b6982
Update sonos codeowners (#36016) 2020-05-23 11:08:01 +02:00
Anders Melchiorsen d6a5cb6083
Upgrade pysonos to 0.0.30 (#35793) 2020-05-19 08:58:51 +02:00
Anders Melchiorsen 796e6141ac
Handle Sonos changing IP address (#35639) 2020-05-17 20:20:10 -05:00
J. Nick Koston 03b14c9aae
Add sw_version and connections to sonos devices (#35743) 2020-05-17 16:16:50 -05:00
Anders Melchiorsen 4b00dedff5
Upgrade to pysonos 0.0.29 (#35617) 2020-05-14 10:24:26 -05:00
Paulus Schoutsen 0efeefe3b2 Update translations 2020-05-13 11:27:21 -07:00
Franck Nijhof 4cf186a47e
Small collection of random styling tweaks, fixes and Pythonism (#35390) 2020-05-09 00:10:17 +02:00
Anders Melchiorsen b3e637ca7a
Some Sonos fixes (#35115) 2020-05-04 11:22:47 -07:00
HomeAssistant Azure 90e0a1af8a [ci skip] Translation update 2020-04-26 00:02:45 +00:00
Erik Montnemery 62bc02fdda
Rename MediaPlayerDevice to MediaPlayerEntity (#34592) 2020-04-25 18:00:57 +02:00
Paulus Schoutsen e002c84eba
Don't set step title if it's integration title (#34524) 2020-04-22 15:05:39 +02:00
Joakim Sørensen 730a257f3c
Rename translations dir for integrations (#34494) 2020-04-21 16:11:05 -07:00
Anders Melchiorsen cd3fc7c76d
Fixes for Sonos media titles (#34311) 2020-04-16 15:16:18 -07:00
Paulus Schoutsen 0d60d40512 Update translations 2020-04-16 13:00:10 -07:00
Paulus Schoutsen 55dfca7467
Drop title from translations if brand name (#34306) 2020-04-16 12:52:53 -07:00
Paulus Schoutsen f06aeea385 Update translations 2020-04-15 09:51:07 -07:00
Paulus Schoutsen d36204a968
Move title translation to root (#33850) 2020-04-15 09:41:18 -07:00
Franck Nijhof 39336d3ea3
Add prettier (in pre-commit and CI) (#33693)
* Add prettier (in pre-commit and CI)

* Make all file prettier

* Change order

* Add to Azure Pipelines

* Fix a YAML file prettier caught as invalid

* Remove flow mapping using curly braces from all YAML service files
2020-04-05 17:27:16 +02:00
Franck Nijhof 7d3c974747
Use set & dict literals (#33636)
Co-authored-by: Daniel Høyer Iversen <mail@dahoiv.net>
2020-04-04 20:05:15 +02:00
Anders Melchiorsen c628c2cef2
Identify more Sonos radio stations with poor titles (#33609) 2020-04-03 22:41:39 -07:00
Paulus Schoutsen f1d3c0d19b
Remove unused manifest fields (#33595) 2020-04-03 12:58:19 -07:00
Paulus Schoutsen aaa1d06809
Directly call async_write_ha_state (#33508)
* Directly call async_write_ha_state

* Address comments

* Fix tests
2020-04-01 14:19:51 -07:00
Anders Melchiorsen 03a090e384
Fixes for Sonos media position (#33379) 2020-03-28 16:15:32 -07:00
Anders Melchiorsen 699ca44260
Clean up Sonos attributes for radio streams (#33063) 2020-03-21 12:17:00 -07:00
Paulus Schoutsen 1fe26c77e0
Sonos idle (#32712)
* Sonos idle

* F-string

* Add to properties

* Fixes
2020-03-12 14:47:57 -07:00
Georgi Gardev aed15761de
Sonos: Return URI as media_content_id (#32626) 2020-03-10 08:17:07 +01:00
HomeAssistant Azure 8257165562 [ci skip] Translation update 2020-02-23 00:31:50 +00:00
Paulus Schoutsen e019280d94
Annotate more async functions correctly (#31802) 2020-02-14 10:00:22 -08:00
Franck Nijhof 0173c61fee
Spelling: Config(uration) (#31782) 2020-02-13 08:27:00 -08:00
Paulus Schoutsen 8d2086d076
Sonos services to work without admin access (#31506) 2020-02-05 15:50:20 -08:00
Paulus Schoutsen 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
Franck Nijhof a84741392b
Format all manifests with prettier (#30521) 2020-01-06 21:28:23 +01:00
HomeAssistant Azure 13116d8d3f [ci skip] Translation update 2019-12-30 00:32:19 +00:00
HomeAssistant Azure bb35d93fde [ci skip] Translation update 2019-12-25 00:32:06 +00:00
Ville Skyttä 99c7608fb4 Lint config cleanups (#28864)
* Remove bunch of unneeded lint exclusions

* Use symbolic names instead of identifiers in pylint disables

* Tighten scope of some pylint disables
2019-11-25 22:40:08 -08:00
Tim McCormick 5cbb6607a6 Fix missing import (#28460) 2019-11-02 21:25:24 -07:00
Ville Skyttä 1679ec3245 SSDP matching improvements (#28285)
* SSDP matching improvements

- support multiple match groups per domain
- require matches on all, not any item in a group
- support matching on all UPnP device description data

* Manifest structure fixes
2019-11-02 12:30:09 -07:00
Michał Mrozek bfba46d64a move imports in sonos component (#27938) 2019-10-19 23:52:42 +02:00
Tim McCormick 2a269fb9eb Update pysonos to 0.0.24 (#27937) 2019-10-19 22:54:36 +02:00
Franck Nijhof c7da781efc Update documentation link URL for integrations in all manifests (#27114) 2019-10-02 09:25:44 -07:00
HomeAssistant Azure b04a70995e [ci skip] Translation update 2019-09-27 00:32:12 +00:00
Anders Melchiorsen aac2c3e91c Update codeowners (#26733) 2019-09-19 14:39:57 -07:00
Franck Nijhof 445c741b30 Use literal string interpolation in integrations R-S (f-strings) (#26392) 2019-09-03 21:14:39 +02:00
Anders Melchiorsen 3534b8a977 Fix race during initial Sonos group construction (#26371)
* Fix race during initial Sonos group construction

* Update homeassistant/components/sonos/media_player.py
2019-09-03 14:14:33 +02:00
Paulus Schoutsen e69953fe2d Update translations 2019-08-28 12:45:48 -07:00
ahertz 7fd53ac912 Sonos playlists play media (#26054)
* Add handling for Sonos playlists in media_player.play_media

* Avoid breaking change by falling back to previous behavior

* Use the proper MEDIA_TYPE_PLAYLIST constant.

* Addressed comments, restricting media_type to music or playlist
2019-08-20 10:53:45 -07:00
Anders Melchiorsen cbcf49a3ba Improve Sonos error handling on slow networks (#25902) 2019-08-14 09:17:58 -07:00
Paulus Schoutsen 37d78af42c Add translations 2019-07-31 16:16:40 -07:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
Anders Melchiorsen 5e805768aa Update pysonos to 0.0.22 (#25399) 2019-07-23 06:31:05 +02:00
Anders Melchiorsen 5e5abf77da Update pysonos to 0.0.21 (#25168) 2019-07-16 04:22:41 +02:00
Anders Melchiorsen 1798522ec8 Handle Sonos connection errors during setup (#25135) 2019-07-14 14:36:05 -07:00
Anders Melchiorsen 6173d7c8a0
Support podcast episodes as Sonos favorites (#25087) 2019-07-12 07:08:57 +02:00
Anders Melchiorsen 1afa136fc0 Fix for Sonos debug logging (#25064)
* Fix for Sonos debug logging

* Start logging messages with capital letters
2019-07-10 12:19:28 -07:00
Anders Melchiorsen 18d27c997d Add Sonos debug logging (#25063) 2019-07-10 09:30:45 -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
Anders Melchiorsen a1aaeab33a Update pysonos to 0.0.19 (#24930) 2019-07-03 19:26:16 -04:00
Anders Melchiorsen c0a342d790 Stability improvements for Sonos availability (#24880)
* Stability improvements for Sonos availability

* Handle seen reentrancy
2019-07-02 09:25:02 -04:00
Anders Melchiorsen 6e14e8ed91 Update pysonos to 0.0.17 (#24740) 2019-06-24 14:59:15 -07:00
Anders Melchiorsen 08e2959742 Update pysonos to 0.0.16 (#24607) 2019-06-19 10:09:50 +02:00
Anders Melchiorsen 1e248551d5 Update pysonos to 0.0.15 (#24565) 2019-06-16 19:41:13 +02:00
Paulus Schoutsen 08591dae0e
Migrate Sonos discovery to manifest (#24507) 2019-06-13 11:09:07 -07:00
Anders Melchiorsen b6bb6919e6 Update pysonos to 0.0.14 (#24185) 2019-05-30 09:24:38 +02:00
Anders Melchiorsen f8572c1d71 Avoid slow updates with unavailable Sonos devices (#24180) 2019-05-29 15:05:12 -07:00
Anders Melchiorsen bebfc3d16e Remove unused Sonos turn on/off methods (#24174) 2019-05-29 11:12:44 -07:00
Anders Melchiorsen 97b671171b Avoid useless Sonos state updates (#24135) 2019-05-26 12:49:26 -07:00
Paulus Schoutsen f995ab9d54
Don't pass in loop (#23984)
* Don't pass in loop

* Revert some changes

* Lint + Axis revert

* reinstate loop

* Fix a test

* Set loop

* Update camera.py

* Lint
2019-05-22 21:09:59 -07: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