Warn if not registered properly

This commit is contained in:
Otto Winter
2019-05-21 12:23:38 +02:00
parent a323679771
commit 999c1a5357
9 changed files with 30 additions and 6 deletions
+3
View File
@@ -322,6 +322,7 @@ def iter_ids(config, path=None):
def do_id_pass(result): # type: (Config) -> None
from esphome.cpp_generator import MockObjClass
from esphome.cpp_types import Component
declare_ids = [] # type: List[Tuple[core.ID, ConfigPath]]
searching_ids = [] # type: List[Tuple[core.ID, ConfigPath]]
@@ -340,6 +341,8 @@ def do_id_pass(result): # type: (Config) -> None
# Resolve default ids after manual IDs
for id, _ in declare_ids:
id.resolve([v[0].id for v in declare_ids])
if isinstance(id.type, MockObjClass) and id.type.inherits_from(Component):
CORE.component_ids.add(id.id)
# Check searched IDs
for id, path in searching_ids: