Skip to content

Commit 3d5742c

Browse files
committed
Testing fixes
1 parent 7455fa2 commit 3d5742c

File tree

8 files changed

+128
-0
lines changed

8 files changed

+128
-0
lines changed

drivers/SmartThings/matter-switch/src/test/test_electrical_sensor.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,14 @@ test.register_message_test(
238238
direction = "send",
239239
message = mock_device:generate_test_message("main", capabilities.powerMeter.power({value = 17.0, unit="W"}))
240240
},
241+
{
242+
channel = "devices",
243+
direction = "send",
244+
message = {
245+
"register_native_capability_attr_handler",
246+
{ device_uuid = mock_device.id, capability_id = "powerMeter", capability_attr_id = "power" }
247+
}
248+
}
241249
}
242250
)
243251

drivers/SmartThings/matter-thermostat/src/test/test_matter_water_heater.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,14 @@ test.register_message_test(
268268
channel = "capability",
269269
direction = "send",
270270
message = mock_device:generate_test_message("main", capabilities.powerMeter.power({ value = 15.0, unit = "W" }))
271+
},
272+
{
273+
channel = "devices",
274+
direction = "send",
275+
message = {
276+
"register_native_capability_attr_handler",
277+
{ device_uuid = mock_device.id, capability_id = "powerMeter", capability_attr_id = "power" }
278+
}
271279
}
272280
}
273281
)

drivers/SmartThings/zwave-sensor/src/test/test_fibaro_door_window_sensor_1.lua

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,14 @@ test.register_message_test(
255255
channel = "capability",
256256
direction = "send",
257257
message = mock_fibaro_door_window_sensor1:generate_test_message("main", capabilities.contactSensor.contact.open())
258+
},
259+
{
260+
channel = "devices",
261+
direction = "send",
262+
message = {
263+
"register_native_capability_attr_handler",
264+
{ device_uuid = mock_fibaro_door_window_sensor1.id, capability_id = "temperatureMeasurement", capability_attr_id = "temperature" }
265+
}
258266
}
259267
}
260268
)
@@ -271,6 +279,14 @@ test.register_message_test(
271279
channel = "capability",
272280
direction = "send",
273281
message = mock_fibaro_door_window_sensor1:generate_test_message("main", capabilities.contactSensor.contact.closed())
282+
},
283+
{
284+
channel = "devices",
285+
direction = "send",
286+
message = {
287+
"register_native_capability_attr_handler",
288+
{ device_uuid = mock_fibaro_door_window_sensor1.id, capability_id = "temperatureMeasurement", capability_attr_id = "temperature" }
289+
}
274290
}
275291
}
276292
)

drivers/SmartThings/zwave-sensor/src/test/test_fibaro_motion_sensor.lua

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,14 @@ test.register_message_test(
126126
channel = "capability",
127127
direction = "send",
128128
message = mock_device:generate_test_message("main", capabilities.motionSensor.motion.active())
129+
},
130+
{
131+
channel = "devices",
132+
direction = "send",
133+
message = {
134+
"register_native_capability_attr_handler",
135+
{ device_uuid = mock_device.id, capability_id = "switch", capability_attr_id = "switch" }
136+
}
129137
}
130138
}
131139
)
@@ -276,6 +284,14 @@ test.register_message_test(
276284
channel = "capability",
277285
direction = "send",
278286
message = mock_device:generate_test_message("main", capabilities.motionSensor.motion.active())
287+
},
288+
{
289+
channel = "devices",
290+
direction = "send",
291+
message = {
292+
"register_native_capability_attr_handler",
293+
{ device_uuid = mock_device.id, capability_id = "switch", capability_attr_id = "switch" }
294+
}
279295
}
280296
}
281297
)

drivers/SmartThings/zwave-sensor/src/test/test_generic_sensor.lua

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,14 @@ test.register_message_test(
378378
channel = "zwave",
379379
direction = "send",
380380
message = zw_test_utils.zwave_test_build_send_command(mock_device, Meter:Get({ scale = 2 }))
381+
},
382+
{
383+
channel = "devices",
384+
direction = "send",
385+
message = {
386+
"register_native_capability_attr_handler",
387+
{ device_uuid = mock_device.id, capability_id = "switch", capability_attr_id = "switch" }
388+
}
381389
}
382390
},
383391
{ inner_block_ordering = "relaxed" }
@@ -412,6 +420,14 @@ test.register_message_test(
412420
channel = "zwave",
413421
direction = "send",
414422
message = zw_test_utils.zwave_test_build_send_command(mock_device, Meter:Get({ scale = 2 }))
423+
},
424+
{
425+
channel = "devices",
426+
direction = "send",
427+
message = {
428+
"register_native_capability_attr_handler",
429+
{ device_uuid = mock_device.id, capability_id = "switch", capability_attr_id = "switch" }
430+
}
415431
}
416432
},
417433
{ inner_block_ordering = "relaxed" }

drivers/SmartThings/zwave-sensor/src/test/test_zwave_motion_light_sensor.lua

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,14 @@ test.register_message_test(
8282
channel = "capability",
8383
direction = "send",
8484
message = mock_device:generate_test_message("main", capabilities.motionSensor.motion.active())
85+
},
86+
{
87+
channel = "devices",
88+
direction = "send",
89+
message = {
90+
"register_native_capability_attr_handler",
91+
{ device_uuid = mock_device.id, capability_id = "switch", capability_attr_id = "switch" }
92+
}
8593
}
8694
}
8795
)
@@ -212,6 +220,14 @@ test.register_message_test(
212220
channel = "capability",
213221
direction = "send",
214222
message = mock_device:generate_test_message("main", capabilities.motionSensor.motion.active())
223+
},
224+
{
225+
channel = "devices",
226+
direction = "send",
227+
message = {
228+
"register_native_capability_attr_handler",
229+
{ device_uuid = mock_device.id, capability_id = "switch", capability_attr_id = "switch" }
230+
}
215231
}
216232
}
217233
)

drivers/SmartThings/zwave-sensor/src/test/test_zwave_motion_temp_light_sensor.lua

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ test.register_message_test(
7878
channel = "capability",
7979
direction = "send",
8080
message = mock_device:generate_test_message("main", capabilities.motionSensor.motion.active())
81+
},
82+
{
83+
channel = "devices",
84+
direction = "send",
85+
message = {
86+
"register_native_capability_attr_handler",
87+
{ device_uuid = mock_device.id, capability_id = "switch", capability_attr_id = "switch" }
88+
}
8189
}
8290
}
8391
)
@@ -189,6 +197,14 @@ test.register_message_test(
189197
channel = "capability",
190198
direction = "send",
191199
message = mock_device:generate_test_message("main", capabilities.motionSensor.motion.active())
200+
},
201+
{
202+
channel = "devices",
203+
direction = "send",
204+
message = {
205+
"register_native_capability_attr_handler",
206+
{ device_uuid = mock_device.id, capability_id = "switch", capability_attr_id = "switch" }
207+
}
192208
}
193209
}
194210
)

drivers/SmartThings/zwave-sensor/src/test/test_zwave_sensor.lua

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,14 @@ test.register_message_test(
267267
channel = "capability",
268268
direction = "send",
269269
message = mock_device:generate_test_message("main", capabilities.motionSensor.motion.active())
270+
},
271+
{
272+
channel = "devices",
273+
direction = "send",
274+
message = {
275+
"register_native_capability_attr_handler",
276+
{ device_uuid = mock_device.id, capability_id = "switch", capability_attr_id = "switch" }
277+
}
270278
}
271279
}
272280
)
@@ -609,6 +617,14 @@ test.register_message_test(
609617
channel = "capability",
610618
direction = "send",
611619
message = mock_motion_device:generate_test_message("main", capabilities.motionSensor.motion.active())
620+
},
621+
{
622+
channel = "devices",
623+
direction = "send",
624+
message = {
625+
"register_native_capability_attr_handler",
626+
{ device_uuid = mock_motion_device.id, capability_id = "switch", capability_attr_id = "switch" }
627+
}
612628
}
613629
}
614630
)
@@ -625,6 +641,14 @@ test.register_message_test(
625641
channel = "capability",
626642
direction = "send",
627643
message = mock_water_device:generate_test_message("main", capabilities.waterSensor.water.wet())
644+
},
645+
{
646+
channel = "devices",
647+
direction = "send",
648+
message = {
649+
"register_native_capability_attr_handler",
650+
{ device_uuid = mock_water_device.id, capability_id = "switch", capability_attr_id = "switch" }
651+
}
628652
}
629653
}
630654
)
@@ -641,6 +665,14 @@ test.register_message_test(
641665
channel = "capability",
642666
direction = "send",
643667
message = mock_contact_device:generate_test_message("main", capabilities.contactSensor.contact.open())
668+
},
669+
{
670+
channel = "devices",
671+
direction = "send",
672+
message = {
673+
"register_native_capability_attr_handler",
674+
{ device_uuid = mock_contact_device.id, capability_id = "switch", capability_attr_id = "switch" }
675+
}
644676
}
645677
}
646678
)

0 commit comments

Comments
 (0)