UniFi - Improve signalling and handling of adding new entities (#34925)
* Change signalling and handling of adding devices * Bump aiounifi to v19 Use the proper variable for roamradio
This commit is contained in:
parent
dbf383f713
commit
c5ce95ff06
9 changed files with 312 additions and 109 deletions
|
@ -1,10 +1,13 @@
|
|||
"""Base class for UniFi entities."""
|
||||
import logging
|
||||
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.helpers.entity_registry import async_entries_for_device
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class UniFiBase(Entity):
|
||||
"""UniFi entity base class."""
|
||||
|
@ -27,6 +30,7 @@ class UniFiBase(Entity):
|
|||
|
||||
async def async_added_to_hass(self) -> None:
|
||||
"""Entity created."""
|
||||
LOGGER.debug("New %s entity %s (%s)", self.TYPE, self.entity_id, self.mac)
|
||||
for signal, method in (
|
||||
(self.controller.signal_reachable, self.async_update_callback),
|
||||
(self.controller.signal_options_update, self.options_updated),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue