From 93808e53b6f31c6404b6e835a9fdbf2d496d465d Mon Sep 17 00:00:00 2001 From: Stephan Traub Date: Wed, 15 Dec 2021 23:22:23 +0100 Subject: [PATCH] Discovery test --- custom_components/wiz_light/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/custom_components/wiz_light/__init__.py b/custom_components/wiz_light/__init__.py index 8e84ae6..6eb1830 100644 --- a/custom_components/wiz_light/__init__.py +++ b/custom_components/wiz_light/__init__.py @@ -2,7 +2,10 @@ import logging from dataclasses import dataclass +from ipaddress import ip_network + from homeassistant.config_entries import ConfigEntry +from homeassistant.components import network from homeassistant.const import CONF_HOST from homeassistant.core import HomeAssistant from homeassistant.exceptions import ConfigEntryNotReady @@ -18,8 +21,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry): """Set up the wiz_light integration from a config entry.""" + ip_address = entry.data.get(CONF_HOST) _LOGGER.debug("Get bulb with IP: %s", ip_address) + try: bulb = wizlight(ip_address) mac_addr = await bulb.getMac()