diff --git a/src/zeroconf/_protocol/outgoing.pxd b/src/zeroconf/_protocol/outgoing.pxd index 3460f0c74..4353757a0 100644 --- a/src/zeroconf/_protocol/outgoing.pxd +++ b/src/zeroconf/_protocol/outgoing.pxd @@ -127,16 +127,16 @@ cdef class DNSOutgoing: ) cpdef packets(self) - cpdef add_question_or_all_cache(self, DNSCache cache, object now, str name, object type_, object class_) + cpdef add_question_or_all_cache(self, DNSCache cache, double now, str name, object type_, object class_) - cpdef add_question_or_one_cache(self, DNSCache cache, object now, str name, object type_, object class_) + cpdef add_question_or_one_cache(self, DNSCache cache, double now, str name, object type_, object class_) cpdef add_question(self, DNSQuestion question) cpdef add_answer(self, DNSIncoming inp, DNSRecord record) @cython.locals(now_double=double) - cpdef add_answer_at_time(self, DNSRecord record, object now) + cpdef add_answer_at_time(self, DNSRecord record, double now) cpdef add_authorative_answer(self, DNSPointer record) diff --git a/src/zeroconf/_protocol/outgoing.py b/src/zeroconf/_protocol/outgoing.py index e94cd0d2d..57f981690 100644 --- a/src/zeroconf/_protocol/outgoing.py +++ b/src/zeroconf/_protocol/outgoing.py @@ -148,9 +148,9 @@ def add_question(self, record: DNSQuestion) -> None: def add_answer(self, inp: DNSIncoming, record: DNSRecord) -> None: """Adds an answer""" if not record.suppressed_by(inp): - self.add_answer_at_time(record, 0) + self.add_answer_at_time(record, 0.0) - def add_answer_at_time(self, record: Optional[DNSRecord], now: Union[float, int]) -> None: + def add_answer_at_time(self, record: Optional[DNSRecord], now: float_) -> None: """Adds an answer if it does not expire by a certain time""" now_double = now if record is not None and (now_double == 0 or not record.is_expired(now_double)):