tvl-depot/fun/idual
Vincent Ambo e7aaa0bc2f feat(fun/idual): Move colour codes into a Python script
This will make them easier to consume for the thing I'm actually
trying to do here.
2020-04-25 22:17:14 +01:00
..
default.nix feat(fun/idual): Move colour codes into a Python script 2020-04-25 22:17:14 +01:00
idual.py feat(fun/idual): Move colour codes into a Python script 2020-04-25 22:17:14 +01:00
README.md docs(fun/idual): Document how to capture codes 2020-04-25 21:43:08 +01:00
setup.py feat(fun/idual): Move colour codes into a Python script 2020-04-25 22:17:14 +01: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