You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the device is locked, it may not be discoverable with broadcast. In such cases, you can use the unicast version `broadlink.hello()` for direct discovery:
73
82
```python3
74
-
device = broadlink.hello('192.168.0.16')# IP address of your Broadlink device.
83
+
device = broadlink.hello('192.168.0.16')
75
84
```
76
85
77
86
If you are a perfomance freak, use `broadlink.xdiscover()` to create devices instantly:
2. When the LED blinks, point the remote at the Broadlink device for the first time and long press the button you want to learn.
116
-
3. Enter learning mode:
125
+
3. Check if the frequency was successfully identified:
126
+
```python3
127
+
ok = device.check_frequency()
128
+
if ok:
129
+
print('Frequency found!')
130
+
```
131
+
4. Enter learning mode:
117
132
```python3
118
133
device.find_rf_packet()
119
134
```
120
-
4. When the LED blinks, point the remote at the Broadlink device for the second time and short press the button you want to learn.
121
-
5. Get the RF packet:
135
+
5. When the LED blinks, point the remote at the Broadlink device for the second time and short press the button you want to learn.
136
+
6. Get the RF packet:
122
137
```python3
123
138
packet = device.check_data()
124
139
```
125
140
141
+
#### Notes
142
+
143
+
Universal remotes with product id 0x2712 use the same method for learning IR and RF codes. They don't need to sweep frequency. Just call `device.enter_learning()` and `device.check_data()`.
144
+
126
145
### Canceling learning
127
146
128
147
You can exit the learning mode in the middle of the process by calling this method:
0 commit comments