1
- -- Copyright 2025 SmartThings
2
- --
3
- -- Licensed under the Apache License, Version 2.0 (the "License");
4
- -- you may not use this file except in compliance with the License.
5
- -- You may obtain a copy of the License at
6
- --
7
- -- http://www.apache.org/licenses/LICENSE-2.0
8
- --
9
- -- Unless required by applicable law or agreed to in writing, software
10
- -- distributed under the License is distributed on an "AS IS" BASIS,
11
- -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- -- See the License for the specific language governing permissions and
13
- -- limitations under the License.
14
-
15
1
local capabilities = require " st.capabilities"
16
2
local clusters = require " st.matter.clusters"
17
3
local device_lib = require " st.device"
@@ -33,11 +19,10 @@ local CUBEACTION_TIMER = "__cubeAction_timer"
33
19
local CUBEACTION_TIME = 3
34
20
35
21
local function is_aqara_cube (opts , driver , device )
36
- if device . network_type == device_lib . NETWORK_TYPE_MATTER then
37
- local name = string.format ( " %s " , device . manufacturer_info . product_name )
38
- if string.find (name , " Aqara Cube T1 Pro" ) then
22
+ local name = string.format ( " %s " , device . manufacturer_info . product_name )
23
+ if device . network_type == device_lib . NETWORK_TYPE_MATTER and
24
+ string.find (name , " Aqara Cube T1 Pro" ) then
39
25
return true
40
- end
41
26
end
42
27
return false
43
28
end
@@ -201,12 +186,6 @@ local function info_changed(driver, device, event, args)
201
186
end
202
187
end
203
188
204
- -- override do_configure to prevent it running in the main driver
205
- local function do_configure (driver , device ) end
206
-
207
- -- override driver_switched to prevent it running in the main driver
208
- local function driver_switched (driver , device ) end
209
-
210
189
local function initial_press_event_handler (driver , device , ib , response )
211
190
if get_field_for_endpoint (device , INITIAL_PRESS_ONLY , ib .endpoint_id ) then
212
191
local map = device :get_field (COMPONENT_TO_ENDPOINT_MAP_BUTTON ) or {}
@@ -235,9 +214,7 @@ local aqara_cube_handler = {
235
214
lifecycle_handlers = {
236
215
init = device_init ,
237
216
added = device_added ,
238
- infoChanged = info_changed ,
239
- doConfigure = do_configure ,
240
- driverSwitched = driver_switched
217
+ infoChanged = info_changed
241
218
},
242
219
matter_handlers = {
243
220
attr = {
0 commit comments