Commit Graph

60 Commits (f54f68903df3d73a14e2ce6bc47d334c66ad7f76)

Author SHA1 Message Date
Adam Mills 469472914b Add SUPPORT_PLAY flag (#5181)
* Add SUPPORT_PLAY flag

* Add SUPPPORT_PLAY to existing media players

* Leave usage of new flag to device devs
2017-01-09 01:09:30 +01:00
andrey-git 744d00a36e Fix non-radio Sonos album-art by using track_info['album_art'] before checking other options. (#4958)
* Fix Sonos album art for non-radio streams

* Revert "Fix Sonos album art for non-radio streams"

This reverts commit d71502d18f.

* Fix Sonos album art for non-radio streams

* Move art existance check into _format_media_image_url
2016-12-18 12:58:59 -08:00
Lewis Juggins 1a7895b1d8 [media_player.sonos] Bugfix, initalise source_name. (#4911) 2016-12-15 11:46:18 +00:00
Valentin Alexeev a359d21799 [media_player.sonos] Source selection from favorites (#4804) 2016-12-14 18:05:03 +00:00
Lewis Juggins 14446c5731 [media_player.sonos] Add stop support. (#4788) 2016-12-08 08:36:37 +00:00
Pascal Vizeli efdf51b542 Bugfix sonos hosts (#4698) 2016-12-04 00:31:27 +01:00
Lewis Juggins 83a108b20a Sonos specify IP for event subscription (#4177) 2016-12-01 22:22:03 -08:00
Bjarni Ivarsson 92c6cee2a1 Support for media_position property on media_player (#4172)
* Added support for media_position property to media_player + implementation for sonos.

* Pla yback progress now updates without needed state transitions in HA.

* Linting fixes

* media_position_update_at property is now a datetime.

* Minor fix.

* Linting fixes.
2016-11-27 17:45:49 -08:00
Bjarni Ivarsson f3748ce535 Sonos line-in and tv source fixes + Sonos discovery fix. (#4440)
* Fixes line-in and tv sources on Sonos + Sonos discovery fixes.

* Style fix.
2016-11-19 15:29:00 +00:00
Pascal Vizeli e005ebe989 Update SoCo to 0.12 (#4337)
* Update SoCo to 0.12

* fix req
2016-11-10 21:01:42 -08:00
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