From 77244eab1ed226a854b7a48524b6b5883ddcb119 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 17 Apr 2019 19:17:13 -0700 Subject: [PATCH] Fix empty components (#23177) --- homeassistant/loader.py | 8 ++++---- tests/common.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/homeassistant/loader.py b/homeassistant/loader.py index ecc39f8db8f..ed2ea83afb0 100644 --- a/homeassistant/loader.py +++ b/homeassistant/loader.py @@ -51,11 +51,11 @@ CUSTOM_WARNING = ( _UNDEF = object() -def manifest_from_legacy_module(module: ModuleType) -> Dict: +def manifest_from_legacy_module(domain: str, module: ModuleType) -> Dict: """Generate a manifest from a legacy module.""" return { - 'domain': module.DOMAIN, # type: ignore - 'name': module.DOMAIN, # type: ignore + 'domain': domain, + 'name': domain, 'documentation': None, 'requirements': getattr(module, 'REQUIREMENTS', []), 'dependencies': getattr(module, 'DEPENDENCIES', []), @@ -106,7 +106,7 @@ class Integration: return cls( hass, comp.__name__, pathlib.Path(comp.__file__).parent, - manifest_from_legacy_module(comp) + manifest_from_legacy_module(domain, comp) ) def __init__(self, hass: 'HomeAssistant', pkg_path: str, diff --git a/tests/common.py b/tests/common.py index 99afd4fdb95..2467dae04b9 100644 --- a/tests/common.py +++ b/tests/common.py @@ -487,7 +487,7 @@ class MockModule: def mock_manifest(self): """Generate a mock manifest to represent this module.""" return { - **loader.manifest_from_legacy_module(self), + **loader.manifest_from_legacy_module(self.DOMAIN, self), **(self._partial_manifest or {}) }