about summary refs log tree commit diff
path: root/fun
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-04-25T20·43+0100
committerVincent Ambo <tazjin@google.com>2020-04-25T20·43+0100
commitc79edb5243c437c38e2fe025a625e7fe26149a8c (patch)
treedc2a522e4d7250ed2bd3e3ed54f8c638f940adda /fun
parent6ee6966a2a218ac0d58decb38f4016bda3a165d8 (diff)
docs(fun/idual): Document how to capture codes r/683
Diffstat (limited to 'fun')
-rw-r--r--fun/idual/README.md23
1 files changed, 23 insertions, 0 deletions
diff --git a/fun/idual/README.md b/fun/idual/README.md
index b0ece099c3..922047617f 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
+```