Commit Graph

50 Commits (e9d19c1dcce4de738755b9922aa632db1901cdbb)

Author SHA1 Message Date
Pascal Vizeli ad8645baf4 Sonos fix for slow update (#4232)
* Sonos fix for slow update

* fix auto update on discovery

* fix unittest
2016-11-05 16:58:29 -07:00
Fabian Affolter c128919b5f Remove globally disabled pylint warnings (#4204) 2016-11-03 18:40:43 -07:00
Paulus Schoutsen ee5f228309 Make services yield (#4187)
* Make services yield

* Disable pylint abstract-method check

* add input_select

* add input_slider

* change to async vers.

* fix lint

* yield on add_entities as other components does
2016-11-03 18:32:14 -07:00
Bjarni Ivarsson df7d9c3bb2 Fallback to read volume and mute state from speaker. (#4173) 2016-11-01 15:12:18 -07:00
Bjarni Ivarsson c549ea115d Sonos responsiveness improvements + enhancements (#4063)
* Sonos responsiveness improvements (async_ coroutines, event based updating, album art caching) + Better radio station information

* Docstring fixes.

* Docstring fixes.

* Updated SoCo dependency + fixed file permissions.

* Only fetch speaker info if needed.

* PEP8 fixes

* Fixed SoCoMock.get_speaker_info to get test to pass.

* Regenerated requirements_all.txt + async fetching of album art with caching + added http_session to HomeAssistant object.

* Unit test fixed.

* Add blank line as per flake8

* Fixed media image proxy unit test.

* Removed async stuff.

* Removed last remnants of async stuff.
2016-11-01 10:42:38 -07:00
Fabian Affolter be272ac64a Disable too-many-* (#4107)
* Disable too-many-* and too-few-public-methods

* Remove globally disabled pylint warnings
2016-10-30 22:18:53 +01:00
Scott O'Neil 7f48c00793 Adding timer setting functionality to sonos component (#3941)
* Adding timer setting functionality to sonos component

* Adding clear sleep timer for Sonos
2016-10-25 23:22:17 -07:00
Bjarni Ivarsson 961c02f72a Sonos improvements (#3997)
* Sonos improvements: media_* properties delegate to coordinator if speaker is a slave, media_image_url and media_title now works for radio streams, source selection/list takes speaker model into account, commands on slaves delegate to coordinator.

* Fixed failing unit tests.
2016-10-26 00:37:47 +02:00
AlucardZero 62b8e54235 Upgrade SoCo to 0.12 (#3951)
Changelog: https://github.com/SoCo/SoCo/releases/tag/v0.12

Backwards Compatability changes:

    Dropped support for Python 3.2
    Methods relating to the music library (get_artists, get_album_artists, get_albums and others) have been moved to the music_library module. Instead of device.get_album_artists(), please now use device.music_library.get_album_artists() etc. Old code will continue to work for the moment, but will raise deprecation warnings
    Made a hard deprecation of the Spotify plugin since the API it relied on has been deprecated and it therefore no longer worked
    Dropped pylint checks for Python 2.6
2016-10-20 22:51:00 -07:00
Pascal Vizeli c32afcd961 Bugfix sonos (#3926)
* Bugfix Sonos

* lint

* Use player uid for looking of exists

* fix lint

* fix unittest

* Change player_id to unique_id
2016-10-20 08:36:48 -07:00
Pascal Vizeli d7b757fb97 fix bugfix with unique_id (#3217) 2016-09-06 18:31:56 -07:00
Scott O'Neil 46216c3bda Fix services registration, and adding schema util to sonos (#2558)
* Moving service registration into def so that it can be called for both discovery methods

* Adding use of schemas to sonos
2016-07-19 22:37:24 -07:00
Pascal Vizeli 1877906fdf small bugfix (#2532) 2016-07-16 11:06:36 -07:00
Pascal Vizeli 6694f29918 add media_player/clear_playlist and line-in/tv support to sonos (#2527)
* add media_player/clear_playlist and line-in/tv support to sonos

* add support source radio

* fix bug

* print TV/Line-In as media_title

* implement universal player

* add to demo platform

* Update demo.py

Better handling for demo object

* add unit tests

* fix unit test
2016-07-15 09:00:41 -07:00
Lewis Juggins 21be4c1828 Add Sonos unjoin functionality (#2379) 2016-06-30 14:21:57 -07:00
Dan Sullivan ce829d194c Added Sonos snapshot feature (#2240)
* Added Sonos snapshot feature

* Fix lint errors

* Use snake case

* Import dependency in a method
2016-06-08 21:47:49 -07:00
Alexander Fortin 7eeb623b8f Add media_player.sonos_group_players service (#2087)
Sonos platform supports a `party mode` feature that groups all
available players into a single group, of which the calling player
will be the coordinator.
2016-05-20 09:54:15 -07:00
Alexander Fortin a4409da700 Add add_uri_to_queue support to (sonos) media player (#1946)
Sonos (SoCo) supports add_uri_to_queue capability, making it possible
to stream media available via HTTP for example. This patch extends
media_player component and sonos platform to support this feature
2016-05-19 23:30:19 -07:00
Alexander Fortin 7208ff515e Better handle exceptions from Sonos players (#2085)
Sonos players can be dynamically set in various modes, for example
as TV players or Line-IN or straming from radios channels, therefore
some methods could not be available, and when invoked they cause
long exceptions to be logged. This partially solves the problem
reducing the output and logging some more informative error message
2016-05-16 22:58:57 -07:00
Jan-Preben Mossin 5931bac695 Only add visible sonos devices
Some Sonos devices (e.g SUB) does not have
a upnp media renderer, but are discovered as sonos
devices. Creating a SonosDevice object from such a
device will fail.
2016-04-17 16:45:16 -07:00
Flavio Castelli b5f1c1332a Sonos: better handling of offline players (#1829)
When a sonos player goes offline an endless stream of
exceptions is raised. That happens because homeassistant keeps trying
to refresh its status.

This can happen even when a sonos player has gone offline **before**
homeassistant is started. The sonos players take some time before
realizing one of their mates is no longer online, leading to the same
stream of exceptions inside of homeassistant.

Three types of exceptions of can be raised:

  - `requests.packages.urllib3.exceptions.MaxRetryError`
  - `requests.packages.urllib3.exceptions.NewConnectionError`
  - `TimeoutError`

It's not possible to handle all of them with a single `except` block
because they are raised in a random order and after some delays. That
means a 2nd or 3rd exception can take place while handling the 1st one.

The only solution is to check whether a a player is actually reachable
by attempting to connect to a service that must be running on it.

Also all the players in a 'unknown' state should not be polled by
homeassistant (despite of their brand).

I'm going to upstream the `_is_reachable` method I added to the
`sonos.py` file into `SoCo`. In the meantime we must ship this piece
of code with homeassistant.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
2016-04-17 13:17:13 -07:00
Alexander Fortin e8efcd21df Increase sonos volume increment from 1 to 5 2016-04-06 11:32:27 -07:00
Alexander Fortin b304b77005 FIX enable volume commands for non-coordinators too 2016-03-31 21:36:58 +02:00
Robbie Trencheny de68be06dd Misspelling fix 2016-03-25 22:57:28 -07:00
Robbie Trencheny 950cc9e618 Add play_media support to Sonos 2016-03-25 22:57:14 -07:00
Fabian Affolter cf7c2c492a Fix PEP257 issues 2016-03-08 10:34:33 +01:00
Alexander Fortin 124a9b7a81 ADD only_if_coordinator decorator to sonos
Currently we interact with players regardless of thir coordinator
role, hence soco.exceptions.SoCoSlaveException are thrown. The use
of the decorator for each interactive method should address this
2016-02-27 00:40:34 +01:00
Paulus Schoutsen e80309c03c Fix imports (using isort) 2016-02-18 21:27:50 -08:00
Alexander Fortin 6578928e3c Fix media_player/sonos configuration mismatch
* From configuration.yaml is easy to provide iterable elements like lists,
  this adds the possibility to provide a list of Sonos hosts using a yaml
  and still supports the comma separated string version
* Remove superfluous host reassignment
2016-02-18 18:57:50 +01:00
Robert Marklund 543190dfb0 sonos: add hosts and interface_addr to sonos config
Config can now specify one or more hosts to connect and
also a interface_addr to multicast on if multiple interfaces exists.

Signed-off-by: Robert Marklund <robbelibobban@gmail.com>
2016-01-20 22:55:08 +01:00
Paulus Schoutsen 41ab635dcd Have Sonos work nicer with discovery 2015-11-30 00:55:36 -08:00
Fabian Affolter 97f9f8aa49 Update link to docs (Jekyll 3 update) 2015-11-09 13:12:18 +01:00
Fabian Affolter 0e145ec130 Remove configuration details 2015-10-23 18:39:50 +02:00
Jeff Schroeder 550f31d4c3 Quiet down some of the logging in the sonos platform
This is due to the soco library logging very excessively and it using
requests to connect to each Sonos speaker every 10 seconds (by default).

This makes the logs much more pleasant to use for finding real issues.
2015-09-16 23:11:57 -05:00
Paulus Schoutsen 835bc1c492 Fix style issue 2015-09-13 18:40:54 -07:00
Roy Hooper 9b47241a46 switch to default polling cycle to solve multiple instance issue 2015-09-13 20:49:09 -04:00
Roy Hooper d4834ff408 Add hass property to Entity to prevent 'Attribute hass is None' error during self.update_ha_state 2015-09-13 16:53:31 -04:00
Roy Hooper ce22f3c82d Implement unique_id to prevent duplicate devices 2015-09-13 16:53:31 -04:00
Jeff Schroeder 57a833f1a7 Fix a bug which causes the sonos component to occasionally pop
Had this happen when Sonos surround sound is playing from a TV. See this
for more details:

af9a5152fe/soco/core.py (L1060)
2015-09-13 12:13:35 -05:00
Jeff Schroeder 4fa379419d Don't blow up if no sonos speakers are found
Also move the imports up so the latest pep8 doesn't complain
2015-09-12 23:10:24 -05:00
Roy Hooper 6dcb87c54d squash bug in volume_level (bad if statement) 2015-09-12 21:42:36 -04:00
Roy Hooper db2140782f follow proper calling convention for track_utc_time_change callback 2015-09-11 23:57:34 -04:00
Roy Hooper e9367d5369 use own track_utc_time_change to poll every 5 seconds 2015-09-11 22:44:37 -04:00
Roy Hooper c3dd94ba04 remove unnecessary self.update_ha_state calls 2015-09-11 22:43:55 -04:00
Roy Hooper 350ed9f764 remove and disable pylint: disable=abstract-method for play_youtube() 2015-09-11 19:48:34 -04:00
Roy Hooper 3679a8078a put back play_youtube override 2015-09-11 19:44:18 -04:00
Roy Hooper a25f7eed2b Enable polling and fix metadata updating.
Remove unnecessary methods.
Include SoCo in requirements_all.txt for CI.
Lock down SoCo version to 0.11.1
Add sonos.py to exclusions in .coveragerc
2015-09-11 19:38:42 -04:00
Roy Hooper ae058b7847 tidy up formatting to make travis happy. 2015-09-11 18:55:23 -04:00
Roy Hooper aa74c4e57a fix initialization 2015-09-11 18:52:31 -04:00
Roy Hooper 1b874c603b rudimentary sonos support 2015-09-11 18:44:42 -04:00