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

adding base64 output (#239)

base64 output useful when working with Home-Assistant
This commit is contained in:
Bartosz Fenski 2019-05-18 09:07:25 +02:00 committed by Matthew Garrett
parent 77f11c8d49
commit 852cbc2473

View File

@ -134,6 +134,7 @@ if args.learn or args.learnfile:
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: