mirror of
https://github.com/home-assistant/core.git
synced 2025-07-12 07:47:08 +00:00
Fix failure to register services in dynalite (#93069)
* fixed bug that fails to register services when there is no YAML config * style improvement per thecode's suggestion
This commit is contained in:
parent
c522ea855d
commit
f564a0ca24
@ -43,19 +43,11 @@ CONFIG_SCHEMA = vol.Schema(
|
|||||||
|
|
||||||
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||||
"""Set up the Dynalite platform."""
|
"""Set up the Dynalite platform."""
|
||||||
conf = config.get(DOMAIN)
|
conf = config.get(DOMAIN, {})
|
||||||
LOGGER.debug("Setting up dynalite component config = %s", conf)
|
LOGGER.debug("Setting up dynalite component config = %s", conf)
|
||||||
|
|
||||||
if conf is None:
|
|
||||||
conf = {}
|
|
||||||
|
|
||||||
hass.data[DOMAIN] = {}
|
hass.data[DOMAIN] = {}
|
||||||
|
|
||||||
# User has configured bridges
|
bridges = conf.get(CONF_BRIDGES, [])
|
||||||
if CONF_BRIDGES not in conf:
|
|
||||||
return True
|
|
||||||
|
|
||||||
bridges = conf[CONF_BRIDGES]
|
|
||||||
|
|
||||||
for bridge_conf in bridges:
|
for bridge_conf in bridges:
|
||||||
host = bridge_conf[CONF_HOST]
|
host = bridge_conf[CONF_HOST]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user