fix int(port)

This commit is contained in:
Andrey
2021-02-26 16:18:05 +03:00
parent 8742bb975f
commit f88109c3a6
6 changed files with 20 additions and 9 deletions

View File

@@ -26,6 +26,7 @@ from .const import (
CONF_CUSTOM,
CONF_SKIP,
)
from .tools import int_ignore
lg = logging.getLogger(__name__)
@@ -61,7 +62,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry, asyn
devices = []
customize = hass.data.get(DOMAIN, {}).get(CONF_CUSTOM, {})
for port, cfg in config_entry.data.get('light', {}).items():
port = int(port)
port = int_ignore(port)
c = customize.get(mid, {}).get(port, {})
if c.get(CONF_SKIP, False) or c.get(CONF_DOMAIN, 'light') != 'light':
continue