From c79edb5243c437c38e2fe025a625e7fe26149a8c Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 25 Apr 2020 21:43:08 +0100 Subject: docs(fun/idual): Document how to capture codes --- fun/idual/README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'fun') diff --git a/fun/idual/README.md b/fun/idual/README.md index b0ece099c34d..922047617f25 100644 --- a/fun/idual/README.md +++ b/fun/idual/README.md @@ -9,3 +9,26 @@ The supported colour codes of the iDual remote are stored in 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: + +```python +import broadlink +import base64 + +devices = broadlink.discover(timeout=5) +devices[0].auth() +``` + +For each code, the procedure is as follows: + +```python +devices[0].find_rf_packet() +# wait until this returns True + +devices[0].check_data() +# this will return the code +``` -- cgit 1.4.1