2019-06-03 17:06:53 +00:00
|
|
|
"""Config flow for Wemo."""
|
2019-09-23 03:46:32 +00:00
|
|
|
|
|
|
|
import pywemo
|
|
|
|
|
2019-12-09 10:53:51 +00:00
|
|
|
from homeassistant.helpers import config_entry_flow
|
2019-09-23 03:46:32 +00:00
|
|
|
|
2019-06-03 17:06:53 +00:00
|
|
|
from . import DOMAIN
|
|
|
|
|
|
|
|
|
|
|
|
async def _async_has_devices(hass):
|
|
|
|
"""Return if there are devices that can be discovered."""
|
2019-09-23 03:46:32 +00:00
|
|
|
return bool(await hass.async_add_executor_job(pywemo.discover_devices))
|
2019-06-03 17:06:53 +00:00
|
|
|
|
|
|
|
|
2021-04-29 21:12:58 +00:00
|
|
|
config_entry_flow.register_discovery_flow(DOMAIN, "Wemo", _async_has_devices)
|