Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
bdragon300 committed Nov 3, 2024
1 parent 5a254de commit 25e55f0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pyzkaccess/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,13 @@ def change_ip(self, mac_address: str, new_ip: str, *, broadcast_address: str = "
broadcast_address: broadcast network address to send
broadcast packets to. Default: 255.255.255.255
"""
ZKAccess.change_ip(self._parse_mac(mac_address), self._parse_ip(new_ip), self._parse_ip(broadcast_address), ChangeIPProtocol.udp, self._dllpath)
ZKAccess.change_ip(
self._parse_mac(mac_address),
self._parse_ip(new_ip),
self._parse_ip(broadcast_address),
ChangeIPProtocol.udp,
self._dllpath,
)

@staticmethod
def _parse_ip(value: Any) -> str:
Expand All @@ -1253,7 +1259,7 @@ def _parse_ip(value: Any) -> str:
@staticmethod
def _parse_mac(value: Any) -> str:
if not isinstance(value, str):
raise ValueError("Bad MAC address")
raise FireError("Bad MAC address")

if not re.match(r"^[0-9a-fA-F]{2}([:-]?[0-9a-fA-F]{2}){5}$", value):
raise FireError(f"Bad MAC address '{value}'")
Expand Down

0 comments on commit 25e55f0

Please sign in to comment.