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
@@ -12,6 +12,8 @@ from homeassistant.util import convert
|
||||
from homeassistant.const import (
|
||||
STATE_OFF, STATE_ON, STATE_STANDBY, STATE_UNKNOWN)
|
||||
|
||||
from . import SUBSCRIPTION_REGISTRY
|
||||
|
||||
DEPENDENCIES = ['wemo']
|
||||
SCAN_INTERVAL = timedelta(seconds=10)
|
||||
|
||||
@@ -198,7 +200,7 @@ class WemoSwitch(SwitchDevice):
|
||||
# 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_job(registry.register, self.wemo)
|
||||
registry.on(self.wemo, None, self._subscription_callback)
|
||||
|
||||
|
||||
Reference in new issue
Block a user