@@ -777,12 +777,10 @@ def dns_text(self, override_ttl: Optional[int] = None, created: Optional[float]
777777
778778 def _get_address_records_from_cache (self , zc : 'Zeroconf' ) -> List [DNSRecord ]:
779779 """Get the address records from the cache."""
780- address_records = []
781- cached_a_record = zc .cache .get_by_details (self .server , _TYPE_A , _CLASS_IN )
782- if cached_a_record :
783- address_records .append (cached_a_record )
784- address_records .extend (zc .cache .get_all_by_details (self .server , _TYPE_AAAA , _CLASS_IN ))
785- return address_records
780+ return [
781+ * zc .cache .get_all_by_details (self .server , _TYPE_A , _CLASS_IN ),
782+ * zc .cache .get_all_by_details (self .server , _TYPE_AAAA , _CLASS_IN ),
783+ ]
786784
787785 def load_from_cache (self , zc : 'Zeroconf' ) -> bool :
788786 """Populate the service info from the cache."""
@@ -844,7 +842,7 @@ def generate_request_query(self, zc: 'Zeroconf', now: float) -> DNSOutgoing:
844842 out = DNSOutgoing (_FLAGS_QR_QUERY )
845843 out .add_question_or_one_cache (zc .cache , now , self .name , _TYPE_SRV , _CLASS_IN )
846844 out .add_question_or_one_cache (zc .cache , now , self .name , _TYPE_TXT , _CLASS_IN )
847- out .add_question_or_one_cache (zc .cache , now , self .server , _TYPE_A , _CLASS_IN )
845+ out .add_question_or_all_cache (zc .cache , now , self .server , _TYPE_A , _CLASS_IN )
848846 out .add_question_or_all_cache (zc .cache , now , self .server , _TYPE_AAAA , _CLASS_IN )
849847 return out
850848
0 commit comments