depot/third_party/tvl/fun/idual
Default email a291c8690a Project import generated by Copybara.
GitOrigin-RevId: e6e19f3d81a982a62e1bba08f0b4f7fdc21b4ea0
2022-05-19 16:39:52 +02:00
..
idual Project import generated by Copybara. 2020-09-29 23:42:59 -04:00
default.nix Project import generated by Copybara. 2022-05-19 16:39:52 +02:00
idualctl Project import generated by Copybara. 2020-09-29 23:42:59 -04:00
README.md Project import generated by Copybara. 2020-09-29 23:42:59 -04:00
setup.py Project import generated by Copybara. 2020-09-29 23:42:59 -04:00

iDual light control

This folder contains some tooling for controlling iDual LED lights (which use infrared controls) using a "Broadlink RM Pro" infrared controller.

The supported colour codes of the iDual remote are stored in codes.txt.

The point of this is to make it possible for me to automate my lights in the morning, so that I can actually get out of bed.

Capturing codes

Capturing codes is relatively easy, assuming that the broadlink device is set up:

import broadlink
import base64

devices = broadlink.discover(timeout=5)
devices[0].auth()

For each code, the procedure is as follows:

devices[0].find_rf_packet()
# wait until this returns True

devices[0].check_data()
# this will return the code