Skip to content

Commit

Permalink
📦 arch: tintuya pkg + base script
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianmiranda committed Jun 7, 2024
1 parent ce6cc2a commit d0593e8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions box/arch/packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ PYTHON_PACKAGES=(
bleak
i3ipc
pypdf2
tinytuya
spotdl
)

Expand Down
26 changes: 26 additions & 0 deletions home/bin/broadlink-led-strip
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit d0593e8

Please sign in to comment.