Skip to content

Commit 6be2724

Browse files
authored
Merge pull request #321 from plugwise/impr-312
Catch error from #312
2 parents 405ec7e + e042352 commit 6be2724

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Ongoing
44

5+
- PR [321](https://github.com/plugwise/python-plugwise-usb/pull/321): Catch error reported in Issue [#312](https://github.com/plugwise/plugwise_usb-beta/issues/312)
56
- PR [319](https://github.com/plugwise/python-plugwise-usb/pull/319): Replace unclear warning message when a node is not online, also various small improvements suggested by CRAI.
67
- PR [312](https://github.com/plugwise/python-plugwise-usb/pull/312): properly propagate configuration changes and initialize to available on first node wakeup
78

plugwise_usb/helpers/util.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@
1313

1414
def validate_mac(mac: str) -> bool:
1515
"""Validate the supplied string is in a MAC address format."""
16-
if not re.match("^[A-F0-9]+$", mac):
16+
try:
17+
if not re.match("^[A-F0-9]+$", mac):
18+
return False
19+
except TypeError:
1720
return False
21+
1822
try:
1923
_ = int(mac, 16)
2024
except ValueError:

0 commit comments

Comments
 (0)