diff options
author | Matthew Garrett <mjg59@google.com> | 2019-05-18T07·10-0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-18T07·10-0700 |
commit | 3ad4a9f0f8b202863b6d33ff8a9f585ffacccf65 (patch) | |
tree | 6cc60fd6f17c725766d64c5f85078f68039f8cbb | |
parent | 2b4e6d91ff0643e1bfd9cf14360f60bb79ceb4a9 (diff) | |
parent | 0db317962348907096a29bb8d3b85c6c1d0ee35e (diff) |
Merge branch 'master' into rf_experiment_v0.9
-rw-r--r-- | broadlink/__init__.py | 6 | ||||
-rwxr-xr-x | cli/broadlink_cli | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/broadlink/__init__.py b/broadlink/__init__.py index 33bf5e8f879b..271a1860bfc9 100644 --- a/broadlink/__init__.py +++ b/broadlink/__init__.py @@ -26,6 +26,7 @@ def gendevice(devtype, host, mac): 0x2728, # SPMini2 0x2733, 0x273e, # OEM branded SPMini 0x7530, 0x7918, # OEM branded SPMini2 + 0x7D0D, # TMall OEM SPMini3 0x2736 # SPMiniPlus ], rm: [0x2712, # RM2 @@ -41,7 +42,8 @@ def gendevice(devtype, host, mac): 0x2797, # RM2 Pro Plus HYC 0x27a1, # RM2 Pro Plus R1 0x27a6, # RM2 Pro PP - 0x278f # RM Mini Shate + 0x278f, # RM Mini Shate + 0x27c2 # RM Mini 3 ], a1: [0x2714], # A1 mp1: [0x4EB5, # MP1 @@ -142,7 +144,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) diff --git a/cli/broadlink_cli b/cli/broadlink_cli index 989c6c118ba7..1c3e231d69e5 100755 --- a/cli/broadlink_cli +++ b/cli/broadlink_cli @@ -135,6 +135,7 @@ if args.learn: else ''.join(format(x, '02x') for x in bytearray(data)) if args.learn: print(learned) + print("Base64: " + base64.b64encode(learned.decode("hex"))) if args.learnfile: print("Saving to {}".format(args.learnfile)) with open(args.learnfile, "w") as text_file: |