How to use the denonavr.discover function in denonavr

To help you get started, we’ve selected a few denonavr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github home-assistant / home-assistant / homeassistant / components / denonavr / media_player.py View on Github external
new_hosts = []
    # 1. option: manual setting
    if config.get(CONF_HOST) is not None:
        host = config.get(CONF_HOST)
        name = config.get(CONF_NAME)
        new_hosts.append(NewHost(host=host, name=name))

    # 2. option: discovery using netdisco
    if discovery_info is not None:
        host = discovery_info.get("host")
        name = discovery_info.get("name")
        new_hosts.append(NewHost(host=host, name=name))

    # 3. option: discovery using denonavr library
    if config.get(CONF_HOST) is None and discovery_info is None:
        d_receivers = denonavr.discover()
        # More than one receiver could be discovered by that method
        for d_receiver in d_receivers:
            host = d_receiver["host"]
            name = d_receiver["friendlyName"]
            new_hosts.append(NewHost(host=host, name=name))

    for entry in new_hosts:
        # Check if host not in cache, append it and save for later
        # starting
        if entry.host not in cache:
            new_device = denonavr.DenonAVR(
                host=entry.host,
                name=entry.name,
                show_all_inputs=show_all_sources,
                timeout=timeout,
                add_zones=add_zones,

denonavr

Automation Library for Denon AVR receivers

MIT
Latest version published 2 months ago

Package Health Score

72 / 100
Full package analysis

Similar packages