1
0
mirror of https://github.com/mjg59/python-broadlink.git synced 2024-11-13 03:00:11 +01:00

Allow string mac address in constructor

This commit is contained in:
gpenverne 2019-05-10 20:19:09 +02:00 committed by Matthew Garrett
parent 1d6d8d2aee
commit 77f11c8d49

View File

@ -143,7 +143,7 @@ def discover(timeout=None, local_ip_address=None):
class device:
def __init__(self, host, mac, devtype, timeout=10):
self.host = host
self.mac = mac
self.mac = mac.encode() if isinstance(mac, str) else mac
self.devtype = devtype
self.timeout = timeout
self.count = random.randrange(0xffff)