diff --git a/src/zeroconf/_services/registry.py b/src/zeroconf/_services/registry.py index 1f2f1d528..12051275e 100644 --- a/src/zeroconf/_services/registry.py +++ b/src/zeroconf/_services/registry.py @@ -25,6 +25,8 @@ from .._exceptions import ServiceNameAlreadyRegistered from .info import ServiceInfo +_str = str + class ServiceRegistry: """A registry to keep track of services. @@ -76,7 +78,7 @@ def async_get_infos_server(self, server: str) -> List[ServiceInfo]: """Return all ServiceInfo matching server.""" return self._async_get_by_index(self.servers, server) - def _async_get_by_index(self, records: Dict[str, List], key: str) -> List[ServiceInfo]: + def _async_get_by_index(self, records: Dict[str, List], key: _str) -> List[ServiceInfo]: """Return all ServiceInfo matching the index.""" record_list = records.get(key) if record_list is None: