Esempio n. 1
0
 async def async_step_zeroconf(self, discovery_info):
     """Prepare configuration for a discovered Daikin device."""
     _LOGGER.debug("Zeroconf user_input: %s", discovery_info)
     devices = Discovery().poll(ip=discovery_info[CONF_HOST])
     await self.async_set_unique_id(next(iter(devices))[KEY_MAC])
     self._abort_if_unique_id_configured()
     self.host = discovery_info[CONF_HOST]
     return await self.async_step_user()
Esempio n. 2
0
 async def async_step_zeroconf(self, discovery_info):
     """Prepare configuration for a discovered Daikin device."""
     _LOGGER.debug("Zeroconf user_input: %s", discovery_info)
     devices = Discovery().poll(ip=discovery_info[CONF_HOST])
     if not devices:
         _LOGGER.debug(
             "Could not find MAC-address for %s,"
             " make sure the required UDP ports are open (see integration documentation)",
             discovery_info[CONF_HOST],
         )
         return self.async_abort(reason="cannot_connect")
     await self.async_set_unique_id(next(iter(devices))[KEY_MAC])
     self._abort_if_unique_id_configured()
     self.host = discovery_info[CONF_HOST]
     return await self.async_step_user()