mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
Only initialize Nuki configurations (#49747)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
parent
93628554cb
commit
316f6ba397
@ -10,7 +10,7 @@ from requests.exceptions import RequestException
|
|||||||
|
|
||||||
from homeassistant import exceptions
|
from homeassistant import exceptions
|
||||||
from homeassistant.config_entries import SOURCE_IMPORT
|
from homeassistant.config_entries import SOURCE_IMPORT
|
||||||
from homeassistant.const import CONF_HOST, CONF_PORT, CONF_TOKEN
|
from homeassistant.const import CONF_HOST, CONF_PLATFORM, CONF_PORT, CONF_TOKEN
|
||||||
from homeassistant.helpers.update_coordinator import (
|
from homeassistant.helpers.update_coordinator import (
|
||||||
CoordinatorEntity,
|
CoordinatorEntity,
|
||||||
DataUpdateCoordinator,
|
DataUpdateCoordinator,
|
||||||
@ -22,6 +22,7 @@ from .const import (
|
|||||||
DATA_COORDINATOR,
|
DATA_COORDINATOR,
|
||||||
DATA_LOCKS,
|
DATA_LOCKS,
|
||||||
DATA_OPENERS,
|
DATA_OPENERS,
|
||||||
|
DEFAULT_PORT,
|
||||||
DEFAULT_TIMEOUT,
|
DEFAULT_TIMEOUT,
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
ERROR_STATES,
|
ERROR_STATES,
|
||||||
@ -59,11 +60,18 @@ async def async_setup(hass, config):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
for conf in confs:
|
for conf in confs:
|
||||||
hass.async_create_task(
|
if CONF_PLATFORM in conf and conf[CONF_PLATFORM] == DOMAIN:
|
||||||
hass.config_entries.flow.async_init(
|
hass.async_create_task(
|
||||||
DOMAIN, context={"source": SOURCE_IMPORT}, data=conf
|
hass.config_entries.flow.async_init(
|
||||||
|
DOMAIN,
|
||||||
|
context={"source": SOURCE_IMPORT},
|
||||||
|
data={
|
||||||
|
CONF_HOST: conf[CONF_HOST],
|
||||||
|
CONF_PORT: conf.get(CONF_PORT, DEFAULT_PORT),
|
||||||
|
CONF_TOKEN: conf[CONF_TOKEN],
|
||||||
|
},
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user