Fix unnecessary hass.components interaction (#23029)
* Fix wemo * Fix bloomsky * Fix netatmo * Fix one more reference
This commit is contained in:
1 parent
57f17707c6
commit
c94b031db1
11 files changed
+41
-33
No files matched your search
@@ -8,6 +8,8 @@ import requests
|
||||
from homeassistant.components.binary_sensor import BinarySensorDevice
|
||||
from homeassistant.exceptions import PlatformNotReady
|
||||
|
||||
from . import SUBSCRIPTION_REGISTRY
|
||||
|
||||
DEPENDENCIES = ['wemo']
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
@@ -66,7 +68,7 @@ class WemoBinarySensor(BinarySensorDevice):
|
||||
# Define inside async context so we know our event loop
|
||||
self._update_lock = asyncio.Lock()
|
||||
|
||||
registry = self.hass.components.wemo.SUBSCRIPTION_REGISTRY
|
||||
registry = SUBSCRIPTION_REGISTRY
|
||||
await self.hass.async_add_executor_job(registry.register, self.wemo)
|
||||
registry.on(self.wemo, None, self._subscription_callback)
|
||||
|
||||
|
||||
Reference in new issue
Block a user