Clean up async_dispatcher_connect helper usage (#68613)
This commit is contained in:
parent
de40770926
commit
15cffbe496
20 changed files with 75 additions and 65 deletions
|
@ -20,6 +20,7 @@ from homeassistant.const import (
|
|||
)
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
|
||||
|
@ -146,8 +147,8 @@ class AquaLogicSensor(SensorEntity):
|
|||
async def async_added_to_hass(self):
|
||||
"""Register callbacks."""
|
||||
self.async_on_remove(
|
||||
self.hass.helpers.dispatcher.async_dispatcher_connect(
|
||||
UPDATE_TOPIC, self.async_update_callback
|
||||
async_dispatcher_connect(
|
||||
self.hass, UPDATE_TOPIC, self.async_update_callback
|
||||
)
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue