Skip to content

Commit fa0d538

Browse files
committed
Fix empty components (#23177)
1 parent c508d59 commit fa0d538

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

homeassistant/loader.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@
5151
_UNDEF = object()
5252

5353

54-
def manifest_from_legacy_module(module: ModuleType) -> Dict:
54+
def manifest_from_legacy_module(domain: str, module: ModuleType) -> Dict:
5555
"""Generate a manifest from a legacy module."""
5656
return {
57-
'domain': module.DOMAIN, # type: ignore
58-
'name': module.DOMAIN, # type: ignore
57+
'domain': domain,
58+
'name': domain,
5959
'documentation': None,
6060
'requirements': getattr(module, 'REQUIREMENTS', []),
6161
'dependencies': getattr(module, 'DEPENDENCIES', []),
@@ -106,7 +106,7 @@ def resolve_legacy(cls, hass: 'HomeAssistant', domain: str) \
106106

107107
return cls(
108108
hass, comp.__name__, pathlib.Path(comp.__file__).parent,
109-
manifest_from_legacy_module(comp)
109+
manifest_from_legacy_module(domain, comp)
110110
)
111111

112112
def __init__(self, hass: 'HomeAssistant', pkg_path: str,

tests/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ def __init__(self, domain=None, dependencies=None, setup=None,
487487
def mock_manifest(self):
488488
"""Generate a mock manifest to represent this module."""
489489
return {
490-
**loader.manifest_from_legacy_module(self),
490+
**loader.manifest_from_legacy_module(self.DOMAIN, self),
491491
**(self._partial_manifest or {})
492492
}
493493

0 commit comments

Comments
 (0)