mirror of
https://github.com/esphome/esphome.git
synced 2025-09-07 05:42:20 +01:00
BLE client support on ESP32 (#1177)
Co-authored-by: Ben Buxton <bb@cactii.net> Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
@@ -49,7 +49,7 @@ class ComponentManifest:
|
||||
return getattr(self.module, "CONFIG_SCHEMA", None)
|
||||
|
||||
@property
|
||||
def is_multi_conf(self):
|
||||
def multi_conf(self):
|
||||
return getattr(self.module, "MULTI_CONF", False)
|
||||
|
||||
@property
|
||||
@@ -194,7 +194,7 @@ _COMPONENT_CACHE["esphome"] = ComponentManifest(
|
||||
def iter_components(config):
|
||||
for domain, conf in config.items():
|
||||
component = get_component(domain)
|
||||
if component.is_multi_conf:
|
||||
if component.multi_conf:
|
||||
for conf_ in conf:
|
||||
yield domain, component, conf_
|
||||
else:
|
||||
@@ -651,9 +651,16 @@ def validate_config(config, command_line_substitutions):
|
||||
)
|
||||
continue
|
||||
|
||||
if comp.is_multi_conf:
|
||||
if comp.multi_conf:
|
||||
if not isinstance(conf, list):
|
||||
result[domain] = conf = [conf]
|
||||
if not isinstance(comp.multi_conf, bool) and len(conf) > comp.multi_conf:
|
||||
result.add_str_error(
|
||||
"Component {} supports a maximum of {} "
|
||||
"entries ({} found).".format(domain, comp.multi_conf, len(conf)),
|
||||
path,
|
||||
)
|
||||
continue
|
||||
for i, part_conf in enumerate(conf):
|
||||
validate_queue.append((path + [i], part_conf, comp))
|
||||
continue
|
||||
|
Reference in New Issue
Block a user