chore: partially revert add get_percentage_remaining_ttl helper to DN… · python-zeroconf/python-zeroconf@a0b8aed · GitHub
Skip to content

Commit a0b8aed

Browse files
authored
chore: partially revert add get_percentage_remaining_ttl helper to DNSRecord (#1344)
1 parent 7a24b88 commit a0b8aed

3 files changed

Lines changed: 0 additions & 15 deletions

File tree

‎src/zeroconf/_dns.pxd‎

Lines changed: 0 additions & 2 deletions

‎src/zeroconf/_dns.py‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,6 @@ def get_expiration_time(self, percent: _int) -> float:
193193
by a certain percentage."""
194194
return self.created + (percent * self.ttl * 10)
195195

196-
def get_percentage_remaining_ttl(self, now: _float) -> _int:
197-
"""Returns the percentage remaining of the ttl between 0-100."""
198-
remain = (self.created + (_EXPIRE_FULL_TIME_MS * self.ttl) - now) / self.ttl / 10
199-
return 0 if remain <= 0 else round(remain)
200-
201196
# TODO: Switch to just int here
202197
def get_remaining_ttl(self, now: _float) -> Union[int, float]:
203198
"""Returns the remaining TTL in seconds."""

‎tests/test_dns.py‎

Lines changed: 0 additions & 8 deletions

0 commit comments

Comments
 (0)