docs(fun/idual): Document how to capture codes
This commit is contained in:
parent
6ee6966a2a
commit
c79edb5243
1 changed files with 23 additions and 0 deletions
|
@ -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
|
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.
|
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
|
||||||
|
```
|
||||||
|
|
Loading…
Reference in a new issue