2525import random
2626import threading
2727import warnings
28- from abc import abstractmethod
2928from types import TracebackType # noqa # used in type hints
3029from typing import (
3130 TYPE_CHECKING ,
@@ -437,14 +436,18 @@ def async_update_records(self, zc: 'Zeroconf', now: float_, records: List[Record
437436 for type_ , name in self ._names_matching_types ((record .name ,)):
438437 self ._enqueue_callback (SERVICE_STATE_CHANGE_UPDATED , type_ , name )
439438
440- @abstractmethod
441439 def async_update_records_complete (self ) -> None :
442440 """Called when a record update has completed for all handlers.
443441
444442 At this point the cache will have the new records.
445443
446444 This method will be run in the event loop.
445+
446+ This method is expected to be overridden by subclasses.
447447 """
448+ for pending in self ._pending_handlers .items ():
449+ self ._fire_service_state_changed_event (pending )
450+ self ._pending_handlers .clear ()
448451
449452 def _fire_service_state_changed_event (self , event : Tuple [Tuple [str , str ], ServiceStateChange ]) -> None :
450453 """Fire a service state changed event.
@@ -454,7 +457,8 @@ def _fire_service_state_changed_event(self, event: Tuple[Tuple[str, str], Servic
454457
455458 When running with AsyncServiceBrowser, this will happen in the event loop.
456459 """
457- name_type , state_change = event
460+ name_type = event [0 ]
461+ state_change = event [1 ]
458462 self ._service_state_changed .fire (
459463 zeroconf = self .zc ,
460464 service_type = name_type [1 ],
0 commit comments