-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
281ff3b
commit 5f3c067
Showing
4 changed files
with
16 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
|
||
setuptools.setup( | ||
name="tplinkrouterc6u", | ||
version="5.0.2", | ||
version="5.0.3", | ||
author="Alex Erohin", | ||
author_email="[email protected]", | ||
description="TP-Link Router API", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
from ipaddress import IPv4Address | ||
from macaddress import EUI48 | ||
|
||
|
||
def get_ip(ip: str) -> IPv4Address: | ||
try: | ||
return IPv4Address(ip) | ||
except Exception: | ||
return IPv4Address('0.0.0.0') | ||
|
||
|
||
def get_mac(mac: str) -> EUI48: | ||
try: | ||
return EUI48(mac) | ||
except Exception: | ||
return EUI48('00:00:00:00:00:00') |