Add support of Zone2 and Zone3#8025
Conversation
|
@scarface-4711, thanks for your PR! By analyzing the history of the files in this pull request, we identified @happyleavesaoc, @fabaff and @balloob to be potential reviewers. |
|
|
||
|
|
||
| DENON_ZONE_SCHEMA = vol.Schema({ | ||
| vol.Required(CONF_ZONE): denon_zone, |
There was a problem hiding this comment.
Instead of writing your own validator, you can use vol.In(CONF_VALID_ZONES).
| cache = hass.data[KEY_DENON_CACHE] = set() | ||
|
|
||
| # Get config option for show_all_sources | ||
| show_all_sources = config.get(CONF_SHOW_ALL_SOURCES) if not None else False |
There was a problem hiding this comment.
This doesn't work ? also, there is already a default value specified for CONF_SHOW_ALL_SOURCES so also not necessary.
|
|
||
| # Get config option for additional zones | ||
| zones = config.get(CONF_ZONES) | ||
| if zones is not None: |
There was a problem hiding this comment.
Zones is never None since you pass it via ensure_list.
There was a problem hiding this comment.
The whole zones tag is optional. It could be left out completely , if only an instance for Main Zone of the receiver should be created. In this case zones could be None. I just tested it.
| if host not in cache: | ||
| new_device = denonavr.DenonAVR( | ||
| host, name, show_all_sources, add_zones) | ||
| for new_zone in new_device.zones.values(): |
There was a problem hiding this comment.
Any way you can abstract this out instead of having to copy paste it 3 times?
|
Awesome! |
* Add support of Zone2 and Zone3 * Changes from balloobs feedback
Description:
Support for Zone2 and Zone3 of the the receiver was added. If configured, new instances of media_player are created for the additional zones.
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#2786
Example entry for
configuration.yaml(if applicable):Checklist:
If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
toxrun successfully. Your PR cannot be merged unless tests passREQUIREMENTSvariable (example).requirements_all.txtby runningscript/gen_requirements_all.py.