Breakout heartbeat monitor and poe command queue in UniFi (#112529)
* Split out entity helper functionality to own class * Split out heartbeat to own class * Break out poe command * Make more parts private * Make more things private and simplify naming * Sort initialize * Fix ruff
This commit is contained in:
parent
3e0a45eee2
commit
8bf3c87336
5 changed files with 193 additions and 91 deletions
|
@ -460,7 +460,7 @@ class UnifiSensorEntity(UnifiEntity[HandlerT, ApiItemT], SensorEntity):
|
|||
if description.is_connected_fn is not None:
|
||||
# Send heartbeat if client is connected
|
||||
if description.is_connected_fn(self.hub, self._obj_id):
|
||||
self.hub.async_heartbeat(
|
||||
self.hub.update_heartbeat(
|
||||
self._attr_unique_id,
|
||||
dt_util.utcnow() + self.hub.config.option_detection_time,
|
||||
)
|
||||
|
@ -485,4 +485,4 @@ class UnifiSensorEntity(UnifiEntity[HandlerT, ApiItemT], SensorEntity):
|
|||
|
||||
if self.entity_description.is_connected_fn is not None:
|
||||
# Remove heartbeat registration
|
||||
self.hub.async_heartbeat(self._attr_unique_id)
|
||||
self.hub.remove_heartbeat(self._attr_unique_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue