mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 23:27:37 +00:00
Merge pull request #58 from andythigpen/config-lists
Add support for lists when using config_per_platform helper.
This commit is contained in:
commit
5b9b744662
@ -98,14 +98,17 @@ def config_per_platform(config, domain, logger):
|
|||||||
|
|
||||||
while config_key in config:
|
while config_key in config:
|
||||||
platform_config = config[config_key]
|
platform_config = config[config_key]
|
||||||
|
if not isinstance(platform_config, list):
|
||||||
|
platform_config = [platform_config]
|
||||||
|
|
||||||
platform_type = platform_config.get(CONF_PLATFORM)
|
for item in platform_config:
|
||||||
|
platform_type = item.get(CONF_PLATFORM)
|
||||||
|
|
||||||
if platform_type is None:
|
if platform_type is None:
|
||||||
logger.warning('No platform specified for %s', config_key)
|
logger.warning('No platform specified for %s', config_key)
|
||||||
break
|
continue
|
||||||
|
|
||||||
yield platform_type, platform_config
|
yield platform_type, item
|
||||||
|
|
||||||
found += 1
|
found += 1
|
||||||
config_key = "{} {}".format(domain, found)
|
config_key = "{} {}".format(domain, found)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user