Commit Graph

52 Commits (f4974f58fee79d5093bccacc118d19a35f9cbba9)

Author SHA1 Message Date
Fabian Affolter 0d7ee9b93b
Order imports (#16515) 2018-09-09 14:26:06 +02:00
Paulus Schoutsen 994b829cb4
add_devices -> add_entities (#16171)
* add_devices -> add_entities

* Lint

* PyLint

* Revert external method in scsgate
2018-08-24 16:37:30 +02:00
Ville Skyttä b92350fb55 Lint cleanup (#15103)
* Remove unneeded inline pylint disables

* Remove unneeded noqa's

* Use symbol names instead of message ids in inline pylint disables
2018-06-25 13:05:07 -04:00
Greg Laabs 5ff5c73e2b "unavailable" Media players should be considered off in Universal player (#14466)
The Universal media player inherits the states of the first child player that is not in some sort of "Off" state (including idle.) It was not considering the "unavailable" state to be off. Now it does.
2018-05-16 08:00:57 +02:00
Otto Winter a4bf421044 Convert more files to async/await syntax (#14142)
* Move more files to async/await syntax

* Attempt Work around pylint bug

Using lazytox :P
2018-04-28 19:26:20 -04:00
iliketoprogram14 e72fefa74d Fixed universal media player templated source_select bug (issue #10981) and corrected typo in test_universal (#11746) 2018-01-17 21:19:34 -08: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
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
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
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
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
Dan f0027e3cc1 Fox UMP volume set (#6904)
async needs consistant paramater namming accross platforms. This fixes
UMP's volume set method by renaming the paramater.
2017-04-02 15:31:28 -07:00
Pascal Vizeli 41f558b181 Bootstrap / Component setup async (#6264)
* Bootstrap / Entiy setup async

* Cleanup add_job stuff / return task/future object

* Address paulus comments / part 1

* fix install pip

* Cleanup bootstrap / move config stuff to config.py

* Make demo async

* Further bootstrap improvement

* Address Martin's comments

* Fix initial tests

* Fix final tests

* Fix bug with prepare loader

* Remove no longer needed things

* Log error when invalid config

* More cleanup

* Cleanups platform events & fix lint

* Use a non blocking add_entities callback for platform

* Fix Autoamtion is setup befor entity is ready

* Better automation fix

* Address paulus comments

* Typo

* fix lint

* rename functions

* fix tests

* fix test

* change exceptions

* fix spell
2017-02-28 20:33:19 -08:00
Pascal Vizeli 1d7ab0fa95 Cleanup some async stuff (#6127)
* Cleanup some async stuff

* change to schedule_update_ha_state()

* fix media player

* fix zigbee
2017-02-20 13:24:03 -08:00
Adam Mills ecfe8e0a9a Formalize supported_features as entity property (#5794)
* Formalize supported_features as entity property

* Remove extra emulated_hue conditions

* Generate log message in executor
2017-02-07 20:42:45 -08:00
Pascal Vizeli eefb603f17 Cleanup media_player universal platform / blocking platform. (#5671)
* Cleanup media_player universal platform / blocking platform.

* fix comments

* fix unittest

* fix lint

* fix unittest lint

* fix coro

* fix test

* fix tests part 2
2017-02-01 21:45:19 -08:00
Adam Mills eb06023aa5 Fix universal mp service call wth no child (#5411) 2017-01-17 22:15:37 -08:00
Michaël Arnauts ba29ba0fc3 Universal media_player returns ATTR_MEDIA_POSITION and ATTR_MEDIA_POSITION_UPDATED_AT from it's active child now. (#5184) 2017-01-05 23:15:26 +01:00
Adam Mills 776455030f Fix media_image_urls for universal media player (#4765)
* Fix media_image_urls for universal media player

* Linter fixes
2016-12-05 18:07:04 -08:00
Dan a099430834 Universal source list (#4086)
* Add source_list to universal media player

* Expanded attirubte and command support for UMP

Added support to the universal media player
for the following:
    Volume Set
    Current Source
    Set Source
    Current Volume

The goal is to facilitate a single-card media player
that includes source selection and setting the volume
of the receiver.

Example setup:
```
media_player:
  - platform: universal
    name: Media Center
    children:
      - media_player.kodi
      - media_player.cast
    commands:
      select_source:
        service: media_player.select_source
        data:
          entity_id: media_player.receiver
      volume_set:
        service: media_player.volume_set
        data:
          entity_id: media_player.receiver
      volume_mute:
        service: media_player.volume_mute
        data:
          entity_id: media_player.receiver
      turn_on:
        service: homeassistant.turn_on
        data:
          entity_id: media_player.receiver
      turn_off:
        service: homeassistant.turn_off
        data:
          entity_id: media_player.receiver
    attributes:
      state: media_player.receiver
      is_volume_muted: media_player.receiver|is_volume_muted
      volume_level: media_player.receiver|volume_level
      source: media_player.receiver|source
      source_list: media_player.receiver|source_list
```

* Remove print statements

* Change service call back to use call_from_config

* Modified service calls to use template data

* linting fixes

* Add tests

* linting fices

* More pylinting
2016-12-03 20:09:28 -08: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
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
Michaël Arnauts 63356fb5eb supported_media_commands should check for SERVICE_SELECT_SOURCE instead of SUPPORT_SELECT_SOURCE (#2482) 2016-07-14 11:14:49 -07:00
Fabian Affolter 419ff18afb Docstrings (#2395)
* Replace switch with lock

* Update docstrings

* Add link to docs

* Add link to docs and update docstrings

* Update docstring

* Update docstrings and fix typos

* Add link to docs

* Add link to docs

* Add link to docs and update docstrings

* Fix link to docs and update docstrings

* Remove blank line

* Add link to docs
2016-06-30 10:33:34 +02: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
Hernán 393bd88091 Add Media Player Stop command + Kodi support for it (#1960)
* Started adding Stop command to Kodi media player

* minor

* minor

* minor

* abstract-method fixed
2016-05-06 17:57:00 -07:00
Daniel J. Kemp 86199c8277 Add onkyo receiver, and source select support
Added onkyo receiver component

Added support for input source selection to media players,
and do the onkyo receiver component.
2016-03-29 22:17:36 -04:00
MartinHjelmare c56701baaf Refactor reproduce_state for scene component
* Add tests to reach full coverage for helpers/state.py.
* Refactor reproduce_state function in helpers/state.py. Add two dicts,
	as global constants, service_attributes and service_to_state. Use
	these in combination with the dict of services per domain from
	ServiceRegistry, to find the correct service to use in a scene state
	change.
* Use break statement in for loop, to break if service was selected
	to update state, in preference to update state attributes, ie state
	update takes precedence.
* Add ATTR_CODE and ATTR_CODE_FORMAT in const. Import these in
	alarm_control_panel and lock platforms instead of making duplicate
	constants in multiple modules.
* Use ATTR_MEDIA_CONTENT_TYPE and ATTR_MEDIA_CONTENT_ID in media_player
	platform in SERVICE_PLAY_MEDIA and play_media methods, instead of
	'media_type' and 'media_id'.
* Fix PEP257 in modified files.
2016-03-09 18:52:05 +01:00
Fabian Affolter cf7c2c492a Fix PEP257 issues 2016-03-08 10:34:33 +01:00
Paulus Schoutsen e80309c03c Fix imports (using isort) 2016-02-18 21:27:50 -08:00
Paulus Schoutsen e7e540d4bb Clean up and test media player 2016-02-02 00:31:36 -08:00
Ryan Kraus 6a75b524cb Removed unused private method from universal media player
The universal media player contained a private method that was replaced
by the update method. It was meant to be removed and wasn’t. This
commit removed that method.
2016-01-30 11:57:46 -05:00
Ryan Kraus 57c0f96118 Renamed update_state to update in universal media player
Renamed update_state method in universal media player to update so that
it would be called by HA when the state was being published. Moved the
update_ha_state to a function inside of __init__. Updated the tests
accordingly.
2016-01-12 22:15:23 -08:00
Ryan Kraus a84429538b Fixed attribute configuration handling in universal media player
Forced all parsed attribute configurations to be of length 2. Removed
entity_id=None option from entity lookups. Explicitly passed entity
lookup information to _entity_lkp.
2016-01-12 22:15:23 -08:00
Ryan Kraus 07953fb7e3 Removed dependencies property from universal media player
The dependencies property was only being called once by the __init__
method so it was removed and the code was moved to the __init__ method.
The tests were updated to reflect this.
2016-01-12 22:15:23 -08:00
Ryan Kraus 12da6f531e Removed property from universal media player
The active_child_state property was unnecessary as it was not being
referenced outside the class. This commit removes it and updates the
tests accordingly.
2016-01-12 22:15:22 -08:00
Ryan Kraus 769f5aafb7 Added should_poll = False to universal media player 2016-01-12 22:15:22 -08:00
Ryan Kraus a1abab8ced Set universal media player to force refresh when updating HA 2016-01-12 22:15:22 -08:00
Ryan Kraus 270a998e3c Merged service calling method in universal media player 2016-01-12 22:15:22 -08:00
Ryan Kraus d829497c3d Changed universal media player to keep service attrs in dict
Revised universal media player to keep service data in a dictionary
rather than passing it around as magic parameters.
2016-01-12 22:15:22 -08:00
Ryan Kraus a8d5b0e5ec Made universal media player cache active player
Revised universal media player to cache the active player when updating
the state when any of the children change. Revised tests to accommodate
this change.
2016-01-12 22:15:22 -08:00
Ryan Kraus 85d732a45a Streamlined child state lookups in universal media player
1) Removed children property because it was only being used by one
method.
2) Removed option to return state as object from _entity_lkp as it was
no longer needed.
3) Used hass.states.get to get entity state objects.
4) Revised test to remove children property.
2016-01-12 22:15:22 -08:00
Ryan Kraus 8f3e8d29f0 Renamed SUPPORT_VOLUME_STEP flag in media_player
1) Renamed SUPPORT_VOLUME_BUTTONS to SUPPORT_VOLUME_STEP
2) Removed unused imports from tests.
2016-01-12 22:15:22 -08:00
Ryan Kraus ee4543d739 Using call_from_config in Universal Media Player
Changed universal media player to use the call_from_config helper to
call services specified in the configuration file. This was done to
copy what is done in the Alexa and Automation components.
2016-01-12 22:15:22 -08:00
Ryan Kraus 59456f20fb Added tests to universal media player and fixed bug
1) Fixed universal media player to maintain specified child order when
checking for active child.
2) Added many tests to universal media player.
2016-01-12 22:15:22 -08:00
Ryan Kraus 4a1f609893 Lint fixes and faster updating to universal media player.
1) Many lint fixes.
2) Bound the Universal Media Player to its dependencies so that its
state will be updated when one of its dependencies is changed.
2016-01-12 22:15:22 -08:00
Ryan Kraus 36214c73ee Better handling of entity lookups in Universal media player.
Allowed the lookup function in the Universal Media Player to return
either a state object or the actual state of an entity during lookup.
2016-01-12 22:15:21 -08:00