diff --git a/box/arch/packages.sh b/box/arch/packages.sh index 89d9e05e..e14d067e 100755 --- a/box/arch/packages.sh +++ b/box/arch/packages.sh @@ -246,6 +246,7 @@ PYTHON_PACKAGES=( bleak i3ipc pypdf2 + tinytuya spotdl ) diff --git a/home/bin/broadlink-led-strip b/home/bin/broadlink-led-strip new file mode 100755 index 00000000..98bf9258 --- /dev/null +++ b/home/bin/broadlink-led-strip @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 + +import json +import tinytuya + +d = tinytuya.OutletDevice('eb9545a932ce1beac40asy', '192.168.50.198', 'b45884877dde61df') +d.set_version(3.3) +# data = d.status() + +off = "1bSOkETICMwIyAjMCUAIzAjICMwJRAhQCUAIzAlICEgJTAjICMwKVBjMClgYzApYGMwKXBjICEgJSApcGUgJ5BjAClwZSAvQBUQKXBjMCEwJwAhQCcgLzAVECEgJzAhICcQL0AVECmAZQAvQBcQJ4BlECeAZRAncGUgJ4BlECWQZyAlYGUgKVoIMjqghRAjB1" +on = "1eyOEEXECEwJxAvQBcQL0AZAC8wFxAvQBUgITAnACEwJxAvQBcQJ3BlICeAZRAlkGUQJ4BlICEwJRAngGUQJ4BlICdwYyApcGMgKXBjMCEwJRAjMCUQITAlICEwJRAjMCUQITAlICEwJxAhMCUQJ4BlICdwZSAncGMwKWBjMClgYzApcGMgK1oGQjyQgyAjB1" + +# The IR Commands JSON has the following format: +command = { + "control": "send_ir", + "head": "", + "key1": on, + "type": 0, + "delay": 300, +} +# Sending the IR command: +payload = d.generate_payload(tinytuya.CONTROL, {"201": json.dumps(command)}) +print(payload) +d.send(payload) + +# print('Device status: %r' % data)