@@ -152,58 +152,12 @@ local function device_added(driver, device)
152
152
device :refresh ()
153
153
end
154
154
155
- local function handle_switch_on (driver , device , cmd )
156
- device :send (OnOff .commands .On (device ))
157
-
158
- device .thread :call_with_delay (2 , function (d )
159
- device :refresh ()
160
- end )
161
- end
162
-
163
- local function handle_switch_off (driver , device , cmd )
164
- device :send (OnOff .commands .Off (device ))
165
-
166
- device .thread :call_with_delay (2 , function (d )
167
- device :refresh ()
168
- end )
169
- end
170
-
171
- local function handle_set_level (driver , device , cmd )
172
- local level = math.floor (cmd .args .level / 100.0 * 254 )
173
- device :send (Level .commands .MoveToLevelWithOnOff (device , level , cmd .args .rate or 0xFFFF ))
174
-
175
- device .thread :call_with_delay (2 , function (d )
176
- device :refresh ()
177
- end )
178
- end
179
-
180
- local function handle_set_color_temperature (driver , device , cmd )
181
- colorTemperature_defaults .set_color_temperature (driver , device , cmd )
182
-
183
- local function query_device ()
184
- device :refresh ()
185
- end
186
- device .thread :call_with_delay (2 , query_device )
187
- end
188
-
189
155
local zll_dimmer_bulb = {
190
156
NAME = " ZLL Dimmer Bulb" ,
191
157
lifecycle_handlers = {
192
158
doConfigure = do_configure ,
193
159
added = device_added
194
160
},
195
- capability_handlers = {
196
- [capabilities .switch .ID ] = {
197
- [capabilities .switch .commands .on .NAME ] = handle_switch_on ,
198
- [capabilities .switch .commands .off .NAME ] = handle_switch_off
199
- },
200
- [capabilities .switchLevel .ID ] = {
201
- [capabilities .switchLevel .commands .setLevel .NAME ] = handle_set_level
202
- },
203
- [capabilities .colorTemperature .ID ] = {
204
- [capabilities .colorTemperature .commands .setColorTemperature .NAME ] = handle_set_color_temperature
205
- }
206
- },
207
161
sub_drivers = {
208
162
require (" zll-dimmer-bulb/ikea-xy-color-bulb" )
209
163
},
0 commit comments