Commit Graph

847 Commits (f47572d3c0b81f73be41e8161e32e42be14c164f)

Author SHA1 Message Date
florianj1 46ad194097 Fix Kodi channels media type (#11505)
* Update kodi.py

* Update kodi.py

Fix code style
2018-01-08 16:57:50 +01:00
Anders Melchiorsen 8267a21bfe Lazy loading of service descriptions (#11479)
* Lazy loading of service descriptions

* Fix tests

* Load YAML in executor

* Return a copy of available services to allow mutations

* Remove lint

* Add zha/services.yaml

* Only cache descriptions for known services

* Remove lint

* Remove description loading during service registration

* Remove description parameter from async_register

* Test async_get_all_descriptions

* Remove lint

* Fix typos from multi-edit

* Remove unused arguments

* Remove unused import os

* Remove unused import os, part 2

* Remove unneeded coroutine decorator

* Only use executor for loading files

* Cleanups suggested in review

* Increase test coverage

* Fix races in existing tests
2018-01-07 14:54:16 -08:00
Ryan McLean 36c7fbe06a Plex api update (#11423)
* Updated plexapi to 3.0.5

* Removed removed server obj that was being used for the media URL generation as .url() is available in self._session
seasons() no longer exists -> renamed to season()
season() returns obj not list so corrected
season.index returns int, cast to str to zerofill

* Fixed Linting
2018-01-03 19:28:43 +01:00
Dave Finlay bb2191b2b0 Add support for the renaming of Yamaha Receiver Zones via configuration file. Added a test to cover the change, plus previously untested options. (#11402) 2018-01-03 19:25:16 +01:00
Otto Winter b362017206 Upgrade pychromecast to 1.0.3 (#11410) 2018-01-01 14:52:36 -08:00
Ryan McLean 3fa45375d9 Plex refactor (#11235)
* Cleaned up '_clear_media()'

* Moved media Type to new method

* renamed "clear_media()' to ' clear_media_details()'
reset 'app_name' (Library Name) in clear_media_details
moved thumbs to '_set_media_image()'

* Moved playback info into setmedia type as it was just used for the next anyway

* Moved library name & image download to only happen if session and player active as else no point anyway

* Fixed Linting issue

* Some tweaks to clean up unintended complexity

* Removed redundant declarations

* Fixed whitespace

* Revert "Fixed whitespace"

This reverts commit 0985445c47.

* Revert "Removed redundant declarations"

This reverts commit 6f9d5a85b0.
2017-12-24 11:18:31 -05:00
Daniel Watkins 353bb62687 Fix webostv select source (#11227)
* Fix reuse of variable name

This should fix #11224.

* Add tests for LgWebOSDevice.select_source
2017-12-22 18:38:00 +01:00
Egor Tsinko eeb309aea1 Functinality to save/restore snapshots for monoprice platform (#10296)
* added functionality to save/restore snapshots to monoprice platform

* renamed monoprice_snapshot, monoprice_restore to snapshot, restore

This is to simplify refactoring of snapshot/restore functionality for monoprice, snapcast and sonos in the future
2017-12-22 10:26:34 +01:00
Brad Dixon dfb8b5a3c1 Revbump to SoCo 0.13 and add support for Night Sound and Speech Enhancement. (#10765)
Sonos Playbar and Playbase devices support Night Sound and Speech Enhancement
effects when playing from sources such as a TV. Adds a new service "sonos_set_option"
whichs accepts boolean options to control these audio features.
2017-12-17 13:08:35 +01:00
Philipp Schmitt 638dd25aff Add media position properties (#10076)
* Add media progress information

* Remove unnecessary comments

* Remove datetime import

* Remove pysonyavr dependency

* Fix doc syntax (D205)

* Lint fix: no-else-return

* Don't attempt to set media progress info if program is None

* Fix Python 3.4 compatibility

* Explicitely depend on pyteleloisirs

* Only update remaining play time when it changed

* Fix floot state table
2017-12-13 10:58:49 +01:00
Jan Almeroth a79c7ee217 Bump pymusiccast to version 0.1.6 (#11091) 2017-12-11 22:29:52 +01:00
GreenTurtwig bee80c5b79 Add support for Logitech UE Smart Radios. (#10077)
* Add support for Logitech UE Smart Radios.

* Removed full stops to please Hound's line limit.

* Updated with requested changes.

* Fix Pylint Flake8 problem.

* Updated with requested changes.
2017-12-09 20:01:23 +01:00
Anders Melchiorsen 0a7e6ac222 Ignore Sonos players with unknown hostnames (#11013) 2017-12-08 12:01:10 +01:00
Marcus Schmidt 929d49ed6f Shuffle support in Sonos (#10875)
* initial commit of shuffle option for sonos

* added test

* Small adjustments to adhere to review requests

* Removed unnessesary setting of variable. Use shuffle state from soco instead
2017-12-07 14:44:06 -05:00
Lewis Juggins 3c1f8cd882
Handle OSError when forcibly turning off media_player.samsungtv (#10997) 2017-12-07 16:30:51 +00:00
Daniel Watkins 0fc7f37185 webostv: Ensure source exists before use (#10959)
In a case where either (a) an incorrect source name is used, or (b) the
TV isn't currently queryable (e.g. it's off), we get tracebacks because
we assume the source that we are being asked to select exists in
self._source_list.

This makes the lookup code a little more rugged, and adds in a warning
message (in place of the current exception).
2017-12-06 14:48:17 +01:00
Paulus Schoutsen ddec566e10
Revert pychromecast update (#10989)
* Revert pychromecast update

* Update cast.py
2017-12-05 22:08:09 -08:00
Menno Blom 379c10985b Add Ziggo Mediabox XL media_player (#10514)
* Add Ziggo Mediabox XL media_player

* Using pypi module ziggo-mediabox-xl now.

* Code review changes
2017-12-05 14:22:27 +01:00
Oliver 3a246df544 Don't repeat getting receiver name on each update / pushed to denonavr 0.5.5 (#10915) 2017-12-03 21:51:32 +01:00
Touliloup 6b410d8076 Correction of Samsung Power OFF behaviour (#10907)
* Correction of Samsung Power OFF behaviour

Addition of a delay after powering OFF a Samsung TV, this avoid status
update from powering the TV back ON.
Deletion of update() return statement, return value not used.

* Rename self._end_of_power_off_command into self._end_of_power_off

* Removal of unused line break in Samsung TV component
2017-12-03 18:34:45 +01:00
Otto Winter 8a750eba68 Bump pychromecast to 1.0.2 (#10728)
Fixes home-assistant/home-assistant#9965
2017-11-21 09:04:44 -08:00
Markus Nigbur a83e741dc7 Refactored to new global json saving and loading (#10677)
* Refactored to new global json saving and loading

* Fixed emulated_hue tests

* Removed unnecassary error handling

* Added missing newline

* Remove unused imports

* Fixed linting error

* Moved _load_json wrapper out of the config class
2017-11-19 19:47:55 -08:00
Jan Losinski 693d32fa68 Snapcast: bump version and enable reconnect. (#10626)
This bumps the used snapcast version to 2.0.8 and enables the new
reconnect feature that causes the component to reconnect to a server if
the connection was lost.

This fixes the ned to restart Home Assstant after a snapcast reboot, as
described in issue #10264.

Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>
2017-11-16 20:32:26 -05:00
Eugenio Panadero e947e6a143 Use a template for the Universal media player state (#10395)
* Implementation of `state_template` for the Universal media_player

* add tracking to entities in state template

* use normal config_validation

* fix tests, use defaults in platform schema, remove extra keys

* and test the new option `state_template`

* lint fixes

* no need to check attributes against None

* use `async_added_to_hass` and call `async_track_state_change` from `hass.helpers`
2017-11-14 11:41:19 +01:00
Abílio Costa 637b058a7e webostv: Reduce default timeout to prevent log spamming (#10564)
With the default timeout of 10 seconds, the log gets filled up with "component is taking more than 10 seconds" errors.
This should probably be fixed in some other way, but for now this reduces the problem a bit.
2017-11-14 10:37:52 +01:00
Ruslan Sayfutdinov a6d9c7a621 webostv: set current source correctly (#10548) 2017-11-13 09:23:42 -08:00
Anders Melchiorsen 46fe9ed200 Optimize concurrent access to media player image cache (#10345)
We now do locking to ensure that an image is only downloaded and added
once, even when requested by multiple media players at the same time.
2017-11-13 09:03:12 -08:00
Jan Almeroth 1c36e2f586 Introduce media progress for Yamaha Musiccast devices (#10256)
* Introduce update_hass()

* Introduce media_positions

* Version bump pymusiccast

* Fix: Unnecessary "else" after "return"

* FIX D400: First line should end with a period

* Version bump

Fixes https://github.com/home-assistant/home-assistant/issues/10411
2017-11-10 23:41:02 +01:00
Fabian Affolter de9d19d6f4 Use constants for HTTP headers (#10313)
* Use constants for HTTP headers

* Fix ordering

* Move 'no-cache' to platform
2017-11-04 12:04:05 -07:00
Erik Eriksson 4e8723f345 Extracted json saving and loading (#10216) 2017-11-01 09:08:28 +01:00
Anders Melchiorsen 6cadb796bc
Avoid Sonos error during startup (#10146)
* Add Sonos coordinators before slaves
2017-11-01 08:28:13 +01:00
Fabian Affolter cc293db5ab
Update services.yaml files (#10229)
* Add period to the description

* Update abbreviation
2017-10-30 21:39:12 +01:00
Sean Dague c9c102815a Clarify yamaha play_media parameters (#10228)
The play_media parameters are a little bit black magic for the yamaha
platform, this explains what they are in a code comment instead of
having to go look at the yamaha platform itself.

Fixes Bug #10180
2017-10-30 21:38:52 +01:00
Jan Almeroth 5d23afdc9e Introducing multi-zone support for yamaha_musiccast devices (#9968)
* Introduce zones to yamaha_musiccast
* Introducing new config 'interval_seconds'
* Version bump pymusiccast
* Removing name parameter
2017-10-30 13:50:20 -04:00
Egor Tsinko 2c3195522f media_title property now returns current source (#10120) 2017-10-29 02:26:55 +02:00
randellhodges c0f8e6c5c5 Updated denon component to play nice with the 3808CI that doesn't support NSFRN command (#10157) 2017-10-27 14:22:23 +02:00
Casper Weiss Bang 85d7377beb MPD now uses the filename if song doesn't have metadata (#10085)
* added support for filename

* used the getter instead - minor mistake

* changed how the filename is generated
2017-10-27 11:21:47 +02:00
Anders Melchiorsen f17cf1d26b Avoid Sonos errors for tracks with no artist information (#10160)
Rather than adding guards to the string formatting, just remove this
unused attribute.
2017-10-27 10:50:03 +02:00
Anders Melchiorsen e50b59a56c Reduce album art flickering in media player UI (#10163)
* Add HTTP cache header to proxied media player images

With the resource actually being cacheable, preemptively extend the cache
buster key to prevent hash collisions.

While at it, change the hash from md5 to sha256 for consistency with the
access_token method.

* Remove lint
2017-10-27 10:49:20 +02:00
Ryan McLean 41fa8cc8f2 Plex refactor Part 1 - Update plexapi to 3.0.3 (#9988)
* Fix: Last Played Media Title in plex would stay even when player was idle/off
     Primary Fix is in the "if self._device" portion.
     code in "if self._session" is a catch all but i'm not 100% if it is needed.

* Fixed lint issues with previous commit

* 1st Pass at refactoring plex refresh
Moved _media** into clearMedia() which is called in _init_ and
at start of refresh.

Removed redunant _media_* = None entries

Grouped TV Show and Music under single if rather than testing
seperately for now.

* Fixed invalid name for _clearMedia()
Removed another media_* = None entry

* Removed print() statements used for debug

* Removed unneeded "if" statement

* Changes
* Updated Requests to 2.18.4
* Updated plexapi to 3.0.3
* Removed function to convert_NA_to_None
* Removed function get_thumb_url

Type changes
* _session.player is now a list players
* na_type deprecated and to be removed
* plexapi has change na to None

Known Issues:
* Player controls currently broken
* Last location (library) stays while player idle

* Username is now Usernames and a list

* Fix for broken controls

* Removed errant print statement

* Removed depecrated na_type

* Updated Plex Sensor to use plexapi 3.0.3
Added support for Token to be used in sensor

Known Issues:
Username and Password broken for Plex Sensor use Token instead for now

* removed TODOs

* Fixes for private access violations

* Removed need for _local_client_fix

* Removed unused import and fixed parens
2017-10-25 11:42:13 +02:00
Philipp Schmitt e201bcad14 Show current program thumbnail as media_image (#10033)
* Do not include program data in media_title if program data is undefined (None)

* Show thumbnail of currently playing program

* async setup

* Update requirements
2017-10-23 12:04:23 +02:00
Gerardo Castillo 5df985a510 Update the Russound RNET component to use enhanced Russound.py (#9739)
* Updated RussoundRNETDevice.update() to call and enhanced function that reduces network traffic

Refer to issue #6 on the Russound project

* Updated RussoundRNETDevice.update() to invoke an enhanced function to reduce network traffic

PLease see issue #6 on the russound project

* Updated REQUIREMENTS to use version 0.1.9 of the Russound component

Please refer to issue #6 on the Russound rnet project

* Corrected some minor style details to satisfy Houndbot

* Update requirements_all.txt
2017-10-21 14:56:37 -04:00
TopdRob 29d4dca56a Update requests requirement (#9876)
* Update request requirement

Update request requirement from version v2.14.2 to v2.18.4

* Fix dependency vizio integration

3rd patry packages were removed from requests. Changed dependency from requests to urllib3

* forgot =

forgot = when adding the requirement

* re-run script/gen_requirements_all.py

re-run script/gen_requirements_all.py

* Unvendoring urllib3 from requests

In v2.16.0 and newer of requests they unverdored urllib3.

* undefined name 'InsecureRequestWarning'

* Removed requirement to 'urllib3==1.22

* removed import requests

* removed urllib3.exceptions.InsecureRequestWarning

removed urllib3.exceptions.InsecureRequestWarning travis lint
2017-10-19 19:24:49 -07:00
Pascal Vizeli c1b197419d Fix async probs (#9924)
* Update entity.py

* Update entity_component.py

* Update entity_component.py

* Update __init__.py

* Update entity_component.py

* Update entity_component.py

* Update entity.py

* cleanup entity

* Update entity_component.py

* Update entity_component.py

* Fix names & comments / fix tests

* Revert deadlock protection

* Add tests for entity

* Add test fix name

* Update other code

* Fix lint

* Remove restore state from template entities

* Lint
2017-10-19 10:56:25 +02:00
Alok Saboo 4960892256 Update directpy to 0.2 (#9948) 2017-10-18 19:04:01 +02:00
Egor Tsinko 6e0efbe35e A new platform for controlling Monoprice 6-Zone amplifier (#9662)
* added implementation for monoprice 6-zone amplifier. This implementation is based on and very similar to russoun_rnet implementaion

* updated comments and cleaned up code

* updated comments and cleaned up code

* added unit tests

* removed 'name' attribute from platform schema.

* added monoprice.py to .coveragerc

* fixed lint

* fixed lint errors

* fixed lint errors

* added monoprice to requirements_all.txt

* fixed lint errors again

* implemented change requests

* fixed lint error

* added exception handling to setup_platform()

* replaced catchall with SerialException only

* added myself to CODEOWNERS

* fixed weird merge to CODEOWNERS
2017-10-18 11:11:36 +02:00
Oliver ed70fc9322 Added support for Denon AVR-4810. (#9887) 2017-10-17 10:04:35 +02:00
Philipp Schmitt da8be253bc Fix #9839 (#9880)
* Fix #9839

* Update requirements

* Default state: STATE_UNKNOWN -> None

* Default the state to None in the constructor as well
2017-10-15 21:16:23 +02:00
Sean Dague 581e2f22d5 Bump rxv library to 0.5.1 (#9784)
This fixes some bugs with interfacing with yamaha receivers, including
closing bug #5209.
2017-10-09 17:58:53 +02:00
Ryan McLean af3ea5a321 Fix: Last Played Media Title persists in plex (#9664)
* Fix: Last Played Media Title in plex would stay even when player was idle/off
     Primary Fix is in the "if self._device" portion.
     code in "if self._session" is a catch all but i'm not 100% if it is needed.

* Fixed lint issues with previous commit

* 1st Pass at refactoring plex refresh
Moved _media** into clearMedia() which is called in _init_ and
at start of refresh.

Removed redunant _media_* = None entries

Grouped TV Show and Music under single if rather than testing
seperately for now.

* Fixed invalid name for _clearMedia()
Removed another media_* = None entry

* Removed print() statements used for debug

* Removed unneeded "if" statement
2017-10-07 15:31:01 -04:00
Florian Klien c7226ec28f fixed duplicate words (#9705) 2017-10-05 21:55:09 +02:00
Jan Almeroth 94370eda54 Yamaha MusicCast: check known_hosts (#9580)
* Yamaha MusicCast: check known_hosts

- pymusiccast: Version bump

* Update requirements
2017-09-29 16:45:25 +02:00
Pierre Ståhl 9d839f1f53 Bump pyatv to 0.3.5 (#9586) 2017-09-26 21:01:17 +02:00
Mike Megally 8a3dcbf10f Allow customizable turn on action for LG WebOS tv (#9206)
* allow customizable action for webos tv turn on as not all models allow for WOL

* trying to fix the houndci-bot

* last few fixes hopefully

* I guess not

* last time!

* This is a breaking change. I have removed the build-in wake-on-lan functionality and have opted for a script which can be a wake-on-lan switch. I have also removed any reference to wol.

* hoping to fix formatting

* linter errors
2017-09-26 00:03:40 -07:00
Michael Prokop 08b0629eca Fix a bunch of typos (#9545)
s/Addres /Address /
s/Chnage/Change/
s/Converion/Conversion/
s/Supressing/Suppressing/
s/agains /against /
s/allready/already/
s/analagous/analogous/
s/aquired/acquired/
s/arbitray/arbitrary/
s/argment/argument/
s/aroung/around/
s/attibute/attribute/
s/auxillary/auxiliary/
s/befor /before /
s/commmand/command/
s/conatin/contain/
s/conection/connection/
s/coresponding/corresponding/
s/entites/entities/
s/enviroment/environment/
s/everyhing/everything/
s/expected expected/expected/
s/explicity/explicitly/
s/formated/formatted/
s/incomming/incoming/
s/informations/information/
s/inital/initial/
s/inteface/interface/
s/interupt/interrupt/
s/mimick/mimic/
s/mulitple/multiple/
s/multible/multiple/
s/occured/occurred/
s/occuring/occurring/
s/overrided/overridden/
s/overriden/overridden/
s/platfrom/platform/
s/positon/position/
s/progess/progress/
s/recieved/received/
s/reciever/receiver/
s/recieving/receiving/
s/reponse/response/
s/representaion/representation/
s/resgister/register/
s/retrive/retrieve/
s/reuqests/requests/
s/segements/segments/
s/seperated/separated/
s/sheduled/scheduled/
s/succesfully/successfully/
s/suppport/support/
s/targetting/targeting/
s/thats/that's/
s/the the/the/
s/unkown/unknown/
s/verison/version/
s/while loggin out/while logging out/
2017-09-23 17:15:46 +02:00
Colin Dunn 15c3ea0d86 Fix universal media_player mute (#9462) 2017-09-18 15:42:31 -04:00
Martin Donlon 0100af0fa6 Fix russound_rio for python 3.4 (#9428)
Bumped russound_rio dependency to 0.1.4 which includes a fix for python
3.4.2 (asyncio.async vs asyncio.ensure_future)
2017-09-15 11:40:40 +02:00
pdanilew f5dee2c27d MPD small improvements (#9301)
* Power button restored.

* Added volume step and mute

* Removed network operations from property + pylint made happy.
2017-09-13 23:38:07 -07:00
Pierre Ståhl ba5e8d133d Fix artwork bug in Apple TV (#9415)
* Fix artwork bug in Apple TV

* Clean up some None checks
2017-09-13 22:30:29 -07:00
Pascal Vizeli 90f9a6bc0a Cleanup and simplitfy the async state update (#9390)
* Cleanup and simplitfy the async state update

* Update test_entity.py
2017-09-12 10:01:03 +02:00
Jan Almeroth e4bb8b0444 Introducing a media_player component for Yamaha Multicast devices (#9258)
* Introducing media_player yamaha_multicast

* Fix pep8_max_line_length

* Revert "Fix pep8_max_line_length"

This reverts commit 664c25d657.

* Revert "Introducing media_player yamaha_multicast"

This reverts commit a4fb64b53a.

* Introducing media_player for Yamaha MultiCast Devices

* Add missing Docstrings

* Adding Requirements

* Add Geofency device tracker (#9106)

* Added Geofency device tracker

Added Geofency device tracker

* fix pylint error

* review fixes

* merge coroutines

* Version bump

* Version bump

* D210: No whitespaces allowed surrounding docstring text

* Fix linting

* Version bump

* Revert "Add Geofency device tracker (#9106)"

This reverts commit c240d907d2.

* Fix Invalid method names

* Fix update_status timer

* Fix Invalid class name "mcDevice"

* Fix Access to a protected members

* Introducing source_list setter

* Fix logging

* Version bump

* D400: First line should end with a period (not 'e')

* Removed unnecessary logging

* Minor changes

Thanks to comments from @andrey-git
2017-09-05 19:07:58 +03:00
Tom Matheussen 67828cb7a2 Handle spotify failing to refresh access_token (#9295)
* Handle spotify failing to refresh access_token

* Remove whitespace
2017-09-04 20:47:40 +02:00
Oliver 8d5f6723ce Added configurable timeout for receiver HTTP requests | Additional AV… (#9244)
* Added configurable timeout for receiver HTTP requests | Additional AVR-X detection based on CommApiVers | Treat Marantz SR6007 - SR6010 as AVR-X device

* timeout value not passed correctly
2017-09-01 09:15:47 +02:00
Pascal Vizeli 0af4f8903d Add available to sonos (#9243)
* Readd sonos available flag / fix polling state

* cleanup
2017-09-01 00:23:11 +02:00
Riccardo Canta 56f9ccb877 Allow sonos to select album as a source (#9221)
Importing the fix in the PR https://github.com/home-assistant/home-assistant/pull/8258 I noticed that the same error is present also for Spotify album so I have extended the code and tested it. It works fine on my setup
2017-08-30 15:10:02 +02:00
Nicholas Sielicki ebc7ade591 directv: extended discovery via REST api, bug fix (#8800)
* fix not providing device for discovered directvs

This fixes a bug introduced at 6884965c80

Discovered directv boxes would not be instantiated with a DEVICE
parameter.

Signed-off-by: Nicholas Sielicki <sielicki@yandex.com>

* directv: add discovery of RVU clients

If discovery is used with directv, also try to further discover and
configure RVU client set-top boxes by requesting information from a REST
service running on the main directv box/RVU-server.

This commit also disables discovery if any directv configuration is
supplied by the user.

Signed-off-by: Nicholas Sielicki <sielicki@yandex.com>

* components/media_player/directv.py: use hass.data

Use hass.data instead of a global to remember state.

Signed-off-by: Nicholas Sielicki <sielicki@yandex.com>

* unconditionally import requests in directv.py

Requests is a core requirement, so we're okay to import at the top of
the file rather than conditionally / in a function.

Signed-off-by: Nicholas Sielicki <sielicki@yandex.com>
2017-08-30 00:08:56 +02:00
happyleavesaoc 90724847a3 bump snapcast version (#9100) 2017-08-22 22:13:52 -07:00
Erik Eriksson 398735c9be async_query returns False if connection to server failed, handle this properly (#9070) 2017-08-22 07:09:11 +02:00
Fabian Affolter f7daefd7a5 Upgrade onkyo-eiscp to 1.2.4 (fixes #8995) (#9068) 2017-08-21 11:25:34 +02:00
Sören Oldag bf66019c66 Configurable timeout for webostv. (#9042)
* Configurable timeout for webostv.

* Make PEP257 validation to pass
2017-08-19 15:14:02 +02:00
Steven Looman 7ac1e469b7 Set password after connecting. Fixes #8983 (#9039) 2017-08-19 10:58:42 +02:00
Tom Matheussen 427d7ee1fc Check if album image(s) exist in spotify (#9024)
* Check if album image(s) exist in spotify

* Actually set the image to None

* Simplified using ternary operator
2017-08-17 22:39:20 +02:00
Dan 55234a7fa3 Update onkyo-eiscp to 1.2.3 (#9019) 2017-08-16 21:51:03 -07:00
Adam Mills 19d1d748d4 Add support for Automatic OAuth2 authentication (#8962)
* Add support for Automatic OAuth2 authentication

* Fix async conversion of configurator

* Rename method for async

* Use hass.components to get configurator component

* Fix typo

* Move session data to hidden directory

* Make configurator callback optional
2017-08-13 22:37:50 -07:00
Erik Eriksson e84ff61d4a Support media position and media duration (will display progressbar in ui) (#8904) 2017-08-10 16:56:34 +02:00
Fabian Affolter f513f6271e Do not call update() in constructor (#8878)
* Do not call update() in constructor

* Fix lint issues
2017-08-08 20:21:33 +02:00
Andrey Kupreychik c49cce7243 Do not use pychromecast.Chromecast for Cast Groups (#8786)
* Do not use pychromecast.Chromecast for Cast Groups

pychromecast.Chromecast creates Chromecast instance with friendly_name and cast_type of the device and not of a group.
Which leads to collisions

* Update cast.py

* using hass.data

* Fixed and extended tests

* Line length in tests

* Lint in tests
2017-08-06 09:15:01 -07:00
Andrey c895f1f1db When Sonos gets a tts source - dont't show an image (#8777) 2017-08-03 17:39:11 +03:00
thrawnarn 86c06ad76e New component: bluesound (#7192)
* New component: bluesound

* New component: bluesound

* Removed response.release()
Fixed update_sync_status bug
Changed should_poll to True

* Fix lint error

* Changes to init

* Fixed blank line

* updated requirements

* bump to xmltodict 0.11.0
2017-08-01 22:41:51 -07:00
Steven Looman 342ec8ec99 mpd improvements (#8655)
* Don't require the MPD device to online during HASS startup

* Hide private variables

* Keep tox/flake8 happy

* Fix typo

* Force direct update

* Implement MpdDevice.available

* Fix typo
2017-07-31 23:18:26 -07:00
Matt Colyer 2b59b917c4 Allow sonos to select playlists as a source (#8258)
* Allow sonos to select playlists as a source

Most of this was taken from
https://github.com/home-assistant/home-assistant/issues/5598#issuecomment-278229895
however I made a few small improvements so that it works for other
services than Spotify and it should properly switch to playing the queue
if you had another song playing previously.

/cc @PatBoud

* Attempt to fix style issues

* More indent changes

* Fix misplaced period

* Move playlist replacement to function

* Privatize replace_queue_with_playlist and explain

* Remove unneeded decorator

* Fix doc formatting
2017-07-31 23:16:05 -07:00
Fabian Affolter 53048f71a0 Supress exception if host is not available (fixes #8684) (#8732) 2017-07-31 08:58:13 -07:00
Martin Donlon 164e953e8c New media_player platform for Russound devices using the RIO protocol (#8448)
* New media_player platform for Russound devices using the RIO protocol
Auto discovers zones and sources
Handles media metadata from sources that support it
asyncio implementation
Push updates for any zone or source changes so no polling required.

* Fixed up linting issues

* Addressing PR feedback

Updated russound_rio dependency to 0.1.3
Use enumerate_zones and enumerate_sources methods instead of doing it in
the platform.
Register callbacks in async_added_to_hass coroutine
Corrected behavior of async methods
2017-07-31 14:42:55 +02:00
Nicholas Sielicki 6884965c80 directv: add configuration glue for Genie slaves (#8713)
DirectPy, the third party library used for controlling directv boxes,
has the ability to accept an ID in order to act as a remote for Genie
slaves instead of just the master directv box. This commit adds glue
such that one can configure home assistant to interface with these slave
genie boxes.

Signed-off-by: Nicholas Sielicki <sielicki@yandex.com>
2017-07-30 10:17:56 +02:00
Adam Mills e992527c68 Fix Kodi reconnection after websocket disconnect (#8704) 2017-07-29 21:55:08 -07:00
Adam Mills 8ba9e8016b Remove deprecated substitute interfaces (#8701) 2017-07-29 19:18:06 -04:00
Adam Mills 750ea44b4b Remove deprecated host and ssl logic from Kodi (#8700) 2017-07-29 19:17:41 -04:00
Paulus Schoutsen cd2703e121 Update dependencies cast + discovery (#8646) 2017-07-25 23:35:05 -07:00
Eugenio Panadero c27074e6f7 turn_on_action and turn_off_action with script syntax (#8558) 2017-07-19 13:33:16 -04:00
Paulus Schoutsen d0275c8075 Persistent notification import (#8507)
* Rewrite persistent notification creation

* Update components.is_on to use auto loading

* Fix two hass parameters
2017-07-16 21:39:38 +02:00
Paulus Schoutsen d29bdddaa7 Add bind_hass to components (#8502)
* Add bind_hass to components

* Add bind_hass to group
2017-07-16 10:14:46 -07:00
dersger 9373d5e901 Fix media_position for cast component (#8452)
* Make it available during state paused.

* Don't adjust for media_position_updated_at. I.e. do as vlc, sonos etc
  so that returned position is the position at the time of
  media_position_updated_at, not now.
2017-07-13 20:00:23 -07:00
Abílio Costa 2eeeb9075a Plex: Add exception handler when connection fails (#8179)
* add exception handler when connection fails

* plex: improve exception handling

* remove uneeded exception handler
2017-07-13 08:01:12 -07:00
Niccolò Maggioni 229000b834 Support for Plex servers with enforced SSL (#8341)
* Support for Plex servers with enforced SSL

* Fixed HoundCI warnings

* Fixed HoundCI warnings (2nd)

* Configurator data validation

* Travis linting
2017-07-11 23:26:29 -07:00
Vlad Korniev ef94b5c77a Vizio SmartCast support (#8260)
* Vizio SmartCast support

* Requested changes
Added new config params

* Vizio SmartCast support

* Requested changes
Added new config params
2017-07-11 22:55:46 +02:00
Oliver 3be0103259 Marrantz SR5006 & SR5006 treated as AVR-X device | Fixed Mapping of Media Player and AUX input functions (#8409) 2017-07-08 16:02:59 +02:00
Tom Matheussen 233920f22c Sets spotify media_type to music (#8387)
* Sets spotify media_type to music

* Removed whitespace

* Update spotify.py
2017-07-07 07:52:11 -07:00
Charles Blonde 9bc5cd2d4b Add Soundtouch support for playing an HTTP url (#8370) 2017-07-06 22:28:09 -07:00
Paulus Schoutsen 46e030662d Fix pylint 1.7.2 no-else-return issues (#8361)
* Fix pylint 1.7.2 no-else-return issues

* Update tomato.py
2017-07-05 23:30:01 -07:00
Paulus Schoutsen 5779d64e98 Fix some issues for PyLint 1.7.2 (#8356)
* Fix some issues for PyLint 1.7.2

* More fixes

* Revert position change for cover
2017-07-05 20:02:16 -07:00
Pierre Ståhl ea5bec3ef4 Add new feature to Apple TV platform (#8122)
* Lift Apple TV to pyatv 0.3.2

Update code to use basic new features.

* Support button presses in Apple TV

* Support device authentication

* Convert Apple TV to a component

A media_player platform and a remote platform will be loaded for each
manually configured or discovered device.

* Move device auth to apple_tv component

* Update requirements and coverage config

* Add scan support to apple_tv
2017-07-04 21:37:18 -07:00
John Mihalic f8527e9773 Update pyEmby to fix media images (#8331) 2017-07-04 08:02:29 +02:00
Adam Baxter f02d169864 Fix Plex component to use port number in discovery. (#8197)
* Fix Plex component to use port number in discovery.

* Break line

* Correctly save port to config

* Handle port with fewer code changes

* This is stuck configuring and I'm not sure why

* Changes suggested by @dale3h
2017-06-25 18:06:15 -05:00
Oliver 1b563b0640 Pushed to version 0.5.1 of the library (#8190) 2017-06-24 12:14:57 -07:00
Fabian Affolter 61cb6ec3dc Upgrade libsoundtouch to 0.6.2 (#8149) 2017-06-22 13:27:42 +02:00
Oliver 2e3b279873 Add support of Zone2 and Zone3 (#8025)
* Add support of Zone2 and Zone3

* Changes from balloobs feedback
2017-06-21 22:54:10 -07:00
Charles Blonde 9a239d1afb Upgrade libsoundtouch to prevent Python3.6 errors with enum. #7733 #8103 (#8143) 2017-06-21 22:20:30 +02:00
Eugenio Panadero 35132f9836 media player Kodi: handle TransportError exceptions when calling JSONRPC API methods (#8047)
* handle TransportError exceptions when calling JSONRPC API

* use double quotes for log messages; show TransportErrors as in async_ws_connect

* fix spaces around keyword / parameter

* fix logging message

* review changes
2017-06-18 23:00:02 +02:00
Michael Auchter fb0ee34f10 mpd: implement support for seek, shuffle, and clear playlist (#8090)
* mpd: add shuffle and clear_playlist support

* mpd: implement seek
2017-06-18 18:31:45 +02:00
John Mihalic 33d381731f Bump pyEmby version to account for API changes (#8070) 2017-06-17 18:41:35 +02:00
Jean-Michel Ruiz 8af6bacfd0 media_player.firetv - Adding support for https. (#8022)
* Adding support for https.

This change allows to access a firetv-server instance that runs over https (via a reverse proxy for exemple).
Default stays http, but if `ssl: true` is set in the configuration the connection goes over https.

Successfully tested.

* respecting the 79 characters line limit
2017-06-15 22:23:10 -07:00
Tom Matheussen bf2fe60cb5 Take in account Spotify account permissions (#8012)
* only show Spotify actions when Premium account is used

* Fix indentation, stupid autoformat
2017-06-14 00:45:00 +02:00
Fabian Affolter 9189cbdc8b Remove globally disabled pylint issues (#8005) 2017-06-13 11:10:32 +02:00
Sören Oldag 03f916ed10 Fixed bug in spotify component. (#7976) 2017-06-11 22:24:01 -07:00
Oliver 1f226cffe9 Bugfixing with version 0.4.4 of denonavr (#7995) 2017-06-11 12:02:32 +02:00
mwsluis 49d642741d Nadtcp component (#7955)
* initial commit

* class name and requirements_all.txt

* removed mentions of D7050

* changed default name

* catch oserror in update, travis errors.

* use nad_receiver pip version

* update coveragerc
2017-06-09 14:53:07 -04:00
Paulus Schoutsen a223efb840 Prevent Roku doing I/O in event loop (#7969) 2017-06-08 22:18:33 -07:00
Barry Williams e4d100d54d Fixed metadata issue (#7932) 2017-06-08 21:41:24 -07:00
Oliver 482db94372 Add option to display all input sources / Add support for favourite channels / Treat Marantz SR5008 as Denon AVR-X device (#7949)
* add option to display all sources / pushed to version 0.4.3 of library

* Add show_all_sources option for auto discovery too

* change code style for hass

* fix lint
2017-06-08 09:46:26 +02:00
joopert 790610525b update to 006 (#7945) 2017-06-08 07:30:07 +02:00
Juggels 36eb0ceff3 [media_player.sonos] Send media_stop on turn_off (#7940) 2017-06-07 13:15:29 +01:00
Fabian Affolter f303f6a191 Move consts to 'const.py' (#7909) 2017-06-05 16:59:59 +02:00
joopert e50588afe1 Change nad_receiver to pypi (#7852)
* Change to pypi

* add requirements
2017-06-03 17:01:51 +03:00
Erik Eriksson e11ec88482 Update squeezebox.py (#7617)
Do not fail in case no players are connected, in which case squeezeserver will return a result without player_loop.
2017-06-02 00:26:54 -07:00
David-Leon Pohl 2b70b1881a Quickfix Bug #7384 (#7582)
* Quickfix Bug #7384

* Fix devices not available runtime bug
2017-06-02 00:05:07 -07:00
Juggels 12607aeaea Check if media commands are actually applicable (#7595)
* Check if media commands are actually applicable

- Explicitly allow ‘stop’ and ‘play’ on radio streams
- Disallow media commands when the playlist is empty
- Check if command is supported when calling `turn_on` and `turn_off`

* Suppress UPnP error 701 on media commands

* Clean up soco_filter_upnperror

Clean up soco_filter_upnperror and fix small bug in support_previous_track determination
2017-06-02 00:03:10 -07:00
Teagan Glenn cefacf9ce4 Spotify aliases (#7702)
* Alias support for spotify devices

* Fix log

* Formatting/Fixes

* Remove default arg

* Add default keyword

* None check
2017-06-01 23:53:23 -07:00
happyleavesaoc 96b20b3a97 update snapcast media player (#7079)
* update snapcast

* fix docstrings

* bump dep version

* address snapcast review comments

* add snapcast group volume support

* fix snapcast requirements

* update snapcast client entity id

* snapshot/restore functions

* refactor snapshot/restore services

* clean up

* update snapcast req

* bump version

* fix async updates
2017-05-30 11:34:39 +02:00
Oliver 1f3bb51821 Add Marantz SSDP discovery / Detect error string in AppCommand.xml body (#7779) 2017-05-29 10:26:10 +02:00
Paulus Schoutsen e68bd0457c Fix more deprecation warnings (#7778)
* Remove setting up an hbmqtt broker

* Don't pass loop to web.Application in tests

* Use .query instead of deprecated .GET for aiohttp requests

* Fix closing file resource

* Do not use asyncio mark

* Notify.html5 - PyJWT: Use options to disable verify

* Yamaha: Test was still using deprecated ip

* Remove pytest-asyncio
2017-05-26 13:12:17 -07:00
Paulus Schoutsen f43db3c615 Replace executor with async_add_job (#7658)
* Remove executor

* Lint

* Lint

* Fix tests
2017-05-26 08:28:07 -07:00
cgtobi b3cb057aac Fix playback control of web streams (#7683)
Web streams can't be paused and resumed later. That's why volumio stops them instead of pausing them.
2017-05-21 17:05:04 -07:00
Barry Williams adde9e6231 Upgrade Openhome library (#7671)
* Added support for openhome devices using transport service

* Style cleanup
2017-05-20 17:43:35 +02:00
Eugenio Panadero f7d25396a4 Kodi specific service to call Kodi API methods (#7603)
* Kodi specific services to call Kodi API methods

 - new service: `kodi_execute_addon` to run a Kodi Addon with optional parameters. Results of the Kodi API call, if any, are redirected in a Home Assistant event: `kodi_execute_addon_result`.
 - new service: `kodi_run_method` to run a Kodi JSONRPC API method with optional parameters. Results of the Kodi API call are redirected in a Home Assistant event: `kodi_run_method_result`.
 - Add descriptions in services.yaml.
 - Add `timeout` parameter to yaml config (needed to make slow queries to the JSONRPC API, default timeout is set to 5s).
 - Trigger events with the results of the Kodi API calls, with:
 ```
 event_data = {
   'result': api_call_results,
   'result_ok': boolean,
   'input': api_call_parameters,
   'entity_id': 'media_player.kodi'}
```

* no need to clean OrderedDicts; no need for the `kodi_execute_addon` service

* no need for the `kodi_execute_addon` service

* unused import

* naming changes
2017-05-17 08:42:47 -04:00
Marc Egli 4da91d6a8b Add sonos alarm clock update service (#7521)
* Add sonos alarm clock update service

* Add tests and break lines

* Fix style errors

* Make test work with python<3.6

* Fix last two pylint errors

* fix new line to long errors
2017-05-15 00:42:45 -07:00
Eugenio Panadero 4cdf0b4969 Fix Kodi specific services registry and add descriptions (#7551)
* Fix Kodi specific services, add descriptions, add more handled exceptions

 - Fixes issue #7528
 - Add descriptions for Kodi specific services in services.yaml.
 - Error handling in Kodi API errors.
 - Make compatible the existent specific service `media_player.kodi_set_shuffle` with the general `media_player.shuffle_set` service (both use the same method but with different named parameter, I think the Kodi specific service should be eliminated, since it is not)

* fix line too long

* removed new services (for another PR); removed `kodi_set_shuffle` service

* requested changes

 - Removed `kodi_set_shuffle` service.
 - Optional `media_name` and `artist_name` parameters. `media_name` defaults to 'ALL'.
 - Guard clause to check if the services are already registered.
2017-05-12 20:48:57 -07:00
Andrey f4915ddb0b Switch basicmodem and python-roku to pypi (#7514) 2017-05-09 20:23:19 -07:00
Marc Egli d86dfb6336 Fix sonos sleep timer (#7503) 2017-05-09 18:35:51 +02:00
Josh Anderson b34c58386c Correct retrieval of spotify shuffle state (#7505)
Returned on the current playback response itself, not the device
2017-05-09 17:35:30 +02:00
abmantis 5cb3382425 new source only forces "play" if the current state is "playing" (#7506) 2017-05-09 17:34:17 +02:00
Oliver 419d97fc06 Fixed potential AttributeError when checking for deleted sources (#7502) 2017-05-09 07:24:18 +02:00
Andrey 1cd51bc6a8 Switch onkyo to pypi (#7497) 2017-05-09 08:13:29 +03:00
Andrey 2c1df75c07 Switch russound, pymysensors, and pocketcasts to pypi (#7449)
* Switch russound to pypi

* Switch pymysensors to pypi

* Switch pocketcasts to pypi
2017-05-07 02:22:38 +02:00
Paulus Schoutsen c5a91393e4 Guard against no content type (#7432) 2017-05-03 20:12:51 -07:00
Henrik Nicolaisen f389266f5f remove charset if set in content type header (#7411)
* remove charset if set in content type header like this “Content-Type: image/jpeg;charset=UTF-8”

* fixed lint error
2017-05-02 21:19:16 -07:00
Fabian Affolter 4d52b0ecd5 Update docstrings (#7405)
* Update docstrings

* Fix lint issues

* Update docstrings
2017-05-02 22:47:20 +02:00
Fabian Affolter a4f1f6e724 Update docstrings (#7374)
* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstring

* Update docstrings

* Update docstrings

* Fix lint issues

* Update docstrings

* Revert changes in dict
2017-05-02 09:18:47 -07:00
abmantis c085f06df5 Add support for shuffle toggling on Spotify component. (#7339)
* add support for shuffle toggling on Spotify component.

	this also required adding support for shuffle on the
	media_player component.

* lint

* Use ATTR_MEDIA_SHUFFLING for service handler param

* Line too long fix

* fix tests

* add shuffle set to demo mediaplayer

* rename shuffle attribute
2017-04-30 12:41:21 -07:00
Paulus Schoutsen 9afbbbf3fe Remove ordered_dict validator (#7375)
* Remove ordered_dict validator

* Lint

* Update test_config_validation.py
2017-04-30 10:55:03 -07:00
Henrik Nicolaisen 8df5de2bb8 optimize remote calls and apps on webostv media_player (#7191)
* - changed updater to only do updated if they succed and handle calls when tv is off better by only doing 1 remote call
- show all sources instead of only connected, to fix source selection when unit is powered off
- fixed sources so they can launch apps and select sources

* fixed lint errors

* show all sources and apps if no custom options are defined in the conf

* fixed indentation for lint

* set _current_source when state is off and fixed timeout exception
2017-04-30 00:30:37 -07:00