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`
This commit is contained in:
Eugenio Panadero
2017-11-14 11:41:19 +01:00
committed by Pascal Vizeli
parent dc6e50c39d
commit e947e6a143
3 changed files with 155 additions and 177 deletions

View File

@@ -126,6 +126,7 @@ CONF_SHOW_ON_MAP = 'show_on_map'
CONF_SLAVE = 'slave'
CONF_SSL = 'ssl'
CONF_STATE = 'state'
CONF_STATE_TEMPLATE = 'state_template'
CONF_STRUCTURE = 'structure'
CONF_SWITCHES = 'switches'
CONF_TEMPERATURE_UNIT = 'temperature_unit'