software-2 / ha-aurora

Nanoleaf Aurora integration for Home Assistant
Other
24 stars 11 forks source link

Support SSDP for discovery #3

Closed jassmith closed 7 years ago

jassmith commented 7 years ago

Most users only have a single aurora so using SSDP to discover that device would help limit the amount of configuration required to get this working. Your setup script already has this support, however it does seem to fail to find my aurora.

I put some basic support into the setup_platform call as follows:

from nanoleaf import setup

<SNIP>

vol.Optional(CONF_HOST, default='SSDP'): cv.string,

<SNIP>

def setup_platform(hass, config, add_devices, discovery_info=None):
    host = config.get(CONF_HOST)
    apikey = config.get(CONF_API_KEY)
    name = config.get(CONF_NAME)

    if host == 'SSDP':
        ipAddrList = setup.find_auroras()
        if not ipAddrList:
            _LOGGER.error("Could not locate Nanoleaf Aurora using SSDP, please enter host IP")
            return
        host = ipAddrList[0]

I suspect something is wrong with your SSDP implementation because I am able to get the device IP in about 8 seconds on my network using a different SSDP library (for C# unfortunately). I haven't had a chance to dig into what is going wrong there.

software-2 commented 7 years ago

Could you please provide some details as to your network configuration, the library that does work for you, etc? Also, this is an issue with the python library, not the hass component. Please open a new issue on that project. Closing this issue on this project.

While I question the claim that most users only have one controller, better device discovery is already planned for hass.