Skip to content

Commit

Permalink
short circuit renew_address() when called from the master node
Browse files Browse the repository at this point in the history
  • Loading branch information
2bndy5 committed Jun 29, 2024
1 parent d0c0172 commit 007e885
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions circuitpython_nrf24l01/rf24_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,11 @@ def __init__(
#: A `dict` that enables master nodes to act as a DNS.
self.dhcp_dict: Dict[int, int] = {}

def renew_address(self, timeout: float | int = 7.5):
if not self._id:
return 0
return super().renew_address(timeout)

Check warning on line 327 in circuitpython_nrf24l01/rf24_mesh.py

View check run for this annotation

Codecov / codecov/patch

circuitpython_nrf24l01/rf24_mesh.py#L325-L327

Added lines #L325 - L327 were not covered by tests

def update(self) -> int:
"""Checks for incoming network data and returns last message type (if any)"""
msg_t = super().update()
Expand Down

0 comments on commit 007e885

Please sign in to comment.