diff --git a/homeassistant/components/media_player/denonavr.py b/homeassistant/components/media_player/denonavr.py index 5fdfbcfb864..397a196cdc5 100644 --- a/homeassistant/components/media_player/denonavr.py +++ b/homeassistant/components/media_player/denonavr.py @@ -19,11 +19,13 @@ from homeassistant.const import ( CONF_NAME, STATE_ON) import homeassistant.helpers.config_validation as cv -REQUIREMENTS = ['denonavr==0.4.2'] +REQUIREMENTS = ['denonavr==0.4.3'] _LOGGER = logging.getLogger(__name__) DEFAULT_NAME = None +DEFAULT_SHOW_SOURCES = False +CONF_SHOW_ALL_SOURCES = 'show_all_sources' KEY_DENON_CACHE = 'denonavr_hosts' SUPPORT_DENON = SUPPORT_VOLUME_STEP | SUPPORT_VOLUME_MUTE | \ @@ -37,6 +39,8 @@ SUPPORT_MEDIA_MODES = SUPPORT_PLAY_MEDIA | \ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ vol.Optional(CONF_HOST): cv.string, vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string, + vol.Optional(CONF_SHOW_ALL_SOURCES, default=DEFAULT_SHOW_SOURCES): + cv.boolean, }) @@ -52,6 +56,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): cache = hass.data[KEY_DENON_CACHE] = set() # Start assignment of host and name + show_all_sources = config.get(CONF_SHOW_ALL_SOURCES) # 1. option: manual setting if config.get(CONF_HOST) is not None: host = config.get(CONF_HOST) @@ -60,7 +65,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): if host not in cache: cache.add(host) receivers.append( - DenonDevice(denonavr.DenonAVR(host, name))) + DenonDevice(denonavr.DenonAVR(host, name, show_all_sources))) _LOGGER.info("Denon receiver at host %s initialized", host) # 2. option: discovery using netdisco if discovery_info is not None: @@ -70,7 +75,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): if host not in cache: cache.add(host) receivers.append( - DenonDevice(denonavr.DenonAVR(host, name))) + DenonDevice(denonavr.DenonAVR(host, name, show_all_sources))) _LOGGER.info("Denon receiver at host %s initialized", host) # 3. option: discovery using denonavr library if config.get(CONF_HOST) is None and discovery_info is None: @@ -85,7 +90,8 @@ def setup_platform(hass, config, add_devices, discovery_info=None): if host not in cache: cache.add(host) receivers.append( - DenonDevice(denonavr.DenonAVR(host, name))) + DenonDevice( + denonavr.DenonAVR(host, name, show_all_sources))) _LOGGER.info("Denon receiver at host %s initialized", host) # Add all freshly discovered receivers diff --git a/requirements_all.txt b/requirements_all.txt index 4b1ccb316b3..bf7ad1d9d0d 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -144,7 +144,7 @@ datapoint==0.4.3 # decora==0.4 # homeassistant.components.media_player.denonavr -denonavr==0.4.2 +denonavr==0.4.3 # homeassistant.components.media_player.directv directpy==0.1