@@ -50,6 +50,7 @@ def __init__(
5050 self ._full_scan_finished : Callable [[], Awaitable [None ]] | None = None
5151 self ._registration_scan_delay : float = CIRCLEPLUS_SCANREQUEST_MAINTENANCE
5252 self ._scan_completed = False
53+ self ._scan_completed_callback : Callable [[], Awaitable [None ]] | None = None
5354
5455 # region Properties
5556
@@ -102,6 +103,10 @@ def start_node_discover(self, callback: Callable[[], Awaitable[None]]) -> None:
102103 """Register method to be called when a node is found."""
103104 self ._start_node_discover = callback
104105
106+ def scan_completed_callback (self , callback : Callable [[], Awaitable [None ]]) -> None :
107+ """Register method to be called when a node is found."""
108+ self ._scan_completed_callback = callback
109+
105110 def full_scan_finished (self , callback : Callable [[], Awaitable [None ]]) -> None :
106111 """Register method to be called when full scan is finished."""
107112 self ._full_scan_finished = callback
@@ -200,6 +205,8 @@ async def update_missing_registrations_circleplus(self) -> None:
200205 self ._scan_completed = True
201206 if self ._network_cache is not None :
202207 await self ._network_cache .prune_cache (_maintenance_registry )
208+ if self ._scan_completed_callback is not None :
209+ await self ._scan_completed_callback ()
203210
204211 async def load_registrations_from_cache (self ) -> None :
205212 """Quick retrieval of all unknown network registrations from cache."""
@@ -216,6 +223,8 @@ async def load_registrations_from_cache(self) -> None:
216223 await self ._start_node_discover (mac , nodetype , True )
217224 await sleep (0.1 )
218225 _LOGGER .info ("Cache network registration discovery finished" )
226+ if self ._scan_completed_callback is not None :
227+ await self ._scan_completed_callback ()
219228
220229 async def update_node_registration (self , mac : str ) -> bool :
221230 """Register (re)joined node to Plugwise network and return network address."""
0 commit comments