Clean up async_dispatcher_connect helper usage (#68613)

This commit is contained in:
Franck Nijhof 2022-03-24 13:19:11 +01:00 committed by GitHub
parent de40770926
commit 15cffbe496
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 75 additions and 65 deletions

View file

@ -2,6 +2,7 @@
from enocean.protocol.packet import Packet
from enocean.utils import combine_hex
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity import Entity
from .const import SIGNAL_RECEIVE_MESSAGE, SIGNAL_SEND_MESSAGE
@ -18,8 +19,8 @@ class EnOceanEntity(Entity):
async def async_added_to_hass(self):
"""Register callbacks."""
self.async_on_remove(
self.hass.helpers.dispatcher.async_dispatcher_connect(
SIGNAL_RECEIVE_MESSAGE, self._message_received_callback
async_dispatcher_connect(
self.hass, SIGNAL_RECEIVE_MESSAGE, self._message_received_callback
)
)