Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions homeassistant/components/media_player/denonavr.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@
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 | \
Expand All @@ -37,6 +39,8 @@
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,
})


Expand All @@ -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)
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down