diff --git a/.github/workflows/jenkins-driver-tests.yml b/.github/workflows/jenkins-driver-tests.yml index aff7f6f150..6af62c080e 100644 --- a/.github/workflows/jenkins-driver-tests.yml +++ b/.github/workflows/jenkins-driver-tests.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: version: - [ 59, 60, 61, dev] + [57, 58, 59, 60, 61, dev] runs-on: ubuntu-latest steps: diff --git a/drivers/Aqara/aqara-presence-sensor/src/lunchbox/sse/eventsource.lua b/drivers/Aqara/aqara-presence-sensor/src/lunchbox/sse/eventsource.lua index 7c72f2d81a..9b64844821 100644 --- a/drivers/Aqara/aqara-presence-sensor/src/lunchbox/sse/eventsource.lua +++ b/drivers/Aqara/aqara-presence-sensor/src/lunchbox/sse/eventsource.lua @@ -365,18 +365,26 @@ local function open_action(source) local recv_as_num = tonumber(recv, 16) if recv_as_num ~= nil then - recv, err, partial = source._sock:receive(recv_as_num) - if err then - if err == "timeout" or err == "wantread" then - return - else - --- real error, close the connection. - if source._sock ~= nil then - source._sock:close() - source._sock = nil + -- A chunk size of 0 signals the end of the chunked transfer. Some + -- versions of the underlying socket library will raise a hard error + -- (rather than returning a graceful nil/"closed" pair) if we ask to + -- receive 0 bytes, so avoid calling receive() in that case entirely. + if recv_as_num == 0 then + recv = "" + else + recv, err, partial = source._sock:receive(recv_as_num) + if err then + if err == "timeout" or err == "wantread" then + return + else + --- real error, close the connection. + if source._sock ~= nil then + source._sock:close() + source._sock = nil + end + source.ready_state = EventSource.ReadyStates.CLOSED + return nil, err, partial end - source.ready_state = EventSource.ReadyStates.CLOSED - return nil, err, partial end end local _, err, partial = source._sock:receive('*l') -- clear the final line diff --git a/drivers/SmartThings/jbl/src/init.lua b/drivers/SmartThings/jbl/src/init.lua index f422ecf84c..830a98a181 100644 --- a/drivers/SmartThings/jbl/src/init.lua +++ b/drivers/SmartThings/jbl/src/init.lua @@ -82,6 +82,11 @@ local function update_connection(driver, device, device_ip, device_info) local conn_info = driver.discovery_helper.get_connection_info(driver, device_dni, device_ip, device_info) local credential = device:get_field(fields.CREDENTIAL) + if not credential then + log.error("update_connection : failed to find credential, dni = " .. tostring(device_dni)) + device:offline() + return + end conn_info:add_header(CREDENTIAL_KEY_HEADER, credential) diff --git a/drivers/SmartThings/jbl/src/jbl/api.lua b/drivers/SmartThings/jbl/src/jbl/api.lua index 95e25d14c3..7479289549 100644 --- a/drivers/SmartThings/jbl/src/jbl/api.lua +++ b/drivers/SmartThings/jbl/src/jbl/api.lua @@ -77,7 +77,7 @@ function jbl_api.new_device_manager(bridge_ip, bridge_info, socket_builder) end function jbl_api:add_header(key, value) - log.info("add_header : " .. key .. ", " .. value) + log.info("add_header : " .. tostring(key) .. ", " .. tostring(value)) self.headers[key] = value end diff --git a/drivers/SmartThings/matter-appliance/src/test/test_cook_top.lua b/drivers/SmartThings/matter-appliance/src/test/test_cook_top.lua index 0321d956ce..4c489ee38d 100644 --- a/drivers/SmartThings/matter-appliance/src/test/test_cook_top.lua +++ b/drivers/SmartThings/matter-appliance/src/test/test_cook_top.lua @@ -91,7 +91,7 @@ test.register_coroutine_test( assert(component_to_endpoint_map["cookSurfaceTwo"] == COOK_SURFACE_TWO_ENDPOINT, "Cook Surface Two Endpoint must be 3") end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -117,7 +117,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -157,7 +157,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -192,7 +192,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-appliance/src/test/test_dishwasher.lua b/drivers/SmartThings/matter-appliance/src/test/test_dishwasher.lua index 6819815506..93b6bbc3f3 100644 --- a/drivers/SmartThings/matter-appliance/src/test/test_dishwasher.lua +++ b/drivers/SmartThings/matter-appliance/src/test/test_dishwasher.lua @@ -103,7 +103,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -171,7 +171,7 @@ test.register_message_test( }, -- on receiving NO ERROR we don't do anything. }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -239,7 +239,7 @@ test.register_message_test( }, -- on receiving NO ERROR we don't do anything. }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -307,7 +307,7 @@ test.register_message_test( }, -- on receiving NO ERROR we don't do anything. }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -386,7 +386,7 @@ test.register_message_test( }, -- on receiving NO ERROR we don't do anything. }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -450,7 +450,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -490,7 +490,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -549,7 +549,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-appliance/src/test/test_extractor_hood.lua b/drivers/SmartThings/matter-appliance/src/test/test_extractor_hood.lua index d176352f80..f326ba50b8 100644 --- a/drivers/SmartThings/matter-appliance/src/test/test_extractor_hood.lua +++ b/drivers/SmartThings/matter-appliance/src/test/test_extractor_hood.lua @@ -176,7 +176,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -250,7 +250,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -339,7 +339,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) test.register_message_test( @@ -452,7 +452,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -490,7 +490,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -531,7 +531,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -592,7 +592,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -653,7 +653,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -666,7 +666,7 @@ test.register_coroutine_test( end, { test_init = test_init_onoff, - min_api_version = 17 + min_api_version = 15 } ) @@ -692,7 +692,7 @@ test.register_coroutine_test( end, { test_init = test_init_onoff, - min_api_version = 17 + min_api_version = 15 } ) @@ -716,7 +716,7 @@ test.register_coroutine_test( end, { test_init = test_init_onoff, - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-appliance/src/test/test_laundry_dryer.lua b/drivers/SmartThings/matter-appliance/src/test/test_laundry_dryer.lua index ba1440af85..d942817d57 100644 --- a/drivers/SmartThings/matter-appliance/src/test/test_laundry_dryer.lua +++ b/drivers/SmartThings/matter-appliance/src/test/test_laundry_dryer.lua @@ -102,7 +102,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -170,7 +170,7 @@ test.register_message_test( }, -- on receiving NO ERROR we don't do anything. }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -238,7 +238,7 @@ test.register_message_test( }, -- on receiving NO ERROR we don't do anything. }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -306,7 +306,7 @@ test.register_message_test( }, -- on receiving NO ERROR we don't do anything. }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -385,7 +385,7 @@ test.register_message_test( }, -- on receiving NO ERROR we don't do anything. }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -449,7 +449,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -489,7 +489,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -548,7 +548,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -591,7 +591,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-appliance/src/test/test_laundry_washer.lua b/drivers/SmartThings/matter-appliance/src/test/test_laundry_washer.lua index 6aba845a27..288d76778e 100644 --- a/drivers/SmartThings/matter-appliance/src/test/test_laundry_washer.lua +++ b/drivers/SmartThings/matter-appliance/src/test/test_laundry_washer.lua @@ -135,7 +135,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -178,7 +178,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-appliance/src/test/test_matter_appliance_rpc_5.lua b/drivers/SmartThings/matter-appliance/src/test/test_matter_appliance_rpc_5.lua index 7e59d7925f..cc270cdddb 100644 --- a/drivers/SmartThings/matter-appliance/src/test/test_matter_appliance_rpc_5.lua +++ b/drivers/SmartThings/matter-appliance/src/test/test_matter_appliance_rpc_5.lua @@ -458,7 +458,7 @@ test.register_coroutine_test( end, { test_init = test_init_dishwasher, - min_api_version = 17 + min_api_version = 15 } ) @@ -500,7 +500,7 @@ test.register_coroutine_test( end, { test_init = test_init_dishwasher, - min_api_version = 17 + min_api_version = 15 } ) @@ -542,7 +542,7 @@ test.register_coroutine_test( end, { test_init = test_init_washer, - min_api_version = 17 + min_api_version = 15 } ) @@ -584,7 +584,7 @@ test.register_coroutine_test( end, { test_init = test_init_washer, - min_api_version = 17 + min_api_version = 15 } ) @@ -626,7 +626,7 @@ test.register_coroutine_test( end, { test_init = test_init_dryer, - min_api_version = 17 + min_api_version = 15 } ) @@ -668,7 +668,7 @@ test.register_coroutine_test( end, { test_init = test_init_dryer, - min_api_version = 17 + min_api_version = 15 } ) @@ -710,7 +710,7 @@ test.register_coroutine_test( end, { test_init = test_init_oven, - min_api_version = 17 + min_api_version = 15 } ) @@ -752,7 +752,7 @@ test.register_coroutine_test( end, { test_init = test_init_oven, - min_api_version = 17 + min_api_version = 15 } ) @@ -794,7 +794,7 @@ test.register_coroutine_test( end, { test_init = test_init_refrigerator, - min_api_version = 17 + min_api_version = 15 } ) @@ -836,7 +836,7 @@ test.register_coroutine_test( end, { test_init = test_init_refrigerator, - min_api_version = 17 + min_api_version = 15 } ) @@ -878,7 +878,7 @@ test.register_coroutine_test( end, { test_init = test_init_refrigerator, - min_api_version = 17 + min_api_version = 15 } ) @@ -920,7 +920,7 @@ test.register_coroutine_test( end, { test_init = test_init_refrigerator, - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-appliance/src/test/test_microwave_oven.lua b/drivers/SmartThings/matter-appliance/src/test/test_microwave_oven.lua index cf69721714..b6c5f3091d 100644 --- a/drivers/SmartThings/matter-appliance/src/test/test_microwave_oven.lua +++ b/drivers/SmartThings/matter-appliance/src/test/test_microwave_oven.lua @@ -174,7 +174,7 @@ test.register_message_test( }, -- on receiving NO ERROR we don't do anything. }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -258,7 +258,7 @@ test.register_message_test( test_init() init_supported_microwave_oven_modes() end, - min_api_version = 17 + min_api_version = 15 } ) @@ -338,7 +338,7 @@ test.register_message_test( }, -- on receiving NO ERROR we don't do anything. }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -453,7 +453,7 @@ test.register_message_test( }, -- on receiving NO ERROR we don't do anything. }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -479,7 +479,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-appliance/src/test/test_oven.lua b/drivers/SmartThings/matter-appliance/src/test/test_oven.lua index 905f34d666..737f67de12 100644 --- a/drivers/SmartThings/matter-appliance/src/test/test_oven.lua +++ b/drivers/SmartThings/matter-appliance/src/test/test_oven.lua @@ -143,7 +143,7 @@ test.register_coroutine_test( "Cook Surface Two Endpoint must be 6") end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -228,7 +228,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -287,7 +287,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -371,7 +371,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -411,7 +411,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -437,7 +437,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -475,7 +475,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -513,7 +513,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -535,7 +535,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -557,7 +557,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-appliance/src/test/test_refrigerator.lua b/drivers/SmartThings/matter-appliance/src/test/test_refrigerator.lua index 1210819d51..6fce3a45fb 100644 --- a/drivers/SmartThings/matter-appliance/src/test/test_refrigerator.lua +++ b/drivers/SmartThings/matter-appliance/src/test/test_refrigerator.lua @@ -147,7 +147,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -206,7 +206,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -249,7 +249,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -308,7 +308,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -351,7 +351,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-button/src/test/test_matter_button.lua b/drivers/SmartThings/matter-button/src/test/test_matter_button.lua index dfc32bc7cb..98b46650f0 100644 --- a/drivers/SmartThings/matter-button/src/test/test_matter_button.lua +++ b/drivers/SmartThings/matter-button/src/test/test_matter_button.lua @@ -71,7 +71,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -109,7 +109,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -148,7 +148,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -196,7 +196,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -220,7 +220,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -244,7 +244,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -268,7 +268,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -308,7 +308,7 @@ test.register_message_test( }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -348,7 +348,7 @@ test.register_message_test( }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -373,7 +373,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) -- run the tests diff --git a/drivers/SmartThings/matter-button/src/test/test_matter_button_parent_child.lua b/drivers/SmartThings/matter-button/src/test/test_matter_button_parent_child.lua index 01d3b103c7..a8e1ecd69f 100644 --- a/drivers/SmartThings/matter-button/src/test/test_matter_button_parent_child.lua +++ b/drivers/SmartThings/matter-button/src/test/test_matter_button_parent_child.lua @@ -136,7 +136,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -170,7 +170,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -213,7 +213,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -237,7 +237,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -261,7 +261,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -295,7 +295,7 @@ test.register_message_test( }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -329,7 +329,7 @@ test.register_message_test( }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -354,7 +354,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) -- run the tests diff --git a/drivers/SmartThings/matter-button/src/test/test_matter_multi_button.lua b/drivers/SmartThings/matter-button/src/test/test_matter_multi_button.lua index 91f3a06494..9158f8c6cd 100644 --- a/drivers/SmartThings/matter-button/src/test/test_matter_multi_button.lua +++ b/drivers/SmartThings/matter-button/src/test/test_matter_multi_button.lua @@ -136,7 +136,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -169,7 +169,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -194,7 +194,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("button2", button_attr.held({state_change = true}))) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -219,7 +219,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("button3", button_attr.pushed({state_change = true}))) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -243,7 +243,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -283,7 +283,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("button4", button_attr.double({state_change = true}))) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -311,7 +311,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -339,7 +339,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -377,7 +377,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -416,7 +416,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -464,7 +464,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -488,7 +488,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -512,7 +512,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -536,7 +536,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -576,7 +576,7 @@ test.register_message_test( }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -616,7 +616,7 @@ test.register_message_test( }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -641,7 +641,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -686,7 +686,7 @@ test.register_message_test( -- no double event }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -744,7 +744,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) -- run the tests diff --git a/drivers/SmartThings/matter-energy/src/test/test_battery_storage.lua b/drivers/SmartThings/matter-energy/src/test/test_battery_storage.lua index 329daa6bd7..4c899a2042 100644 --- a/drivers/SmartThings/matter-energy/src/test/test_battery_storage.lua +++ b/drivers/SmartThings/matter-energy/src/test/test_battery_storage.lua @@ -104,7 +104,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) test.register_coroutine_test( @@ -162,7 +162,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -179,7 +179,7 @@ test.register_coroutine_test( capabilities.powerMeter.power({ value = 30.0, unit = "W" }))) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -196,7 +196,7 @@ test.register_coroutine_test( capabilities.powerMeter.power({ value = 30.0, unit = "W" }))) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -301,7 +301,7 @@ test.register_coroutine_test( test_init = function() test_init() end, - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-energy/src/test/test_evse.lua b/drivers/SmartThings/matter-energy/src/test/test_evse.lua index 5614b0be18..d1b9c92324 100644 --- a/drivers/SmartThings/matter-energy/src/test/test_evse.lua +++ b/drivers/SmartThings/matter-energy/src/test/test_evse.lua @@ -120,7 +120,7 @@ test.register_coroutine_test( "Device Energy Management Endpoint must be 3") end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -150,7 +150,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -201,7 +201,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -225,7 +225,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -248,7 +248,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -271,7 +271,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -294,7 +294,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -317,7 +317,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -340,7 +340,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -364,7 +364,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -438,7 +438,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -541,7 +541,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-energy/src/test/test_evse_energy_meas.lua b/drivers/SmartThings/matter-energy/src/test/test_evse_energy_meas.lua index f3b3b6c700..bf56269261 100644 --- a/drivers/SmartThings/matter-energy/src/test/test_evse_energy_meas.lua +++ b/drivers/SmartThings/matter-energy/src/test/test_evse_energy_meas.lua @@ -118,7 +118,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -152,7 +152,7 @@ test.register_coroutine_test( test_init = function() test_init() end, - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-energy/src/test/test_solar_power.lua b/drivers/SmartThings/matter-energy/src/test/test_solar_power.lua index 8e4e3c4e9a..f69f034a86 100644 --- a/drivers/SmartThings/matter-energy/src/test/test_solar_power.lua +++ b/drivers/SmartThings/matter-energy/src/test/test_solar_power.lua @@ -124,7 +124,7 @@ test.register_coroutine_test( capabilities.powerMeter.power({ value = 35.0, unit = "W" }))) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -172,7 +172,7 @@ test.register_coroutine_test( test_init = function() test_init() end, - min_api_version = 17 + min_api_version = 15 } ) @@ -197,7 +197,7 @@ test.register_coroutine_test( clusters.ElectricalEnergyMeasurement.types.EnergyMeasurementStruct({ energy = 100000, start_timestamp = 0, end_timestamp = 0, start_systime = 0, end_systime = 0, apparent_energy = 0, reactive_energy = 0 })) }) --100Wh end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-hrap/src/test/test_thread_border_router_network.lua b/drivers/SmartThings/matter-hrap/src/test/test_thread_border_router_network.lua index af8315375f..4c894b7bdb 100644 --- a/drivers/SmartThings/matter-hrap/src/test/test_thread_border_router_network.lua +++ b/drivers/SmartThings/matter-hrap/src/test/test_thread_border_router_network.lua @@ -108,7 +108,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -143,7 +143,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -191,7 +191,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -213,7 +213,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -230,7 +230,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -247,7 +247,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -356,7 +356,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/matter-lock/src/init.lua b/drivers/SmartThings/matter-lock/src/init.lua index 5d82801b67..f94702c496 100755 --- a/drivers/SmartThings/matter-lock/src/init.lua +++ b/drivers/SmartThings/matter-lock/src/init.lua @@ -436,10 +436,10 @@ local function lock_state_handler(driver, device, ib, response) -- In this case, two events occur. To prevent this, when both functions are called, -- it send the event after 1 second so that no event occurs in the lock_state_handler. device.thread:call_with_delay(1, function () - if ib.data.value ~= nil then + if ib.data.value ~= nil and LOCK_STATE[ib.data.value] ~= nil then device:emit_event(LOCK_STATE[ib.data.value]) else - device.log.warn("Lock State is nil") + device.log.warn(string.format("Received unknown Lock State: %s", ib.data.value)) end end) end diff --git a/drivers/SmartThings/matter-lock/src/test/test_aqara_matter_lock.lua b/drivers/SmartThings/matter-lock/src/test/test_aqara_matter_lock.lua index 57d7e2b71e..7c6bc2e783 100644 --- a/drivers/SmartThings/matter-lock/src/test/test_aqara_matter_lock.lua +++ b/drivers/SmartThings/matter-lock/src/test/test_aqara_matter_lock.lua @@ -95,7 +95,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -119,7 +119,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -141,7 +141,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -163,7 +163,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -185,7 +185,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -211,7 +211,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -310,7 +310,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -327,7 +327,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/matter-lock/src/test/test_bridged_matter_lock.lua b/drivers/SmartThings/matter-lock/src/test/test_bridged_matter_lock.lua index 2f3566eb6c..0ce5d58404 100644 --- a/drivers/SmartThings/matter-lock/src/test/test_bridged_matter_lock.lua +++ b/drivers/SmartThings/matter-lock/src/test/test_bridged_matter_lock.lua @@ -91,7 +91,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -102,7 +102,7 @@ test.register_coroutine_test( mock_device_level:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-lock/src/test/test_matter_lock.lua b/drivers/SmartThings/matter-lock/src/test/test_matter_lock.lua index 58185f2ec8..580bd34420 100644 --- a/drivers/SmartThings/matter-lock/src/test/test_matter_lock.lua +++ b/drivers/SmartThings/matter-lock/src/test/test_matter_lock.lua @@ -70,7 +70,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -94,7 +94,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -117,7 +117,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -140,7 +140,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -163,7 +163,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -186,7 +186,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -209,7 +209,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -234,7 +234,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -261,7 +261,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -330,7 +330,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -370,7 +370,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -385,7 +385,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-lock/src/test/test_matter_lock_battery.lua b/drivers/SmartThings/matter-lock/src/test/test_matter_lock_battery.lua index e43e075baf..9113374514 100644 --- a/drivers/SmartThings/matter-lock/src/test/test_matter_lock_battery.lua +++ b/drivers/SmartThings/matter-lock/src/test/test_matter_lock_battery.lua @@ -117,7 +117,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ profile = "base-lock" }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -145,7 +145,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ profile = "base-lock-batteryLevel" }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -155,7 +155,7 @@ test.register_coroutine_test( end, { test_init = test_init_no_battery, - min_api_version = 17 + min_api_version = 15 } ) test.run_registered_tests() diff --git a/drivers/SmartThings/matter-lock/src/test/test_matter_lock_batteryLevel.lua b/drivers/SmartThings/matter-lock/src/test/test_matter_lock_batteryLevel.lua index f1b3c2f182..8995332812 100644 --- a/drivers/SmartThings/matter-lock/src/test/test_matter_lock_batteryLevel.lua +++ b/drivers/SmartThings/matter-lock/src/test/test_matter_lock_batteryLevel.lua @@ -95,7 +95,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-lock/src/test/test_matter_lock_codes.lua b/drivers/SmartThings/matter-lock/src/test/test_matter_lock_codes.lua index c2e86aae29..4ccc4d135b 100644 --- a/drivers/SmartThings/matter-lock/src/test/test_matter_lock_codes.lua +++ b/drivers/SmartThings/matter-lock/src/test/test_matter_lock_codes.lua @@ -223,7 +223,7 @@ test.register_coroutine_test( expect_reload_all_codes_messages(mock_device) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -239,7 +239,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -263,7 +263,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -287,7 +287,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -311,7 +311,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -333,7 +333,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -358,7 +358,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -373,7 +373,7 @@ test.register_coroutine_test( expect_reload_all_codes_messages(mock_device) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -418,7 +418,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -456,7 +456,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -562,7 +562,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -611,7 +611,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -671,7 +671,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -706,7 +706,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) test.register_coroutine_test( @@ -740,7 +740,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -782,7 +782,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -825,7 +825,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -904,7 +904,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -971,7 +971,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 15 } ) test.run_registered_tests() diff --git a/drivers/SmartThings/matter-lock/src/test/test_matter_lock_cota.lua b/drivers/SmartThings/matter-lock/src/test/test_matter_lock_cota.lua index 39066776f9..9e39655943 100644 --- a/drivers/SmartThings/matter-lock/src/test/test_matter_lock_cota.lua +++ b/drivers/SmartThings/matter-lock/src/test/test_matter_lock_cota.lua @@ -143,7 +143,7 @@ test.register_coroutine_test( expect_kick_off_cota_process(mock_device) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -160,7 +160,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -177,7 +177,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -212,7 +212,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -236,7 +236,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -338,7 +338,7 @@ test.register_coroutine_test( test.socket.matter:__expect_send({mock_device.id, read_attribute_list}) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -436,7 +436,7 @@ test.register_coroutine_test( test.socket.matter:__expect_send({mock_device.id, read_attribute_list}) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -527,7 +527,7 @@ test.register_coroutine_test( test.socket.matter:__expect_send({mock_device.id, read_attribute_list}) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -587,7 +587,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -627,7 +627,7 @@ test.register_coroutine_test( test.mock_time.advance_time(2) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -708,7 +708,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -743,7 +743,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -751,7 +751,7 @@ test.register_coroutine_test( "Delay setting COTA cred if another cred is already being set.", function() end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-lock/src/test/test_matter_lock_migration.lua b/drivers/SmartThings/matter-lock/src/test/test_matter_lock_migration.lua index b94b31e105..8e1f731599 100644 --- a/drivers/SmartThings/matter-lock/src/test/test_matter_lock_migration.lua +++ b/drivers/SmartThings/matter-lock/src/test/test_matter_lock_migration.lua @@ -1,143 +1,143 @@ --- Copyright 2026 SmartThings, Inc. --- Licensed under the Apache License, Version 2.0 - -local test = require "integration_test" -local capabilities = require "st.capabilities" -local t_utils = require "integration_test.utils" -local clusters = require "st.matter.clusters" -local DoorLock = clusters.DoorLock -local lock_utils = require "lock_utils" - -local mock_device = test.mock_device.build_test_matter_device({ - profile = t_utils.get_profile_definition("base-lock.yml"), - manufacturer_info = { - vendor_id = 0x135D, - product_id = 0x00C1, - }, - endpoints = { - { - endpoint_id = 0, - clusters = { - { cluster_id = clusters.BasicInformation.ID, cluster_type = "SERVER" }, - }, - device_types = { - { device_type_id = 0x0016, device_type_revision = 1 } -- RootNode - } - }, - { - endpoint_id = 1, - clusters = { - { - cluster_id = DoorLock.ID, - cluster_type = "SERVER", - cluster_revision = 1, - feature_map = 0x0101, -- PIN & USR - } - }, - device_types = { - { device_type_id = 0x000A, device_type_revision = 1 } -- Door Lock - } - } - } -}) - -local function test_init() - test.disable_startup_messages() - test.mock_device.add_test_device(mock_device) - -- mock_device:set_field(lock_utils.LOCK_CODES_FOR_MIGRATION, { {1, "ST Remote Operation Code"}, {2, "Guest1"}, {3, "Guest2"} }, {persist=true}) -end - -test.set_test_init_function(test_init) - -local subscribe_request = DoorLock.attributes.LockState:subscribe(mock_device) -subscribe_request:merge(DoorLock.attributes.OperatingMode:subscribe(mock_device)) -subscribe_request:merge(DoorLock.attributes.NumberOfTotalUsersSupported:subscribe(mock_device)) -subscribe_request:merge(DoorLock.attributes.NumberOfPINUsersSupported:subscribe(mock_device)) -subscribe_request:merge(DoorLock.attributes.MaxPINCodeLength:subscribe(mock_device)) -subscribe_request:merge(DoorLock.attributes.MinPINCodeLength:subscribe(mock_device)) -subscribe_request:merge(DoorLock.attributes.RequirePINforRemoteOperation:subscribe(mock_device)) -subscribe_request:merge(DoorLock.events.LockOperation:subscribe(mock_device)) -subscribe_request:merge(DoorLock.events.DoorLockAlarm:subscribe(mock_device)) -subscribe_request:merge(DoorLock.events.LockUserChange:subscribe(mock_device)) - -local enabled_optional_component_capability_pairs = {{ - "main", - { - capabilities.lockUsers.ID, - capabilities.lockCredentials.ID, - capabilities.battery.ID, - } -}} - -test.register_coroutine_test( - "Migration completed and User and Credential values restored", - function() - test.wait_for_events() - test.socket.capability:__queue_receive( - { - mock_device.id, - {capability = capabilities.lockCodes.ID, command = "migrate", args = {}} - } - ) - test.socket.capability:__expect_send( - mock_device:generate_test_message("main", capabilities.lockCodes.migrated(true)) - ) - -- at this point, refresh is injected in migration. - - test.socket.capability:__expect_send( - mock_device:generate_test_message("main", capabilities.lock.supportedLockValues({"locked", "unlocked", "not fully locked"}, {visibility = {displayed = false}})) - ) - test.socket.capability:__expect_send( - mock_device:generate_test_message("main", capabilities.lock.supportedLockCommands({"lock", "unlock"}, {visibility = {displayed = false}})) - ) - mock_device:expect_metadata_update({ profile = "lock-modular", optional_component_capabilities = enabled_optional_component_capability_pairs }) - - - test.wait_for_events() - -- assume this was set prior - mock_device:set_field(lock_utils.LOCK_CODES_FOR_MIGRATION, { {1, "ST Remote Operation Code"}, {2, "Guest1"}, {3, "Guest2"} }, {persist=true}) - test.socket.device_lifecycle:__queue_receive(mock_device:generate_info_changed( - {profile = {id = "00000000-1111-2222-3333-000000000010", components = { main = {capabilities={ - ["lock"]= {id="lock", version=1}, ["lockAlarm"] = {id="lockAlarm", version=1}, ["remoteControlStatus"] = {id="remoteControlStatus", version=1}, - ["lockUsers"] = {id="lockUsers", version=1}, ["lockCredentials"] = {id="lockCredentials", version=1}, ["firmwareUpdate"] = {id="firmwareUpdate", version=1}, - ["refresh"] = {id="refresh", version=1}}}}}} - )) - test.socket["matter"]:__expect_send({mock_device.id, subscribe_request}) - test.socket.capability:__expect_send( - mock_device:generate_test_message("main", capabilities.lockAlarm.alarm.clear({state_change = true})) - ) - test.socket.capability:__expect_send( - mock_device:generate_test_message("main", capabilities.lockAlarm.supportedAlarmValues({"unableToLockTheDoor"}, {visibility = {displayed = false}})) - ) - test.socket.capability:__expect_send( - mock_device:generate_test_message( - "main", - capabilities.lockUsers.users( - { - {userIndex=1, userName="ST Remote Operation Code", userType="guest"}, - {userIndex=2, userName="Guest1", userType="guest"}, - {userIndex=3, userName="Guest2", userType="guest"} - }, - {visibility={displayed=false}}) - ) - ) - test.socket.capability:__expect_send( - mock_device:generate_test_message( - "main", - capabilities.lockCredentials.credentials( - { - {credentialIndex=1, credentialType="pin", userIndex=1}, - {credentialIndex=2, credentialType="pin", userIndex=2}, - {credentialIndex=3, credentialType="pin", userIndex=3} - }, - {visibility={displayed=false}} - ) - ) - ) - end, - { - min_api_version = 17 - } -) - -test.run_registered_tests() +-- Copyright 2026 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + +local test = require "integration_test" +local capabilities = require "st.capabilities" +local t_utils = require "integration_test.utils" +local clusters = require "st.matter.clusters" +local DoorLock = clusters.DoorLock +local lock_utils = require "lock_utils" + +local mock_device = test.mock_device.build_test_matter_device({ + profile = t_utils.get_profile_definition("base-lock.yml"), + manufacturer_info = { + vendor_id = 0x135D, + product_id = 0x00C1, + }, + endpoints = { + { + endpoint_id = 0, + clusters = { + { cluster_id = clusters.BasicInformation.ID, cluster_type = "SERVER" }, + }, + device_types = { + { device_type_id = 0x0016, device_type_revision = 1 } -- RootNode + } + }, + { + endpoint_id = 1, + clusters = { + { + cluster_id = DoorLock.ID, + cluster_type = "SERVER", + cluster_revision = 1, + feature_map = 0x0101, -- PIN & USR + } + }, + device_types = { + { device_type_id = 0x000A, device_type_revision = 1 } -- Door Lock + } + } + } +}) + +local function test_init() + test.disable_startup_messages() + test.mock_device.add_test_device(mock_device) + -- mock_device:set_field(lock_utils.LOCK_CODES_FOR_MIGRATION, { {1, "ST Remote Operation Code"}, {2, "Guest1"}, {3, "Guest2"} }, {persist=true}) +end + +test.set_test_init_function(test_init) + +local subscribe_request = DoorLock.attributes.LockState:subscribe(mock_device) +subscribe_request:merge(DoorLock.attributes.OperatingMode:subscribe(mock_device)) +subscribe_request:merge(DoorLock.attributes.NumberOfTotalUsersSupported:subscribe(mock_device)) +subscribe_request:merge(DoorLock.attributes.NumberOfPINUsersSupported:subscribe(mock_device)) +subscribe_request:merge(DoorLock.attributes.MaxPINCodeLength:subscribe(mock_device)) +subscribe_request:merge(DoorLock.attributes.MinPINCodeLength:subscribe(mock_device)) +subscribe_request:merge(DoorLock.attributes.RequirePINforRemoteOperation:subscribe(mock_device)) +subscribe_request:merge(DoorLock.events.LockOperation:subscribe(mock_device)) +subscribe_request:merge(DoorLock.events.DoorLockAlarm:subscribe(mock_device)) +subscribe_request:merge(DoorLock.events.LockUserChange:subscribe(mock_device)) + +local enabled_optional_component_capability_pairs = {{ + "main", + { + capabilities.lockUsers.ID, + capabilities.lockCredentials.ID, + capabilities.battery.ID, + } +}} + +test.register_coroutine_test( + "Migration completed and User and Credential values restored", + function() + test.wait_for_events() + test.socket.capability:__queue_receive( + { + mock_device.id, + {capability = capabilities.lockCodes.ID, command = "migrate", args = {}} + } + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.lockCodes.migrated(true)) + ) + -- at this point, refresh is injected in migration. + + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.lock.supportedLockValues({"locked", "unlocked", "not fully locked"}, {visibility = {displayed = false}})) + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.lock.supportedLockCommands({"lock", "unlock"}, {visibility = {displayed = false}})) + ) + mock_device:expect_metadata_update({ profile = "lock-modular", optional_component_capabilities = enabled_optional_component_capability_pairs }) + + + test.wait_for_events() + -- assume this was set prior + mock_device:set_field(lock_utils.LOCK_CODES_FOR_MIGRATION, { {1, "ST Remote Operation Code"}, {2, "Guest1"}, {3, "Guest2"} }, {persist=true}) + test.socket.device_lifecycle:__queue_receive(mock_device:generate_info_changed( + {profile = {id = "00000000-1111-2222-3333-000000000010", components = { main = {capabilities={ + ["lock"]= {id="lock", version=1}, ["lockAlarm"] = {id="lockAlarm", version=1}, ["remoteControlStatus"] = {id="remoteControlStatus", version=1}, + ["lockUsers"] = {id="lockUsers", version=1}, ["lockCredentials"] = {id="lockCredentials", version=1}, ["firmwareUpdate"] = {id="firmwareUpdate", version=1}, + ["refresh"] = {id="refresh", version=1}}}}}} + )) + test.socket["matter"]:__expect_send({mock_device.id, subscribe_request}) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.lockAlarm.alarm.clear({state_change = true})) + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.lockAlarm.supportedAlarmValues({"unableToLockTheDoor"}, {visibility = {displayed = false}})) + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message( + "main", + capabilities.lockUsers.users( + { + {userIndex=1, userName="ST Remote Operation Code", userType="guest"}, + {userIndex=2, userName="Guest1", userType="guest"}, + {userIndex=3, userName="Guest2", userType="guest"} + }, + {visibility={displayed=false}}) + ) + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message( + "main", + capabilities.lockCredentials.credentials( + { + {credentialIndex=1, credentialType="pin", userIndex=1}, + {credentialIndex=2, credentialType="pin", userIndex=2}, + {credentialIndex=3, credentialType="pin", userIndex=3} + }, + {visibility={displayed=false}} + ) + ) + ) + end, + { + min_api_version = 15 + } +) + +test.run_registered_tests() diff --git a/drivers/SmartThings/matter-lock/src/test/test_matter_lock_modular.lua b/drivers/SmartThings/matter-lock/src/test/test_matter_lock_modular.lua index 745e769f9e..ca1aedfb04 100644 --- a/drivers/SmartThings/matter-lock/src/test/test_matter_lock_modular.lua +++ b/drivers/SmartThings/matter-lock/src/test/test_matter_lock_modular.lua @@ -361,7 +361,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ profile = "lock-modular", optional_component_capabilities = {{"main", {"batteryLevel"}}} }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -396,7 +396,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ profile = "lock-modular", optional_component_capabilities = {{"main", {"battery"}}} }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -431,7 +431,7 @@ test.register_coroutine_test( end, { test_init = test_init_unlatch, - min_api_version = 17 + min_api_version = 15 } ) @@ -467,7 +467,7 @@ test.register_coroutine_test( end, { test_init = test_init_unlatch, - min_api_version = 17 + min_api_version = 15 } ) @@ -503,7 +503,7 @@ test.register_coroutine_test( end, { test_init = test_init_user_pin, - min_api_version = 17 + min_api_version = 15 } ) @@ -540,7 +540,7 @@ test.register_coroutine_test( end, { test_init = test_init_user_pin_schedule_unlatch, - min_api_version = 17 + min_api_version = 15 } ) @@ -574,7 +574,10 @@ test.register_coroutine_test( ) mock_device_modular:expect_metadata_update({ profile = "lock-modular-embedded-unlatch", optional_component_capabilities = {{"main", {"lockUsers", "lockCredentials", "lockSchedules", "battery"}}} }) end, - { test_init = test_init_modular } + { + test_init = test_init_modular, + min_api_version = 15 + } ) test.register_coroutine_test( @@ -582,7 +585,10 @@ test.register_coroutine_test( -- simulate no actual change test.socket.device_lifecycle:__queue_receive(mock_device_modular:generate_info_changed({})) end, - { test_init = test_init_modular } + { + test_init = test_init_modular, + min_api_version = 15 + } ) test.register_coroutine_test( @@ -619,7 +625,7 @@ test.register_coroutine_test( end, { test_init = test_init_modular, - min_api_version = 17 + min_api_version = 15 } ) @@ -692,7 +698,7 @@ test.register_coroutine_test( test.mock_device.add_test_device(mock_nuki_smart_lock_ultra) mock_nuki_smart_lock_ultra:set_field(profiling_data.BATTERY_SUPPORT, battery_support.BATTERY_PERCENTAGE, {persist = true}) -- assume this has been set previously end, - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-lock/src/test/test_matter_lock_unlatch.lua b/drivers/SmartThings/matter-lock/src/test/test_matter_lock_unlatch.lua index f040c2b26e..f2224af358 100644 --- a/drivers/SmartThings/matter-lock/src/test/test_matter_lock_unlatch.lua +++ b/drivers/SmartThings/matter-lock/src/test/test_matter_lock_unlatch.lua @@ -106,7 +106,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -157,7 +157,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -178,7 +178,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -202,7 +202,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -226,7 +226,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -248,7 +248,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -270,7 +270,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -292,7 +292,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -381,7 +381,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) test.run_registered_tests() diff --git a/drivers/SmartThings/matter-lock/src/test/test_new_matter_lock.lua b/drivers/SmartThings/matter-lock/src/test/test_new_matter_lock.lua index 35acbfbff6..56ac1096df 100644 --- a/drivers/SmartThings/matter-lock/src/test/test_new_matter_lock.lua +++ b/drivers/SmartThings/matter-lock/src/test/test_new_matter_lock.lua @@ -96,7 +96,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -133,7 +133,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -184,7 +184,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -204,7 +204,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -224,7 +224,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -244,7 +244,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -264,7 +264,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -284,7 +284,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -304,7 +304,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -375,7 +375,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -456,7 +456,7 @@ function() test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -473,7 +473,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -493,7 +493,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -512,7 +512,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -533,7 +533,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -557,7 +557,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -579,7 +579,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -601,7 +601,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -623,7 +623,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -649,7 +649,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -748,7 +748,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -975,7 +975,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1044,7 +1044,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1071,7 +1071,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1115,7 +1115,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1164,7 +1164,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1191,7 +1191,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1257,7 +1257,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1284,7 +1284,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1350,7 +1350,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1377,7 +1377,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1442,7 +1442,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1471,7 +1471,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1527,7 +1527,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1590,7 +1590,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1646,7 +1646,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1794,7 +1794,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1823,7 +1823,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1877,7 +1877,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1906,7 +1906,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1978,7 +1978,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2007,7 +2007,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2078,7 +2078,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2107,7 +2107,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2157,7 +2157,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2189,7 +2189,188 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 + } +) + +local LOCAL_START_TIME = "2025-01-15T09:00:00" +local LOCAL_END_TIME = "2025-01-15T17:00:00" + +test.register_coroutine_test( + "Handle Add Year Day Schedule command received from SmartThings.", + function() + test.socket.capability:__queue_receive( + { + mock_device.id, + { + capability = capabilities.lockSchedules.ID, + command = "setYearDaySchedule", + args = {1, 1, {localStartTime=LOCAL_START_TIME, localEndTime=LOCAL_END_TIME}} + }, + } + ) + test.socket.matter:__expect_send( + { + mock_device.id, + DoorLock.server.commands.SetYearDaySchedule( + mock_device, 1, -- endpoint + 1, -- Schedule Index + 1, -- User Index + lock_utils.iso8601_to_epoch(LOCAL_START_TIME), -- Start Time (epoch) + lock_utils.iso8601_to_epoch(LOCAL_END_TIME) -- End Time (epoch) + ), + } + ) + test.wait_for_events() + test.socket.matter:__queue_receive( + { + mock_device.id, + DoorLock.server.commands.SetYearDaySchedule:build_test_command_response( + mock_device, 1 + ) + } + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message( + "main", + capabilities.lockSchedules.yearDaySchedules( + {{ + userIndex=1, + schedules={{ + scheduleIndex = 1, + localStartTime = LOCAL_START_TIME, + localEndTime = LOCAL_END_TIME + }}, + }}, + {visibility={displayed=false}} + ) + ) + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message( + "main", + capabilities.lockSchedules.commandResult( + {commandName="setYearDaySchedule", userIndex=1, scheduleIndex=1, statusCode="success"}, + {state_change=true, visibility={displayed=false}} + ) + ) + ) + end, + { + min_api_version = 14 + } +) + +test.register_coroutine_test( + "Add Year Day Schedule command received from SmartThings and send busy state", + function() + mock_device:set_field(lock_utils.BUSY_STATE, os.time(), {persist = true}) + test.socket.capability:__queue_receive( + { + mock_device.id, + { + capability = capabilities.lockSchedules.ID, + command = "setYearDaySchedule", + args = {1, 1, {localStartTime=LOCAL_START_TIME, localEndTime=LOCAL_END_TIME}} + }, + } + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message( + "main", + capabilities.lockSchedules.commandResult( + {commandName="setYearDaySchedule", statusCode="busy"}, + {state_change=true, visibility={displayed=false}} + ) + ) + ) + end, + { + min_api_version = 14 + } +) + +test.register_coroutine_test( + "Handle Clear Year Day Schedule command received from SmartThings.", + function() + test.socket.capability:__queue_receive( + { + mock_device.id, + { + capability = capabilities.lockSchedules.ID, + command = "clearYearDaySchedules", + args = { + 1, -- user index + 1, -- schedule index + } + }, + } + ) + test.socket.matter:__expect_send( + { + mock_device.id, + DoorLock.server.commands.SetYearDaySchedule( + mock_device, 1, -- endpoint + 1, -- year_day_index + 1, -- user_index + 0, -- local_start_time + lock_utils.MAX_EPOCH_S -- local_end_time + ), + } + ) + test.wait_for_events() + test.socket.matter:__queue_receive( + { + mock_device.id, + DoorLock.server.commands.SetYearDaySchedule:build_test_command_response( + mock_device, 1 + ) + } + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message( + "main", + capabilities.lockSchedules.commandResult( + {commandName="clearYearDaySchedules", userIndex=1, scheduleIndex=1, statusCode="success"}, + {state_change=true, visibility={displayed=false}} + ) + ) + ) + end, + { + min_api_version = 14 + } +) + +test.register_coroutine_test( + "Clear Year Day Schedule command received from SmartThings and send busy state", + function() + mock_device:set_field(lock_utils.BUSY_STATE, os.time(), {persist = true}) + test.socket.capability:__queue_receive( + { + mock_device.id, + { + capability = capabilities.lockSchedules.ID, + command = "clearYearDaySchedules", + args = { + 1, -- user index + 1, -- schedule index + } + }, + } + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message( + "main", + capabilities.lockSchedules.commandResult( + {commandName="clearYearDaySchedules", statusCode="busy"}, + {state_change=true, visibility={displayed=false}} + ) + ) + ) + end, + { + min_api_version = 14 } ) @@ -2501,7 +2682,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2609,7 +2790,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/matter-lock/src/test/test_new_matter_lock_aliro.lua b/drivers/SmartThings/matter-lock/src/test/test_new_matter_lock_aliro.lua index 250fcb8af5..d0569d5b85 100644 --- a/drivers/SmartThings/matter-lock/src/test/test_new_matter_lock_aliro.lua +++ b/drivers/SmartThings/matter-lock/src/test/test_new_matter_lock_aliro.lua @@ -155,7 +155,10 @@ test.register_coroutine_test( capabilities.lockAliro.readerVerificationKey(EXPECTED_PUB_HEX, {visibility = {displayed = false}}) ) ) - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -176,7 +179,10 @@ test.register_coroutine_test( capabilities.lockAliro.readerGroupIdentifier(EXPECTED_GROUP_ID_HEX, {visibility = {displayed = false}}) ) ) - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -199,7 +205,10 @@ test.register_coroutine_test( {visibility = {displayed = false}}) ) ) - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -222,7 +231,10 @@ test.register_coroutine_test( {visibility = {displayed = false}}) ) ) - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -245,7 +257,10 @@ test.register_coroutine_test( {visibility = {displayed = false}}) ) ) - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -266,7 +281,10 @@ test.register_coroutine_test( capabilities.lockAliro.groupResolvingKey(EXPECTED_GROUP_ID_HEX, {visibility = {displayed = false}}) ) ) - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -289,7 +307,10 @@ test.register_coroutine_test( {visibility = {displayed = false}}) ) ) - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -312,7 +333,10 @@ test.register_coroutine_test( {visibility = {displayed = false}}) ) ) - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -334,7 +358,10 @@ test.register_coroutine_test( capabilities.lockAliro.cardId("3icub18c8pr00", {visibility = {displayed = false}}) ) ) - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -386,7 +413,10 @@ test.register_coroutine_test( ) ) ) - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -546,7 +576,10 @@ test.register_coroutine_test( ) ) ) - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -585,7 +618,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -660,7 +693,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -730,7 +763,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -799,22 +832,64 @@ test.register_coroutine_test( ) ) end, + { + min_api_version = 15 + } +) + +test.register_coroutine_test( + "Handle Set Endpoint Key command received from SmartThings and busy status", + function() + lock_utils.is_busy_state_set(mock_device) + test.socket.capability:__queue_receive( + { + mock_device.id, + { + capability = capabilities.lockAliro.ID, + command = "setEndpointKey", + args = { + 0, -- user index + key_id, + "nonEvictableEndpointKey", + endpoint_key, + request_id + } + }, + } + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message( + "main", + capabilities.lockAliro.commandResult( + { + commandName="setEndpointKey", + keyId=key_id, + requestId=request_id, + statusCode="busy" + }, + {state_change=true, visibility={displayed=false}} + ) + ) + ) + end, { min_api_version = 17 } ) test.register_coroutine_test( - "Handle Set Issuer Key command and Clear Issuer Key command received from SmartThings.", + "Handle Set Endpoint Key command received from SmartThings and user_index is occupied", function() test.socket.capability:__queue_receive( { mock_device.id, { capability = capabilities.lockAliro.ID, - command = "setIssuerKey", + command = "setEndpointKey", args = { - 0, + 0, -- user index + key_id, + "nonEvictableEndpointKey", endpoint_key, request_id } @@ -829,7 +904,7 @@ test.register_coroutine_test( DoorLock.types.DataOperationTypeEnum.ADD, -- operation_type DoorLock.types.CredentialStruct( { - credential_type = DoorLock.types.CredentialTypeEnum.ALIRO_CREDENTIAL_ISSUER_KEY, + credential_type = DoorLock.types.CredentialTypeEnum.ALIRO_NON_EVICTABLE_ENDPOINT_KEY, credential_index = 1 } ), -- credential @@ -846,67 +921,142 @@ test.register_coroutine_test( mock_device.id, DoorLock.client.commands.SetCredentialResponse:build_test_command_response( mock_device, 1, - DoorLock.types.DlStatus.SUCCESS, -- status + DoorLock.types.DlStatus.OCCUPIED, -- status 1, -- user_index 2 -- next_credential_index ), } ) - test.socket.capability:__expect_send( - mock_device:generate_test_message( - "main", - capabilities.lockUsers.users( - {{userIndex=1, userType="adminMember"}}, - {visibility={displayed=false}} - ) - ) + test.socket.matter:__expect_send( + { + mock_device.id, + DoorLock.server.commands.SetCredential( + mock_device, 1, -- endpoint + DoorLock.types.DataOperationTypeEnum.ADD, -- operation_type + DoorLock.types.CredentialStruct( + { + credential_type = DoorLock.types.CredentialTypeEnum.ALIRO_NON_EVICTABLE_ENDPOINT_KEY, + credential_index = 2 + } + ), -- credential + lock_utils.hex_string_to_octet_string(endpoint_key), -- credential_data + nil, -- user_index + nil, -- user_status + DoorLock.types.DlUserType.UNRESTRICTED_USER -- user_type + ), + } ) - test.socket.capability:__expect_send( - mock_device:generate_test_message( - "main", - capabilities.lockAliro.credentials( - {{ - keyIndex=1, - keyType="issuerKey", - userIndex=1 - }}, - {visibility={displayed=false}} - ) - ) + end, + { + min_api_version = 17 + } +) + +test.register_coroutine_test( + "Handle Set Endpoint Key command received from SmartThings and user_index is occupied and next_credential_index is nil", + function() + test.socket.capability:__queue_receive( + { + mock_device.id, + { + capability = capabilities.lockAliro.ID, + command = "setEndpointKey", + args = { + 0, -- user index + key_id, + "nonEvictableEndpointKey", + endpoint_key, + request_id + } + }, + } + ) + test.socket.matter:__expect_send( + { + mock_device.id, + DoorLock.server.commands.SetCredential( + mock_device, 1, -- endpoint + DoorLock.types.DataOperationTypeEnum.ADD, -- operation_type + DoorLock.types.CredentialStruct( + { + credential_type = DoorLock.types.CredentialTypeEnum.ALIRO_NON_EVICTABLE_ENDPOINT_KEY, + credential_index = 1 + } + ), -- credential + lock_utils.hex_string_to_octet_string(endpoint_key), -- credential_data + nil, -- user_index + nil, -- user_status + DoorLock.types.DlUserType.UNRESTRICTED_USER -- user_type + ), + } + ) + test.wait_for_events() + test.socket.matter:__queue_receive( + { + mock_device.id, + DoorLock.client.commands.SetCredentialResponse:build_test_command_response( + mock_device, 1, + DoorLock.types.DlStatus.OCCUPIED, -- status + 1, -- user_index + nil -- next_credential_index + ), + } ) test.socket.capability:__expect_send( mock_device:generate_test_message( "main", capabilities.lockAliro.commandResult( { - commandName="setIssuerKey", + commandName="setEndpointKey", + keyId=key_id, requestId=request_id, - statusCode="success", - userIndex=1 + statusCode="resourceExhausted" }, {state_change=true, visibility={displayed=false}} ) ) ) - test.wait_for_events() + end, + { + min_api_version = 17 + } +) + +test.register_coroutine_test( + "Handle Set Endpoint Key command received from SmartThings and user_index is failure", + function() test.socket.capability:__queue_receive( { mock_device.id, { capability = capabilities.lockAliro.ID, - command = "clearIssuerKey", - args = {1, request_id} + command = "setEndpointKey", + args = { + 0, -- user index + key_id, + "nonEvictableEndpointKey", + endpoint_key, + request_id + } }, } ) test.socket.matter:__expect_send( { mock_device.id, - DoorLock.server.commands.ClearCredential( + DoorLock.server.commands.SetCredential( mock_device, 1, -- endpoint + DoorLock.types.DataOperationTypeEnum.ADD, -- operation_type DoorLock.types.CredentialStruct( - {credential_type = DoorLock.types.CredentialTypeEnum.ALIRO_CREDENTIAL_ISSUER_KEY, credential_index = 1} - ) + { + credential_type = DoorLock.types.CredentialTypeEnum.ALIRO_NON_EVICTABLE_ENDPOINT_KEY, + credential_index = 1 + } + ), -- credential + lock_utils.hex_string_to_octet_string(endpoint_key), -- credential_data + nil, -- user_index + nil, -- user_status + DoorLock.types.DlUserType.UNRESTRICTED_USER -- user_type ), } ) @@ -914,25 +1064,163 @@ test.register_coroutine_test( test.socket.matter:__queue_receive( { mock_device.id, - DoorLock.server.commands.ClearCredential:build_test_command_response( - mock_device, 1 + DoorLock.client.commands.SetCredentialResponse:build_test_command_response( + mock_device, 1, + DoorLock.types.DlStatus.FAILURE, -- status + 1, -- user_index + 2 -- next_credential_index ), } ) test.socket.capability:__expect_send( mock_device:generate_test_message( "main", - capabilities.lockAliro.credentials({}, {visibility={displayed=false}}) - ) - ) - test.socket.capability:__expect_send( - mock_device:generate_test_message( - "main", - capabilities.lockUsers.users({}, {visibility={displayed=false}}) + capabilities.lockAliro.commandResult( + { + commandName="setEndpointKey", + keyId=key_id, + requestId=request_id, + statusCode="failure" + }, + {state_change=true, visibility={displayed=false}} + ) ) ) - test.socket.capability:__expect_send( - mock_device:generate_test_message( + end, + { + min_api_version = 17 + } +) + +test.register_coroutine_test( + "Handle Set Issuer Key command and Clear Issuer Key command received from SmartThings.", + function() + test.socket.capability:__queue_receive( + { + mock_device.id, + { + capability = capabilities.lockAliro.ID, + command = "setIssuerKey", + args = { + 0, + endpoint_key, + request_id + } + }, + } + ) + test.socket.matter:__expect_send( + { + mock_device.id, + DoorLock.server.commands.SetCredential( + mock_device, 1, -- endpoint + DoorLock.types.DataOperationTypeEnum.ADD, -- operation_type + DoorLock.types.CredentialStruct( + { + credential_type = DoorLock.types.CredentialTypeEnum.ALIRO_CREDENTIAL_ISSUER_KEY, + credential_index = 1 + } + ), -- credential + lock_utils.hex_string_to_octet_string(endpoint_key), -- credential_data + nil, -- user_index + nil, -- user_status + DoorLock.types.DlUserType.UNRESTRICTED_USER -- user_type + ), + } + ) + test.wait_for_events() + test.socket.matter:__queue_receive( + { + mock_device.id, + DoorLock.client.commands.SetCredentialResponse:build_test_command_response( + mock_device, 1, + DoorLock.types.DlStatus.SUCCESS, -- status + 1, -- user_index + 2 -- next_credential_index + ), + } + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message( + "main", + capabilities.lockUsers.users( + {{userIndex=1, userType="adminMember"}}, + {visibility={displayed=false}} + ) + ) + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message( + "main", + capabilities.lockAliro.credentials( + {{ + keyIndex=1, + keyType="issuerKey", + userIndex=1 + }}, + {visibility={displayed=false}} + ) + ) + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message( + "main", + capabilities.lockAliro.commandResult( + { + commandName="setIssuerKey", + requestId=request_id, + statusCode="success", + userIndex=1 + }, + {state_change=true, visibility={displayed=false}} + ) + ) + ) + test.wait_for_events() + test.socket.capability:__queue_receive( + { + mock_device.id, + { + capability = capabilities.lockAliro.ID, + command = "clearIssuerKey", + args = {1, request_id} + }, + } + ) + test.socket.matter:__expect_send( + { + mock_device.id, + DoorLock.server.commands.ClearCredential( + mock_device, 1, -- endpoint + DoorLock.types.CredentialStruct( + {credential_type = DoorLock.types.CredentialTypeEnum.ALIRO_CREDENTIAL_ISSUER_KEY, credential_index = 1} + ) + ), + } + ) + test.wait_for_events() + test.socket.matter:__queue_receive( + { + mock_device.id, + DoorLock.server.commands.ClearCredential:build_test_command_response( + mock_device, 1 + ), + } + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message( + "main", + capabilities.lockAliro.credentials({}, {visibility={displayed=false}}) + ) + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message( + "main", + capabilities.lockUsers.users({}, {visibility={displayed=false}}) + ) + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message( "main", capabilities.lockSchedules.weekDaySchedules({}, {visibility={displayed=false}}) ) @@ -957,7 +1245,316 @@ test.register_coroutine_test( ) ) ) - end + end, + { + min_api_version = 15 + } +) + +test.register_coroutine_test( + "Handle Set Issuer Key command received from SmartThings and busy status", + function() + lock_utils.is_busy_state_set(mock_device) + test.socket.capability:__queue_receive( + { + mock_device.id, + { + capability = capabilities.lockAliro.ID, + command = "setIssuerKey", + args = { + 0, + endpoint_key, + request_id + } + }, + } + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message( + "main", + capabilities.lockAliro.commandResult( + { + commandName="setIssuerKey", + requestId=request_id, + statusCode="busy" + }, + {state_change=true, visibility={displayed=false}} + ) + ) + ) + end, + { + min_api_version = 15 + } +) + +test.register_coroutine_test( + "Handle Set Issuer Key command received from SmartThings and user_index is occupied", + function() + test.socket.capability:__queue_receive( + { + mock_device.id, + { + capability = capabilities.lockAliro.ID, + command = "setIssuerKey", + args = { + 0, + endpoint_key, + request_id + } + }, + } + ) + test.socket.matter:__expect_send( + { + mock_device.id, + DoorLock.server.commands.SetCredential( + mock_device, 1, -- endpoint + DoorLock.types.DataOperationTypeEnum.ADD, -- operation_type + DoorLock.types.CredentialStruct( + { + credential_type = DoorLock.types.CredentialTypeEnum.ALIRO_CREDENTIAL_ISSUER_KEY, + credential_index = 1 + } + ), -- credential + lock_utils.hex_string_to_octet_string(endpoint_key), -- credential_data + nil, -- user_index + nil, -- user_status + DoorLock.types.DlUserType.UNRESTRICTED_USER -- user_type + ), + } + ) + test.wait_for_events() + test.socket.matter:__queue_receive( + { + mock_device.id, + DoorLock.client.commands.SetCredentialResponse:build_test_command_response( + mock_device, 1, + DoorLock.types.DlStatus.OCCUPIED, -- status + 1, -- user_index + 2 -- next_credential_index + ), + } + ) + test.socket.matter:__expect_send( + { + mock_device.id, + DoorLock.server.commands.SetCredential( + mock_device, 1, -- endpoint + DoorLock.types.DataOperationTypeEnum.ADD, -- operation_type + DoorLock.types.CredentialStruct( + { + credential_type = DoorLock.types.CredentialTypeEnum.ALIRO_CREDENTIAL_ISSUER_KEY, + credential_index = 2 + } + ), -- credential + lock_utils.hex_string_to_octet_string(endpoint_key), -- credential_data + nil, -- user_index + nil, -- user_status + DoorLock.types.DlUserType.UNRESTRICTED_USER -- user_type + ), + } + ) + end, + { + min_api_version = 15 + } +) + +test.register_coroutine_test( + "Handle Set Issuer Key command received from SmartThings and user_index is occupied and next_credential_index is nil", + function() + test.socket.capability:__queue_receive( + { + mock_device.id, + { + capability = capabilities.lockAliro.ID, + command = "setIssuerKey", + args = { + 0, + endpoint_key, + request_id + } + }, + } + ) + test.socket.matter:__expect_send( + { + mock_device.id, + DoorLock.server.commands.SetCredential( + mock_device, 1, -- endpoint + DoorLock.types.DataOperationTypeEnum.ADD, -- operation_type + DoorLock.types.CredentialStruct( + { + credential_type = DoorLock.types.CredentialTypeEnum.ALIRO_CREDENTIAL_ISSUER_KEY, + credential_index = 1 + } + ), -- credential + lock_utils.hex_string_to_octet_string(endpoint_key), -- credential_data + nil, -- user_index + nil, -- user_status + DoorLock.types.DlUserType.UNRESTRICTED_USER -- user_type + ), + } + ) + test.wait_for_events() + test.socket.matter:__queue_receive( + { + mock_device.id, + DoorLock.client.commands.SetCredentialResponse:build_test_command_response( + mock_device, 1, + DoorLock.types.DlStatus.OCCUPIED, -- status + 1, -- user_index + nil -- next_credential_index + ), + } + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message( + "main", + capabilities.lockAliro.commandResult( + { + commandName="setIssuerKey", + requestId=request_id, + statusCode="resourceExhausted" + }, + {state_change=true, visibility={displayed=false}} + ) + ) + ) + end, + { + min_api_version = 15 + } +) + +test.register_coroutine_test( + "Handle Set Issuer Key command received from SmartThings and user_index is failure", + function() + test.socket.capability:__queue_receive( + { + mock_device.id, + { + capability = capabilities.lockAliro.ID, + command = "setIssuerKey", + args = { + 0, + endpoint_key, + request_id + } + }, + } + ) + test.socket.matter:__expect_send( + { + mock_device.id, + DoorLock.server.commands.SetCredential( + mock_device, 1, -- endpoint + DoorLock.types.DataOperationTypeEnum.ADD, -- operation_type + DoorLock.types.CredentialStruct( + { + credential_type = DoorLock.types.CredentialTypeEnum.ALIRO_CREDENTIAL_ISSUER_KEY, + credential_index = 1 + } + ), -- credential + lock_utils.hex_string_to_octet_string(endpoint_key), -- credential_data + nil, -- user_index + nil, -- user_status + DoorLock.types.DlUserType.UNRESTRICTED_USER -- user_type + ), + } + ) + test.wait_for_events() + test.socket.matter:__queue_receive( + { + mock_device.id, + DoorLock.client.commands.SetCredentialResponse:build_test_command_response( + mock_device, 1, + DoorLock.types.DlStatus.FAILURE, -- status + 1, -- user_index + 2 -- next_credential_index + ), + } + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message( + "main", + capabilities.lockAliro.commandResult( + { + commandName="setIssuerKey", + requestId=request_id, + statusCode="failure" + }, + {state_change=true, visibility={displayed=false}} + ) + ) + ) + end, + { + min_api_version = 15 + } +) + +test.register_coroutine_test( + "set_reader_config should send SetAliroReaderConfig command on device init", + function() + mock_device:set_field(lock_utils.ALIRO_READER_CONFIG_UPDATED, nil, {persist = true}) + mock_device:set_field(lock_utils.BUSY_STATE, false, {persist = true}) + test.socket.device_lifecycle:__queue_receive(mock_device:generate_info_changed({ profile = t_utils.get_profile_definition("lock.yml")})) + test.socket["matter"]:__expect_send({mock_device.id, subscribe_request}) + test.socket.matter:__expect_send( + { + mock_device.id, + DoorLock.server.commands.SetAliroReaderConfig( + mock_device, 1, + lock_utils.hex_string_to_octet_string(EXPECTED_PRIV_HEX), + lock_utils.hex_string_to_octet_string(EXPECTED_PUB_HEX), + lock_utils.hex_string_to_octet_string(EXPECTED_GROUP_ID_HEX), + nil + ), + } + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.lockAlarm.alarm.clear({state_change = true})) + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.lockAlarm.supportedAlarmValues({"unableToLockTheDoor"}, {visibility = {displayed = false}})) + ) + end, + { + min_api_version = 15 + } +) + +test.register_coroutine_test( + "Set Reader Config command sets busy state in command result when busy", + function() + mock_device:set_field(lock_utils.ALIRO_READER_CONFIG_UPDATED, nil, {persist = true}) + lock_utils.is_busy_state_set(mock_device) + test.socket.device_lifecycle:__queue_receive(mock_device:generate_info_changed({ profile = t_utils.get_profile_definition("lock.yml")})) + test.socket["matter"]:__expect_send({mock_device.id, subscribe_request}) + test.socket.capability:__expect_send( + mock_device:generate_test_message( + "main", + capabilities.lockAliro.commandResult( + { + commandName="setReaderConfig", + statusCode="busy" + }, + {state_change=true, visibility={displayed=false}} + ) + ) + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.lockAlarm.alarm.clear({state_change = true})) + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.lockAlarm.supportedAlarmValues({"unableToLockTheDoor"}, {visibility = {displayed = false}})) + ) + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( diff --git a/drivers/SmartThings/matter-lock/src/test/test_new_matter_lock_battery.lua b/drivers/SmartThings/matter-lock/src/test/test_new_matter_lock_battery.lua index 8ec2a2a781..c7de312231 100644 --- a/drivers/SmartThings/matter-lock/src/test/test_new_matter_lock_battery.lua +++ b/drivers/SmartThings/matter-lock/src/test/test_new_matter_lock_battery.lua @@ -427,7 +427,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ profile = "lock" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -458,7 +458,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ profile = "lock-batteryLevel" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -490,7 +490,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ profile = "lock-battery" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -521,7 +521,7 @@ test.register_coroutine_test( end, { test_init = test_init_unlatch, - min_api_version = 17 + min_api_version = 14 } ) @@ -553,7 +553,7 @@ test.register_coroutine_test( end, { test_init = test_init_unlatch, - min_api_version = 17 + min_api_version = 14 } ) @@ -586,7 +586,7 @@ test.register_coroutine_test( end, { test_init = test_init_unlatch, - min_api_version = 17 + min_api_version = 14 } ) @@ -617,7 +617,7 @@ test.register_coroutine_test( end, { test_init = test_init_user_pin, - min_api_version = 17 + min_api_version = 14 } ) @@ -649,7 +649,7 @@ test.register_coroutine_test( end, { test_init = test_init_user_pin, - min_api_version = 17 + min_api_version = 14 } ) @@ -682,7 +682,7 @@ test.register_coroutine_test( end, { test_init = test_init_user_pin, - min_api_version = 17 + min_api_version = 14 } ) @@ -713,7 +713,7 @@ test.register_coroutine_test( end, { test_init = test_init_user_pin_schedule_unlatch, - min_api_version = 17 + min_api_version = 14 } ) @@ -745,7 +745,7 @@ test.register_coroutine_test( end, { test_init = test_init_user_pin_schedule_unlatch, - min_api_version = 17 + min_api_version = 14 } ) @@ -778,7 +778,71 @@ test.register_coroutine_test( end, { test_init = test_init_user_pin_schedule_unlatch, - min_api_version = 17 + min_api_version = 14 + } +) + +test.register_coroutine_test( + "Handle received BatPercentRemaining from device.", + function() + test.socket.matter:__queue_receive( + { + mock_device_battery.id, + clusters.PowerSource.attributes.BatPercentRemaining:build_test_report_data( + mock_device_battery, 1, 150 + ) + } + ) + test.socket.capability:__expect_send( + mock_device_battery:generate_test_message("main", capabilities.battery.battery(math.floor(150 / 2.0 + 0.5))) + ) + end, + { + test_init = test_init_battery, + min_api_version = 14 + } +) + +test.register_coroutine_test( + "Handle received BatChargeLevel from device.", + function() + test.socket.matter:__queue_receive( + { + mock_device_battery_level.id, + clusters.PowerSource.attributes.BatChargeLevel:build_test_report_data( + mock_device_battery_level, 1, clusters.PowerSource.types.BatChargeLevelEnum.OK + ) + } + ) + test.socket.capability:__expect_send( + mock_device_battery_level:generate_test_message("main", capabilities.batteryLevel.battery.normal()) + ) + test.socket.matter:__queue_receive( + { + mock_device_battery_level.id, + clusters.PowerSource.attributes.BatChargeLevel:build_test_report_data( + mock_device_battery_level, 1, clusters.PowerSource.types.BatChargeLevelEnum.CRITICAL + ) + } + ) + test.socket.capability:__expect_send( + mock_device_battery_level:generate_test_message("main", capabilities.batteryLevel.battery.critical()) + ) + test.socket.matter:__queue_receive( + { + mock_device_battery_level.id, + clusters.PowerSource.attributes.BatChargeLevel:build_test_report_data( + mock_device_battery_level, 1, clusters.PowerSource.types.BatChargeLevelEnum.WARNING + ) + } + ) + test.socket.capability:__expect_send( + mock_device_battery_level:generate_test_message("main", capabilities.batteryLevel.battery.warning()) + ) + end, + { + test_init = test_init_battery_level, + min_api_version = 14 } ) diff --git a/drivers/SmartThings/matter-media/src/test/test_matter_media_speaker.lua b/drivers/SmartThings/matter-media/src/test/test_matter_media_speaker.lua index b795f6438a..85d8d8868b 100644 --- a/drivers/SmartThings/matter-media/src/test/test_matter_media_speaker.lua +++ b/drivers/SmartThings/matter-media/src/test/test_matter_media_speaker.lua @@ -126,7 +126,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -167,7 +167,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -213,7 +213,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -335,7 +335,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -366,7 +366,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) test.run_registered_tests() diff --git a/drivers/SmartThings/matter-media/src/test/test_matter_media_video_player.lua b/drivers/SmartThings/matter-media/src/test/test_matter_media_video_player.lua index dc3a4e4c08..c94b63275a 100644 --- a/drivers/SmartThings/matter-media/src/test/test_matter_media_video_player.lua +++ b/drivers/SmartThings/matter-media/src/test/test_matter_media_video_player.lua @@ -240,7 +240,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -278,7 +278,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -316,7 +316,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -354,7 +354,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -395,7 +395,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -436,7 +436,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -605,7 +605,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -638,7 +638,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -671,7 +671,7 @@ test.register_coroutine_test( mock_device_variable_speed:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-rvc/src/test/test_matter_rvc.lua b/drivers/SmartThings/matter-rvc/src/test/test_matter_rvc.lua index 626f7fea60..e1c95249a8 100644 --- a/drivers/SmartThings/matter-rvc/src/test/test_matter_rvc.lua +++ b/drivers/SmartThings/matter-rvc/src/test/test_matter_rvc.lua @@ -227,7 +227,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -243,7 +243,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -274,7 +274,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -302,7 +302,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -330,7 +330,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -357,7 +357,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -378,7 +378,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -419,7 +419,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -457,7 +457,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -521,7 +521,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -575,7 +575,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -632,7 +632,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -689,7 +689,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -743,7 +743,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -797,7 +797,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -1032,7 +1032,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -1068,7 +1068,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -1094,7 +1094,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -1120,7 +1120,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -1205,7 +1205,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-sensor/profiles/aqara-fp400.yml b/drivers/SmartThings/matter-sensor/profiles/aqara-fp400.yml index c2d5b7b037..d4c9fde930 100644 --- a/drivers/SmartThings/matter-sensor/profiles/aqara-fp400.yml +++ b/drivers/SmartThings/matter-sensor/profiles/aqara-fp400.yml @@ -12,3 +12,59 @@ components: version: 1 categories: - name: PresenceSensor +- id: sensor1 + capabilities: + - id: presenceSensor + version: 1 + optional: true + categories: + - name: PresenceSensor +- id: sensor2 + capabilities: + - id: presenceSensor + version: 1 + optional: true + categories: + - name: PresenceSensor +- id: sensor3 + capabilities: + - id: presenceSensor + version: 1 + optional: true + categories: + - name: PresenceSensor +- id: sensor4 + capabilities: + - id: presenceSensor + version: 1 + optional: true + categories: + - name: PresenceSensor +- id: sensor5 + capabilities: + - id: presenceSensor + version: 1 + optional: true + categories: + - name: PresenceSensor +- id: sensor6 + capabilities: + - id: presenceSensor + version: 1 + optional: true + categories: + - name: PresenceSensor +- id: sensor7 + capabilities: + - id: presenceSensor + version: 1 + optional: true + categories: + - name: PresenceSensor +- id: sensor8 + capabilities: + - id: presenceSensor + version: 1 + optional: true + categories: + - name: PresenceSensor diff --git a/drivers/SmartThings/matter-sensor/src/sensor_handlers/attribute_handlers.lua b/drivers/SmartThings/matter-sensor/src/sensor_handlers/attribute_handlers.lua index 1867d65e0b..514bb622cf 100644 --- a/drivers/SmartThings/matter-sensor/src/sensor_handlers/attribute_handlers.lua +++ b/drivers/SmartThings/matter-sensor/src/sensor_handlers/attribute_handlers.lua @@ -185,9 +185,9 @@ end function AttributeHandlers.occupancy_measured_value_handler(driver, device, ib, response) if device:supports_capability(capabilities.motionSensor) then - device:emit_event(ib.data.value == 0x01 and capabilities.motionSensor.motion.active() or capabilities.motionSensor.motion.inactive()) + device:emit_event_for_endpoint(ib.endpoint_id, ib.data.value == 0x01 and capabilities.motionSensor.motion.active() or capabilities.motionSensor.motion.inactive()) else - device:emit_event(ib.data.value == 0x01 and capabilities.presenceSensor.presence("present") or capabilities.presenceSensor.presence("not present")) + device:emit_event_for_endpoint(ib.endpoint_id, ib.data.value == 0x01 and capabilities.presenceSensor.presence("present") or capabilities.presenceSensor.presence("not present")) end end diff --git a/drivers/SmartThings/matter-sensor/src/sensor_utils/update_metadata_request.lua b/drivers/SmartThings/matter-sensor/src/sensor_utils/update_metadata_request.lua new file mode 100644 index 0000000000..abeb04e548 --- /dev/null +++ b/drivers/SmartThings/matter-sensor/src/sensor_utils/update_metadata_request.lua @@ -0,0 +1,45 @@ +-- Copyright 2026 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + +local UpdateMetadataRequest = {} +UpdateMetadataRequest.__index = UpdateMetadataRequest + +function UpdateMetadataRequest.init() + local update_metadata_request = setmetatable({}, UpdateMetadataRequest) + update_metadata_request.profile = nil + update_metadata_request.enabled_components = {} + return update_metadata_request +end + +function UpdateMetadataRequest:add_capabilities_to_component(component_id, capability_ids) + if not self.enabled_components[component_id] then + self.enabled_components[component_id] = {} + end + for _, capability_id in ipairs(capability_ids) do + table.insert(self.enabled_components[component_id], capability_id) + end + return self +end + +function UpdateMetadataRequest:add_profile(profile) + self.profile = profile + return self +end + +function UpdateMetadataRequest:formatted_enabled_components() + local formatted_enabled_components = {} + for component_id, capability_ids in pairs(self.enabled_components) do + table.insert(formatted_enabled_components, { component_id, capability_ids }) + end + return formatted_enabled_components +end + +function UpdateMetadataRequest:format_request() + local formatted_request = { + profile = self.profile, + optional_component_capabilities = self:formatted_enabled_components() + } + return formatted_request +end + +return UpdateMetadataRequest diff --git a/drivers/SmartThings/matter-sensor/src/sensor_utils/utils.lua b/drivers/SmartThings/matter-sensor/src/sensor_utils/utils.lua index 513c9f4602..75aa284aab 100644 --- a/drivers/SmartThings/matter-sensor/src/sensor_utils/utils.lua +++ b/drivers/SmartThings/matter-sensor/src/sensor_utils/utils.lua @@ -36,4 +36,48 @@ function utils.tbl_contains(array, value) return false end +--- Deeply compare two values. +--- Handles metatables. Can optionally ignore cycle checking and/or function differences. +--- +--- @param a any +--- @param b any +--- @param opts table|nil { ignore_functions = boolean, ignore_cycles = boolean } +--- @param seen table|nil +--- @return boolean +function utils.deep_equals(a, b, opts, seen) + if a == b then return true end -- same object + if type(a) ~= type(b) then return false end -- different type + if type(a) == "function" and opts and opts.ignore_functions then return true end + if type(a) ~= "table" then return false end -- same type but not table, thus was already compared + + -- check for cycles in table references and preserve reference topology. + if not (opts and opts.ignore_cycles) then + seen = seen or {} + seen[a] = seen[a] or {} + if seen[a][b] then + return seen[a][b] + end + seen[a][b] = true + end + + -- Compare keys/values from a + for k, v in pairs(a) do + if not utils.deep_equals(v, b[k], opts, seen) then + return false + end + end + + -- Ensure b doesn't have extra keys + for k in pairs(b) do + if a[k] == nil then + return false + end + end + + -- Compare metatables + local mt_a = getmetatable(a) + local mt_b = getmetatable(b) + return utils.deep_equals(mt_a, mt_b, opts, seen) +end + return utils diff --git a/drivers/SmartThings/matter-sensor/src/sub_drivers/air_quality_sensor/air_quality_sensor_handlers/attribute_handlers.lua b/drivers/SmartThings/matter-sensor/src/sub_drivers/air_quality_sensor/air_quality_sensor_handlers/attribute_handlers.lua index 345f7c5782..79315fc999 100644 --- a/drivers/SmartThings/matter-sensor/src/sub_drivers/air_quality_sensor/air_quality_sensor_handlers/attribute_handlers.lua +++ b/drivers/SmartThings/matter-sensor/src/sub_drivers/air_quality_sensor/air_quality_sensor_handlers/attribute_handlers.lua @@ -4,6 +4,7 @@ local st_utils = require "st.utils" local capabilities = require "st.capabilities" local aqs_fields = require "sub_drivers.air_quality_sensor.air_quality_sensor_utils.fields" +local aqs_utils = require "sub_drivers.air_quality_sensor.air_quality_sensor_utils.utils" local AirQualitySensorAttributeHandlers = {} @@ -24,19 +25,16 @@ end function AirQualitySensorAttributeHandlers.measured_value_factory(capability_name, attribute, target_unit) return function(driver, device, ib, response) - if ib.data.value then - local reporting_unit = device:get_field(capability_name.."_unit") or aqs_fields.unit_default[capability_name] - local conversion_function = aqs_fields.conversion_tables[reporting_unit][target_unit] - if conversion_function then - local converted_value = conversion_function(ib.data.value) - device:emit_event_for_endpoint(ib.endpoint_id, attribute({value = converted_value, unit = aqs_fields.unit_strings[target_unit]})) - -- handle case where device profile supports both fineDustLevel and dustLevel + if not ib.data.value then return end + local reporting_unit = device:get_field(capability_name.."_unit") or aqs_fields.unit_default[capability_name] + local converted_value = aqs_utils.convert_value_to_unit(ib.data.value, reporting_unit, target_unit, capability_name) + + if converted_value then + device:emit_event_for_endpoint(ib.endpoint_id, attribute({value = converted_value, unit = aqs_fields.unit_strings[target_unit]})) + -- handle case where device profile supports both fineDustLevel and dustLevel if capability_name == capabilities.fineDustSensor.NAME and device:supports_capability(capabilities.dustSensor) then device:emit_event_for_endpoint(ib.endpoint_id, capabilities.dustSensor.fineDustLevel({value = converted_value, unit = aqs_fields.unit_strings[target_unit]})) end - else - device.log.info_with({hub_logs=true}, string.format("Unsupported unit conversion from %s to %s", aqs_fields.unit_strings[reporting_unit], aqs_fields.unit_strings[target_unit])) - end end end end diff --git a/drivers/SmartThings/matter-sensor/src/sub_drivers/air_quality_sensor/air_quality_sensor_utils/device_configuration.lua b/drivers/SmartThings/matter-sensor/src/sub_drivers/air_quality_sensor/air_quality_sensor_utils/device_configuration.lua index a30eaed0f8..9a8215feff 100644 --- a/drivers/SmartThings/matter-sensor/src/sub_drivers/air_quality_sensor/air_quality_sensor_utils/device_configuration.lua +++ b/drivers/SmartThings/matter-sensor/src/sub_drivers/air_quality_sensor/air_quality_sensor_utils/device_configuration.lua @@ -30,53 +30,37 @@ function DeviceConfiguration.supported_level_measurements(device) return measurement_caps, level_caps end --- Match Modular Profile function DeviceConfiguration.match_profile(device) + local update_metadata_request = require "sensor_utils.update_metadata_request" + local temp_eps = embedded_cluster_utils.get_endpoints(device, clusters.TemperatureMeasurement.ID) local humidity_eps = embedded_cluster_utils.get_endpoints(device, clusters.RelativeHumidityMeasurement.ID) - local optional_supported_component_capabilities = {} - local main_component_capabilities = {} - local profile_name - local MAIN_COMPONENT_IDX = 1 - local CAPABILITIES_LIST_IDX = 2 + local updated_metadata = update_metadata_request.init() + local preference_tags = "" if #temp_eps > 0 then - table.insert(main_component_capabilities, capabilities.temperatureMeasurement.ID) + updated_metadata:add_capabilities_to_component("main", { capabilities.temperatureMeasurement.ID }) + preference_tags = preference_tags .. "-temp" end if #humidity_eps > 0 then - table.insert(main_component_capabilities, capabilities.relativeHumidityMeasurement.ID) + updated_metadata:add_capabilities_to_component("main", { capabilities.relativeHumidityMeasurement.ID }) + preference_tags = preference_tags .. "-humidity" end local measurement_caps, level_caps = DeviceConfiguration.supported_level_measurements(device) + updated_metadata:add_capabilities_to_component("main", measurement_caps) + updated_metadata:add_capabilities_to_component("main", level_caps) - for _, cap_id in ipairs(measurement_caps) do - table.insert(main_component_capabilities, cap_id) - end - - for _, cap_id in ipairs(level_caps) do - table.insert(main_component_capabilities, cap_id) - end - - table.insert(optional_supported_component_capabilities, {"main", main_component_capabilities}) - - if #temp_eps > 0 and #humidity_eps > 0 then - profile_name = "aqs-modular-temp-humidity" - elseif #temp_eps > 0 then - profile_name = "aqs-modular-temp" - elseif #humidity_eps > 0 then - profile_name = "aqs-modular-humidity" - else - profile_name = "aqs-modular" - end - - device:try_update_metadata({profile = profile_name, optional_component_capabilities = optional_supported_component_capabilities}) + device:try_update_metadata(updated_metadata:add_profile("aqs-modular" .. preference_tags):format_request()) -- earlier modular profile gating (min api v14, rpc 8) ensures we are running >= 0.57 FW. -- This gating specifies a workaround required only for 0.57 FW, which is not needed for 0.58 and higher. if version.api < 15 or version.rpc < 9 then + local MAIN_COMPONENT_IDX = 1 + local CAPABILITIES_LIST_IDX = 2 -- add mandatory capabilities for subscription - local total_supported_capabilities = optional_supported_component_capabilities + local total_supported_capabilities = updated_metadata:formatted_enabled_components() table.insert(total_supported_capabilities[MAIN_COMPONENT_IDX][CAPABILITIES_LIST_IDX], capabilities.airQualityHealthConcern.ID) table.insert(total_supported_capabilities[MAIN_COMPONENT_IDX][CAPABILITIES_LIST_IDX], capabilities.refresh.ID) table.insert(total_supported_capabilities[MAIN_COMPONENT_IDX][CAPABILITIES_LIST_IDX], capabilities.firmwareUpdate.ID) diff --git a/drivers/SmartThings/matter-sensor/src/sub_drivers/air_quality_sensor/air_quality_sensor_utils/fields.lua b/drivers/SmartThings/matter-sensor/src/sub_drivers/air_quality_sensor/air_quality_sensor_utils/fields.lua index 1e4658c99e..538af70968 100644 --- a/drivers/SmartThings/matter-sensor/src/sub_drivers/air_quality_sensor/air_quality_sensor_utils/fields.lua +++ b/drivers/SmartThings/matter-sensor/src/sub_drivers/air_quality_sensor/air_quality_sensor_utils/fields.lua @@ -1,8 +1,9 @@ -- Copyright © 2025 SmartThings, Inc. -- Licensed under the Apache License, Version 2.0 +local log = require "log" local version = require "version" -local utils = require "st.utils" +local st_utils = require "st.utils" local clusters = require "st.matter.clusters" local capabilities = require "st.capabilities" @@ -149,30 +150,64 @@ AirQualitySensorFields.level_strings = { [clusters.CarbonMonoxideConcentrationMeasurement.types.LevelValueEnum.CRITICAL] = "hazardous", } -AirQualitySensorFields.conversion_tables = { +AirQualitySensorFields.MGM3_PPM_CONVERSION_FACTOR = 24.45 + +-- measured in g/mol +AirQualitySensorFields.molecular_weights = { + [capabilities.carbonDioxideMeasurement.NAME] = 44.010, + [capabilities.nitrogenDioxideMeasurement.NAME] = 28.014, + [capabilities.ozoneMeasurement.NAME] = 48.0, + [capabilities.formaldehydeMeasurement.NAME] = 30.031, + [capabilities.veryFineDustSensor.NAME] = "N/A", + [capabilities.fineDustSensor.NAME] = "N/A", + [capabilities.dustSensor.NAME] = "N/A", + [capabilities.radonMeasurement.NAME] = 222.018, + [capabilities.tvocMeasurement.NAME] = "N/A", +} + +local function is_valid_molecular_weight(molecular_weight) + if type(molecular_weight) ~= "number" or molecular_weight <= 0 then + log.warn_with({hub_logs = true}, string.format("unit conversion molecular weight (%s) is not a valid number", molecular_weight)) + return false + end + return true +end + +AirQualitySensorFields.unit_conversion = { [units.PPM] = { - [units.PPM] = function(value) return utils.round(value) end, - [units.PPB] = function(value) return utils.round(value * (10^3)) end - }, + [units.PPM] = function(value) return st_utils.round(value) end, + [units.PPB] = function(value) return st_utils.round(value * (10^3)) end, + [units.UGM3] = function(value, molecular_weight) if is_valid_molecular_weight(molecular_weight) then + return st_utils.round((value * molecular_weight * 10^3) / AirQualitySensorFields.MGM3_PPM_CONVERSION_FACTOR) end + end, + [units.MGM3] = function(value, molecular_weight) if is_valid_molecular_weight(molecular_weight) then + return st_utils.round((value * molecular_weight) / AirQualitySensorFields.MGM3_PPM_CONVERSION_FACTOR) end + end,}, [units.PPB] = { - [units.PPM] = function(value) return utils.round(value/(10^3)) end, - [units.PPB] = function(value) return utils.round(value) end + [units.PPM] = function(value) return st_utils.round(value/(10^3)) end, + [units.PPB] = function(value) return st_utils.round(value) end, }, [units.PPT] = { - [units.PPM] = function(value) return utils.round(value/(10^6)) end + [units.PPM] = function(value) return st_utils.round(value/(10^6)) end }, [units.MGM3] = { - [units.UGM3] = function(value) return utils.round(value * (10^3)) end + [units.UGM3] = function(value) return st_utils.round(value * (10^3)) end, + [units.PPM] = function(value, molecular_weight) if is_valid_molecular_weight(molecular_weight) then + return st_utils.round((value * AirQualitySensorFields.MGM3_PPM_CONVERSION_FACTOR) / molecular_weight) end + end, }, [units.UGM3] = { - [units.UGM3] = function(value) return utils.round(value) end + [units.UGM3] = function(value) return st_utils.round(value) end, + [units.PPM] = function(value, molecular_weight) if is_valid_molecular_weight(molecular_weight) then + return st_utils.round((value * AirQualitySensorFields.MGM3_PPM_CONVERSION_FACTOR) / (molecular_weight * 10^3)) end + end, }, [units.NGM3] = { - [units.UGM3] = function(value) return utils.round(value/(10^3)) end + [units.UGM3] = function(value) return st_utils.round(value/(10^3)) end }, [units.BQM3] = { - [units.PCIL] = function(value) return utils.round(value/37) end - } + [units.PCIL] = function(value) return st_utils.round(value/37) end + }, } return AirQualitySensorFields diff --git a/drivers/SmartThings/matter-sensor/src/sub_drivers/air_quality_sensor/air_quality_sensor_utils/utils.lua b/drivers/SmartThings/matter-sensor/src/sub_drivers/air_quality_sensor/air_quality_sensor_utils/utils.lua index 0ce7ffb266..d206274314 100644 --- a/drivers/SmartThings/matter-sensor/src/sub_drivers/air_quality_sensor/air_quality_sensor_utils/utils.lua +++ b/drivers/SmartThings/matter-sensor/src/sub_drivers/air_quality_sensor/air_quality_sensor_utils/utils.lua @@ -1,6 +1,7 @@ -- Copyright 2025 SmartThings, Inc. -- Licensed under the Apache License, Version 2.0 +local log = require "log" local capabilities = require "st.capabilities" local clusters = require "st.matter.clusters" local embedded_cluster_utils = require "sensor_utils.embedded_cluster_utils" @@ -77,48 +78,16 @@ function AirQualitySensorUtils.set_supported_health_concern_values(device) end end ---- Deeply compare two values. ---- Handles metatables. Can optionally ignore cycle checking and/or function differences. ---- ---- @param a any ---- @param b any ---- @param opts table|nil { ignore_functions = boolean, ignore_cycles = boolean } ---- @param seen table|nil ---- @return boolean -function AirQualitySensorUtils.deep_equals(a, b, opts, seen) - if a == b then return true end -- same object - if type(a) ~= type(b) then return false end -- different type - if type(a) == "function" and opts and opts.ignore_functions then return true end - if type(a) ~= "table" then return false end -- same type but not table, thus was already compared - - -- check for cycles in table references and preserve reference topology. - if not (opts and opts.ignore_cycles) then - seen = seen or {} - seen[a] = seen[a] or {} - if seen[a][b] then - return seen[a][b] - end - seen[a][b] = true - end - - -- Compare keys/values from a - for k, v in pairs(a) do - if not AirQualitySensorUtils.deep_equals(v, b[k], opts, seen) then - return false - end +function AirQualitySensorUtils.convert_value_to_unit(value, from_unit, to_unit, capability_name) + local conversion_function = fields.unit_conversion[from_unit] and fields.unit_conversion[from_unit][to_unit] + if not conversion_function then + log.info_with( {hub_logs = true} , string.format("Unsupported unit conversion from %s to %s", fields.unit_strings[from_unit], fields.unit_strings[to_unit])) + return + elseif type(value) ~= "number" then + log.info_with( {hub_logs = true} , string.format("unit conversion value (%s) is not a number", value)) + return end - - -- Ensure b doesn't have extra keys - for k in pairs(b) do - if a[k] == nil then - return false - end - end - - -- Compare metatables - local mt_a = getmetatable(a) - local mt_b = getmetatable(b) - return AirQualitySensorUtils.deep_equals(mt_a, mt_b, opts, seen) + return conversion_function(value, fields.molecular_weights[capability_name]) end diff --git a/drivers/SmartThings/matter-sensor/src/sub_drivers/air_quality_sensor/init.lua b/drivers/SmartThings/matter-sensor/src/sub_drivers/air_quality_sensor/init.lua index 383af643a6..1ce1cc2176 100644 --- a/drivers/SmartThings/matter-sensor/src/sub_drivers/air_quality_sensor/init.lua +++ b/drivers/SmartThings/matter-sensor/src/sub_drivers/air_quality_sensor/init.lua @@ -4,6 +4,7 @@ local version = require "version" local capabilities = require "st.capabilities" local clusters = require "st.matter.clusters" +local sensor_utils = require "sensor_utils.utils" local aqs_utils = require "sub_drivers.air_quality_sensor.air_quality_sensor_utils.utils" local fields = require "sub_drivers.air_quality_sensor.air_quality_sensor_utils.fields" local attribute_handlers = require "sub_drivers.air_quality_sensor.air_quality_sensor_handlers.attribute_handlers" @@ -67,7 +68,7 @@ function AirQualitySensorLifecycleHandlers.device_init(driver, device) end function AirQualitySensorLifecycleHandlers.info_changed(driver, device, event, args) - if not aqs_utils.deep_equals(device.profile, args.old_st_store.profile, { ignore_functions = true }) then + if not sensor_utils.deep_equals(device.profile, args.old_st_store.profile, { ignore_functions = true }) then if device:get_field(fields.SUPPORTED_COMPONENT_CAPABILITIES) then --re-up subscription with new capabilities using the modular supports_capability override device:extend_device("supports_capability_by_id", aqs_utils.supports_capability_by_id_modular) diff --git a/drivers/SmartThings/matter-sensor/src/sub_drivers/aqara_fp400/init.lua b/drivers/SmartThings/matter-sensor/src/sub_drivers/aqara_fp400/init.lua index 5f47c86047..d9e9ad6378 100644 --- a/drivers/SmartThings/matter-sensor/src/sub_drivers/aqara_fp400/init.lua +++ b/drivers/SmartThings/matter-sensor/src/sub_drivers/aqara_fp400/init.lua @@ -1,21 +1,67 @@ -- Copyright 2026 SmartThings, Inc. -- Licensed under the Apache License, Version 2.0 +local capabilities = require "st.capabilities" +local sensor_utils = require "sensor_utils.utils" + +local COMPONENT_TO_ENDPOINT_MAP = "__COMPONENT_TO_ENDPOINT_MAP" + +local function endpoint_to_component(device, endpoint_id) + local map = device:get_field(COMPONENT_TO_ENDPOINT_MAP) or {} + for component_id, ep_id in pairs(map) do + if ep_id == endpoint_id then return component_id end + end + return "main" +end + +local function configure_profile(device) + local update_metadata_request = require "sensor_utils.update_metadata_request" + + local updated_component_to_endpoint_map = {} + local updated_metadata = update_metadata_request.init() + for _, ep in ipairs(device.endpoints) do + -- >2 since EP0 is the root node, EP1 is a permanent Presence Sensor, and EP2 is a permanent Light Sensor + if ep.endpoint_id > 2 then + local component_id = string.format("sensor%d", ep.endpoint_id - 2) -- ex. sensor1, sensor2, etc. for EP3, EP4, etc. + updated_component_to_endpoint_map[component_id] = ep.endpoint_id + updated_metadata:add_capabilities_to_component(component_id, { capabilities.presenceSensor.ID }) + end + end + device:set_field(COMPONENT_TO_ENDPOINT_MAP, updated_component_to_endpoint_map, { persist = true }) + device:try_update_metadata(updated_metadata:add_profile("aqara-fp400"):format_request()) +end + + local Fp400LifecycleHandlers = {} --- overwrite to avoid unnecessary metadata update calls -function Fp400LifecycleHandlers.do_configure() end +function Fp400LifecycleHandlers.do_configure(driver, device) + configure_profile(device) +end --- overwrite to avoid unnecessary metadata update calls function Fp400LifecycleHandlers.driver_switched(driver, device) + configure_profile(device) device:try_update_metadata({provisioning_state = "PROVISIONED"}) end +function Fp400LifecycleHandlers.info_changed(driver, device, event, args) + if not sensor_utils.deep_equals(args.old_st_store.endpoints, device.endpoints) then + configure_profile(device) + device:subscribe() + end +end + +function Fp400LifecycleHandlers.device_init(driver, device) + device:set_endpoint_to_component_fn(endpoint_to_component) + device:subscribe() +end + local aqara_fp400_handler = { NAME = "aqara-fp400", lifecycle_handlers = { doConfigure = Fp400LifecycleHandlers.do_configure, driverSwitched = Fp400LifecycleHandlers.driver_switched, + infoChanged = Fp400LifecycleHandlers.info_changed, + init = Fp400LifecycleHandlers.device_init, }, can_handle = require("sub_drivers.aqara_fp400.can_handle"), } diff --git a/drivers/SmartThings/matter-sensor/src/test/test_matter_air_quality_sensor.lua b/drivers/SmartThings/matter-sensor/src/test/test_matter_air_quality_sensor.lua index 8d3bd462a5..781854ee8b 100644 --- a/drivers/SmartThings/matter-sensor/src/test/test_matter_air_quality_sensor.lua +++ b/drivers/SmartThings/matter-sensor/src/test/test_matter_air_quality_sensor.lua @@ -499,7 +499,7 @@ test.register_coroutine_test( test_aqs_device_type_do_configure(mock_device, "aqs-temp-humidity-all-level-all-meas") end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -510,7 +510,7 @@ test.register_coroutine_test( end, { test_init = test_init_common, - min_api_version = 17 + min_api_version = 15 } ) @@ -521,7 +521,7 @@ test.register_coroutine_test( end, { test_init = test_init_level, - min_api_version = 17 + min_api_version = 15 } ) @@ -533,7 +533,7 @@ test.register_coroutine_test( end, { test_init = test_init_co_co2, - min_api_version = 17 + min_api_version = 15 } ) @@ -544,7 +544,7 @@ test.register_coroutine_test( end, { test_init = test_init_tvoc, - min_api_version = 17 + min_api_version = 15 } ) @@ -568,7 +568,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -590,7 +590,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -625,7 +625,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -695,7 +695,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -720,7 +720,7 @@ test.register_coroutine_test( end, { test_init = test_init_common, - min_api_version = 17 + min_api_version = 14 } ) @@ -828,7 +828,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/matter-sensor/src/test/test_matter_air_quality_sensor_modular.lua b/drivers/SmartThings/matter-sensor/src/test/test_matter_air_quality_sensor_modular.lua index 27921e0dec..4a18304d56 100644 --- a/drivers/SmartThings/matter-sensor/src/test/test_matter_air_quality_sensor_modular.lua +++ b/drivers/SmartThings/matter-sensor/src/test/test_matter_air_quality_sensor_modular.lua @@ -353,6 +353,7 @@ test.register_coroutine_test( end, { test_init = test_init_modular_fingerprint, + min_api_version = 15 } ) @@ -409,7 +410,7 @@ test.register_coroutine_test( end, { test_init = test_init_all, - min_api_version = 17 + min_api_version = 15 } ) @@ -439,7 +440,7 @@ test.register_coroutine_test( end, { test_init = test_init_common, - min_api_version = 17 + min_api_version = 15 } ) @@ -466,7 +467,10 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device_modular_fingerprint:generate_test_message("main", capabilities.airQualityHealthConcern.supportedAirQualityValues({"unknown", "good", "unhealthy", "moderate", "slightlyUnhealthy"}, {visibility={displayed=false}}))) test.socket.matter:__expect_send({mock_device_modular_fingerprint.id, subscribe_request_tvoc}) end, - { test_init = test_init_modular_fingerprint } + { + test_init = test_init_modular_fingerprint, + min_api_version = 15 + } ) test.register_coroutine_test( @@ -475,7 +479,10 @@ test.register_coroutine_test( -- simulate no actual change test.socket.device_lifecycle:__queue_receive(mock_device_modular_fingerprint:generate_info_changed({})) end, - { test_init = test_init_modular_fingerprint } + { + test_init = test_init_modular_fingerprint, + min_api_version = 15 + } ) test.register_coroutine_test( @@ -501,7 +508,10 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device_modular_fingerprint:generate_test_message("main", capabilities.airQualityHealthConcern.supportedAirQualityValues({"unknown", "good", "unhealthy", "moderate", "slightlyUnhealthy"}, {visibility={displayed=false}}))) test.socket.matter:__expect_send({mock_device_modular_fingerprint.id, subscribe_request_tvoc}) end, - { test_init = test_init_modular_fingerprint } + { + test_init = test_init_modular_fingerprint, + min_api_version = 15 + } ) test.register_coroutine_test( @@ -510,7 +520,10 @@ test.register_coroutine_test( -- simulate no actual change test.socket.device_lifecycle:__queue_receive(mock_device_modular_fingerprint:generate_info_changed({})) end, - { test_init = test_init_modular_fingerprint } + { + test_init = test_init_modular_fingerprint, + min_api_version = 15 + } ) -- run tests diff --git a/drivers/SmartThings/matter-sensor/src/test/test_matter_aqara_fp400.lua b/drivers/SmartThings/matter-sensor/src/test/test_matter_aqara_fp400.lua index 7f384c744e..6ce8abf91d 100644 --- a/drivers/SmartThings/matter-sensor/src/test/test_matter_aqara_fp400.lua +++ b/drivers/SmartThings/matter-sensor/src/test/test_matter_aqara_fp400.lua @@ -2,9 +2,11 @@ -- Licensed under the Apache License, Version 2.0 local test = require "integration_test" +local st_utils = require "st.utils" local capabilities = require "st.capabilities" local clusters = require "st.matter.clusters" local t_utils = require "integration_test.utils" +local sensor_utils = require "sensor_utils.utils" local matter_endpoints = { { @@ -20,16 +22,49 @@ local matter_endpoints = { endpoint_id = 1, clusters = { {cluster_id = clusters.OccupancySensing.ID, cluster_type = "SERVER"}, + }, + device_types = { + {device_type_id = 0x0107, device_type_revision = 1} -- Occupancy Sensor + } + }, + { + endpoint_id = 2, + clusters = { {cluster_id = clusters.IlluminanceMeasurement.ID, cluster_type = "SERVER"}, }, + device_types = { + {device_type_id = 0x0106, device_type_revision = 1} -- Light Sensor + } + }, + { + endpoint_id = 3, + clusters = { + {cluster_id = clusters.OccupancySensing.ID, cluster_type = "SERVER"}, + }, device_types = { {device_type_id = 0x0107, device_type_revision = 1} -- Occupancy Sensor } - } + }, + { + endpoint_id = 5, + clusters = { + {cluster_id = clusters.OccupancySensing.ID, cluster_type = "SERVER"}, + }, + device_types = { + {device_type_id = 0x0107, device_type_revision = 1} -- Occupancy Sensor + } + }, +} + +local enabled_optional_component_capability_pairs = { + { "sensor1", { capabilities.presenceSensor.ID } }, + { "sensor3", { capabilities.presenceSensor.ID } } } local mock_device = test.mock_device.build_test_matter_device({ - profile = t_utils.get_profile_definition("aqara-fp400.yml"), + profile = t_utils.get_profile_definition("aqara-fp400.yml", + { enabled_optional_capabilities = enabled_optional_component_capability_pairs } + ), manufacturer_info = { vendor_id = 0x115F, product_id = 0x2009, @@ -37,31 +72,34 @@ local mock_device = test.mock_device.build_test_matter_device({ endpoints = matter_endpoints }) -local function subscribe_on_init(dev) +local function do_subscribe(dev) local subscribe_request = clusters.OccupancySensing.attributes.Occupancy:subscribe(dev) subscribe_request:merge(clusters.IlluminanceMeasurement.attributes.MeasuredValue:subscribe(dev)) return subscribe_request end local function test_init() - test.socket.matter:__set_channel_ordering("relaxed") - local subscribe_request = subscribe_on_init(mock_device) + local subscribe_request = do_subscribe(mock_device) test.socket.matter:__expect_send({mock_device.id, subscribe_request}) test.mock_device.add_test_device(mock_device) end test.set_test_init_function(test_init) test.register_coroutine_test( - "Test no profile change on doConfigure for FP400", + "Test profile change on doConfigure for FP400", function() test.socket.device_lifecycle:__queue_receive({ mock_device.id, "doConfigure" }) - -- The FP400 sub-driver overrides doConfigure to be a no-op -- When doConfigure completes successfully, the framework automatically provisions the device + mock_device:expect_metadata_update({ profile = "aqara-fp400", optional_component_capabilities = enabled_optional_component_capability_pairs }) mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) test.wait_for_events() + assert(sensor_utils.deep_equals(st_utils.deep_copy(mock_device:get_field("__COMPONENT_TO_ENDPOINT_MAP")), { + sensor1 = 3, + sensor3 = 5 + }), "Component to endpoint map should be set correctly on doConfigure") end, { - min_api_version = 17 + min_api_version = 21 } ) @@ -70,20 +108,21 @@ test.register_coroutine_test( function() local current_profile = mock_device.profile.id test.socket.device_lifecycle:__queue_receive({ mock_device.id, "driverSwitched" }) - -- The FP400 sub-driver overrides driverSwitched to only update provisioning state + mock_device:expect_metadata_update({ profile = "aqara-fp400", optional_component_capabilities = enabled_optional_component_capability_pairs }) mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) -- Ensure profile has not changed test.wait_for_events() assert(mock_device.profile.id == current_profile, "Profile should not change on driverSwitched") end, { - min_api_version = 17 + min_api_version = 21 } ) test.register_message_test( "Occupancy reports should generate correct presence messages", { + -- from EP1 { channel = "matter", direction = "receive", @@ -109,10 +148,73 @@ test.register_message_test( channel = "capability", direction = "send", message = mock_device:generate_test_message("main", capabilities.presenceSensor.presence("not present")) - } + }, + -- from EP3 + { + channel = "matter", + direction = "receive", + message = { + mock_device.id, + clusters.OccupancySensing.attributes.Occupancy:build_test_report_data(mock_device, 3, 1) + } + }, + { + channel = "capability", + direction = "send", + message = mock_device:generate_test_message("sensor1", capabilities.presenceSensor.presence("present")) + }, + { + channel = "matter", + direction = "receive", + message = { + mock_device.id, + clusters.OccupancySensing.attributes.Occupancy:build_test_report_data(mock_device, 3, 0) + } + }, + { + channel = "capability", + direction = "send", + message = mock_device:generate_test_message("sensor1", capabilities.presenceSensor.presence("not present")) + }, + -- from EP5 + { + channel = "matter", + direction = "receive", + message = { + mock_device.id, + clusters.OccupancySensing.attributes.Occupancy:build_test_report_data(mock_device, 5, 1) + } + }, + { + channel = "capability", + direction = "send", + message = mock_device:generate_test_message("sensor3", capabilities.presenceSensor.presence("present")) + }, + { + channel = "matter", + direction = "receive", + message = { + mock_device.id, + clusters.OccupancySensing.attributes.Occupancy:build_test_report_data(mock_device, 5, 0) + } + }, + { + channel = "capability", + direction = "send", + message = mock_device:generate_test_message("sensor3", capabilities.presenceSensor.presence("not present")) + }, }, { - min_api_version = 17 + test_init = function () + local subscribe_request = do_subscribe(mock_device) + test.socket.matter:__expect_send({mock_device.id, subscribe_request}) + test.mock_device.add_test_device(mock_device) + -- we can assume this will be set elsewhere-- see other tests. + mock_device:set_field("__COMPONENT_TO_ENDPOINT_MAP", + { sensor1 = 3, sensor3 = 5 }, { persist = true } + ) + end, + min_api_version = 14 } ) @@ -124,7 +226,7 @@ test.register_message_test( direction = "receive", message = { mock_device.id, - clusters.IlluminanceMeasurement.attributes.MeasuredValue:build_test_report_data(mock_device, 1, 21370) + clusters.IlluminanceMeasurement.attributes.MeasuredValue:build_test_report_data(mock_device, 2, 21370) } }, { @@ -134,7 +236,71 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 + } +) + +test.register_coroutine_test( + "Test profile change on endpoints increment in infoChanged for FP400", + function() + local current_profile_id = mock_device.profile.id + local incremented_matter_endpoints = matter_endpoints + table.insert(incremented_matter_endpoints, { + endpoint_id = 4, + clusters = { + {cluster_id = clusters.OccupancySensing.ID, cluster_type = "SERVER"}, + }, + device_types = { + {device_type_id = 0x0107, device_type_revision = 1} -- Occupancy Sensor + } + }) + local incremented_enabled_optional_component_capability_pairs = { + { "sensor1", { capabilities.presenceSensor.ID } }, + { "sensor3", { capabilities.presenceSensor.ID } }, + { "sensor2", { capabilities.presenceSensor.ID } }, + } + test.socket.device_lifecycle:__queue_receive(mock_device:generate_info_changed({ endpoints = incremented_matter_endpoints })) + mock_device:expect_metadata_update({ profile = "aqara-fp400", optional_component_capabilities = incremented_enabled_optional_component_capability_pairs }) + local subscribe_request = do_subscribe(mock_device) + test.socket.matter:__expect_send({mock_device.id, subscribe_request}) + -- Ensure profile has not changed + test.wait_for_events() + assert(mock_device.profile.id == current_profile_id, "Profile should not change on infoChanged") + assert(sensor_utils.deep_equals(st_utils.deep_copy(mock_device:get_field("__COMPONENT_TO_ENDPOINT_MAP")), { + sensor1 = 3, + sensor3 = 5, + sensor2 = 4 + }), "Component to endpoint map should be set correctly on doConfigure") + end, + { + min_api_version = 21 + } +) + +test.register_coroutine_test( + "Test profile change on endpoints decrement in infoChanged for FP400", + function() + local current_profile_id = mock_device.profile.id + local decremented_matter_endpoints = matter_endpoints + table.remove(decremented_matter_endpoints, 4) -- remove EP3 + local decremented_enabled_optional_component_capability_pairs = { + { "sensor3", { capabilities.presenceSensor.ID } }, + { "sensor2", { capabilities.presenceSensor.ID } }, + } + test.socket.device_lifecycle:__queue_receive(mock_device:generate_info_changed({ endpoints = decremented_matter_endpoints })) + mock_device:expect_metadata_update({ profile = "aqara-fp400", optional_component_capabilities = decremented_enabled_optional_component_capability_pairs }) + local subscribe_request = do_subscribe(mock_device) + test.socket.matter:__expect_send({mock_device.id, subscribe_request}) + -- Ensure profile has not changed + test.wait_for_events() + assert(mock_device.profile.id == current_profile_id, "Profile should not change on infoChanged") + assert(sensor_utils.deep_equals(st_utils.deep_copy(mock_device:get_field("__COMPONENT_TO_ENDPOINT_MAP")), { + sensor3 = 5, + sensor2 = 4 + }), "Component to endpoint map should be set correctly on doConfigure") + end, + { + min_api_version = 21 } ) diff --git a/drivers/SmartThings/matter-sensor/src/test/test_matter_bosch_button_contact.lua b/drivers/SmartThings/matter-sensor/src/test/test_matter_bosch_button_contact.lua index 644c4088e1..d592a9089e 100644 --- a/drivers/SmartThings/matter-sensor/src/test/test_matter_bosch_button_contact.lua +++ b/drivers/SmartThings/matter-sensor/src/test/test_matter_bosch_button_contact.lua @@ -82,7 +82,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -120,7 +120,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -168,7 +168,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -192,7 +192,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -232,7 +232,7 @@ test.register_message_test( }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -257,7 +257,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -292,7 +292,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/matter-sensor/src/test/test_matter_flow_sensor.lua b/drivers/SmartThings/matter-sensor/src/test/test_matter_flow_sensor.lua index dd4eb87252..952989f6a1 100644 --- a/drivers/SmartThings/matter-sensor/src/test/test_matter_flow_sensor.lua +++ b/drivers/SmartThings/matter-sensor/src/test/test_matter_flow_sensor.lua @@ -71,7 +71,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -101,7 +101,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -133,7 +133,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/matter-sensor/src/test/test_matter_freeze_leak_sensor.lua b/drivers/SmartThings/matter-sensor/src/test/test_matter_freeze_leak_sensor.lua index 02e5815c06..5cd5e85950 100644 --- a/drivers/SmartThings/matter-sensor/src/test/test_matter_freeze_leak_sensor.lua +++ b/drivers/SmartThings/matter-sensor/src/test/test_matter_freeze_leak_sensor.lua @@ -99,7 +99,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -135,7 +135,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -170,7 +170,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -191,7 +191,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -211,7 +211,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -244,7 +244,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-sensor/src/test/test_matter_pressure_sensor.lua b/drivers/SmartThings/matter-sensor/src/test/test_matter_pressure_sensor.lua index 13bd93ed70..8920bfcf7f 100644 --- a/drivers/SmartThings/matter-sensor/src/test/test_matter_pressure_sensor.lua +++ b/drivers/SmartThings/matter-sensor/src/test/test_matter_pressure_sensor.lua @@ -94,7 +94,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -116,7 +116,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -148,7 +148,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) test.run_registered_tests() diff --git a/drivers/SmartThings/matter-sensor/src/test/test_matter_rain_sensor.lua b/drivers/SmartThings/matter-sensor/src/test/test_matter_rain_sensor.lua index 2b942c6f0c..6e8c11099d 100644 --- a/drivers/SmartThings/matter-sensor/src/test/test_matter_rain_sensor.lua +++ b/drivers/SmartThings/matter-sensor/src/test/test_matter_rain_sensor.lua @@ -96,7 +96,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -131,7 +131,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-sensor/src/test/test_matter_sensor.lua b/drivers/SmartThings/matter-sensor/src/test/test_matter_sensor.lua index d6024f61be..8e9b8580d9 100644 --- a/drivers/SmartThings/matter-sensor/src/test/test_matter_sensor.lua +++ b/drivers/SmartThings/matter-sensor/src/test/test_matter_sensor.lua @@ -163,7 +163,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -185,7 +185,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -207,7 +207,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -242,7 +242,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -264,7 +264,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -299,7 +299,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -336,7 +336,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -366,7 +366,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -381,7 +381,7 @@ test.register_coroutine_test( end, { test_init = test_init_presence_sensor, - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-sensor/src/test/test_matter_sensor_battery.lua b/drivers/SmartThings/matter-sensor/src/test/test_matter_sensor_battery.lua index 0709be6a31..7393937682 100644 --- a/drivers/SmartThings/matter-sensor/src/test/test_matter_sensor_battery.lua +++ b/drivers/SmartThings/matter-sensor/src/test/test_matter_sensor_battery.lua @@ -88,7 +88,7 @@ test.register_coroutine_test( mock_device_humidity_battery:expect_metadata_update({ profile = "humidity-battery" }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -116,7 +116,7 @@ test.register_coroutine_test( mock_device_humidity_battery:expect_metadata_update({ profile = "humidity-batteryLevel" }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -142,7 +142,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-sensor/src/test/test_matter_sensor_featuremap.lua b/drivers/SmartThings/matter-sensor/src/test/test_matter_sensor_featuremap.lua index 0a02bbb27f..df9ab678cb 100644 --- a/drivers/SmartThings/matter-sensor/src/test/test_matter_sensor_featuremap.lua +++ b/drivers/SmartThings/matter-sensor/src/test/test_matter_sensor_featuremap.lua @@ -171,7 +171,7 @@ test.register_coroutine_test( end, { test_init = test_init_humidity_battery, - min_api_version = 17 + min_api_version = 15 } ) @@ -181,7 +181,7 @@ test.register_coroutine_test( end, { test_init = test_init_humidity_no_battery, - min_api_version = 17 + min_api_version = 15 } ) @@ -191,7 +191,7 @@ test.register_coroutine_test( end, { test_init = test_init_temp_humidity, - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-sensor/src/test/test_matter_sensor_rpc.lua b/drivers/SmartThings/matter-sensor/src/test/test_matter_sensor_rpc.lua index 6ca73351c9..1093c1be76 100644 --- a/drivers/SmartThings/matter-sensor/src/test/test_matter_sensor_rpc.lua +++ b/drivers/SmartThings/matter-sensor/src/test/test_matter_sensor_rpc.lua @@ -71,7 +71,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-sensor/src/test/test_matter_smoke_co_alarm.lua b/drivers/SmartThings/matter-sensor/src/test/test_matter_smoke_co_alarm.lua index aeef7b15f9..2170115366 100644 --- a/drivers/SmartThings/matter-sensor/src/test/test_matter_smoke_co_alarm.lua +++ b/drivers/SmartThings/matter-sensor/src/test/test_matter_smoke_co_alarm.lua @@ -124,7 +124,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -172,7 +172,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -220,7 +220,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -281,7 +281,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -342,7 +342,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -390,7 +390,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -435,7 +435,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -470,7 +470,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -492,7 +492,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -527,7 +527,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -578,7 +578,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-sensor/src/test/test_matter_smoke_co_alarm_battery.lua b/drivers/SmartThings/matter-sensor/src/test/test_matter_smoke_co_alarm_battery.lua index 3c8102064e..1b96842797 100644 --- a/drivers/SmartThings/matter-sensor/src/test/test_matter_smoke_co_alarm_battery.lua +++ b/drivers/SmartThings/matter-sensor/src/test/test_matter_smoke_co_alarm_battery.lua @@ -92,7 +92,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ profile = "smoke-co-temp-humidity-comeas-battery" }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -107,7 +107,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -127,7 +127,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-sensor/src/test/test_matter_soil_sensor.lua b/drivers/SmartThings/matter-sensor/src/test/test_matter_soil_sensor.lua index a5a8042fc0..dbdc25527e 100644 --- a/drivers/SmartThings/matter-sensor/src/test/test_matter_soil_sensor.lua +++ b/drivers/SmartThings/matter-sensor/src/test/test_matter_soil_sensor.lua @@ -80,7 +80,10 @@ test.register_coroutine_test( test.socket.device_lifecycle:__queue_receive(mock_device:generate_info_changed({ profile = updated_device_profile })) test.socket.matter:__expect_send({mock_device.id, subscribe_request}) end -) +, + { + min_api_version = 15 + }) test.register_coroutine_test( "Relative humidity reports should generate correct messages", @@ -105,7 +108,10 @@ test.register_coroutine_test( mock_device:generate_test_message("main", capabilities.relativeHumidityMeasurement.humidity({ value = 41 })) ) end -) +, + { + min_api_version = 15 + }) test.register_coroutine_test( "Temperature reports should generate correct messages", @@ -120,7 +126,10 @@ test.register_coroutine_test( mock_device:generate_test_message("main", capabilities.temperatureMeasurement.temperature({ value = 40.0, unit = "C" })) ) end -) +, + { + min_api_version = 15 + }) test.register_coroutine_test( "Min and max temperature attributes set capability constraint", @@ -144,7 +153,10 @@ test.register_coroutine_test( ) ) end -) +, + { + min_api_version = 15 + }) test.register_coroutine_test( "Soil moisture is reported raw when no limits are set", @@ -159,7 +171,10 @@ test.register_coroutine_test( mock_device:generate_test_message("main", capabilities.relativeHumidityMeasurement.humidity({ value = 55 })) ) end -) +, + { + min_api_version = 15 + }) local function build_soil_moisture_limits(min_value, max_value) if version.api < 21 then @@ -194,7 +209,10 @@ test.register_coroutine_test( mock_device:generate_test_message("main", capabilities.relativeHumidityMeasurement.humidity({ value = 25 })) ) end -) +, + { + min_api_version = 17 + }) test.register_coroutine_test( "Soil moisture scaling rounds correctly", @@ -224,6 +242,9 @@ test.register_coroutine_test( mock_device:generate_test_message("main", capabilities.relativeHumidityMeasurement.humidity({ value = 90 })) ) end -) +, + { + min_api_version = 17 + }) test.run_registered_tests() diff --git a/drivers/SmartThings/matter-sensor/src/test/test_unsupported_unit_conversion.lua b/drivers/SmartThings/matter-sensor/src/test/test_unsupported_unit_conversion.lua new file mode 100644 index 0000000000..2e79f88dd7 --- /dev/null +++ b/drivers/SmartThings/matter-sensor/src/test/test_unsupported_unit_conversion.lua @@ -0,0 +1,63 @@ +-- Copyright © 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + +local test = require "integration_test" +local capabilities = require "st.capabilities" + +-- Unit conversion utilities for sensor +local air_quality_sensor_utils = require "sub_drivers.air_quality_sensor.air_quality_sensor_utils.utils" +local air_quality_sensor_fields = require "sub_drivers.air_quality_sensor.air_quality_sensor_utils.fields" + +local units = air_quality_sensor_fields.units + +test.register_coroutine_test( + "Unsupported unit conversion from PPT to MGM3 should return nil", + function() + local result = air_quality_sensor_utils.convert_value_to_unit(100, units.PPT, units.MGM3, capabilities.ozoneMeasurement.NAME) + assert(result == nil, "Expected nil for unsupported PPT to MGM3 conversion, got: " .. tostring(result)) + end +) + +test.register_coroutine_test( + "Unsupported unit conversion from PPB to UGM3 should return nil", + function() + local result = air_quality_sensor_utils.convert_value_to_unit(100, units.PPB, units.UGM3, capabilities.carbonMonoxideMeasurement.NAME) + assert(result == nil, "Expected nil for unsupported PPB to UGM3 conversion, got: " .. tostring(result)) + end +) + +test.register_coroutine_test( + "Unsupported unit conversion from NGM3 to PPM should return nil", + function() + local result = air_quality_sensor_utils.convert_value_to_unit(100, units.NGM3, units.PPM, capabilities.carbonMonoxideMeasurement.NAME) + assert(result == nil, "Expected nil for unsupported NGM3 to PPM conversion, got: " .. tostring(result)) + end +) + +test.register_coroutine_test( + "Supported unit conversion from PPM to PPB should return correct value", + function() + local result = air_quality_sensor_utils.convert_value_to_unit(100, units.PPM, units.PPB, capabilities.carbonMonoxideMeasurement.NAME) + assert(result ~= nil, "Expected a value for supported PPM to PPB conversion") + assert(result == 100000, "Expected 100000 for PPM to PPB conversion, got: " .. tostring(result)) + end +) + +test.register_coroutine_test( + "Supported unit conversion from PPB to PPM should return correct value", + function() + local result = air_quality_sensor_utils.convert_value_to_unit(1000, units.PPB, units.PPM, capabilities.carbonMonoxideMeasurement.NAME) + assert(result ~= nil, "Expected a value for supported PPB to PPM conversion") + assert(result == 1, "Expected 1 for PPB to PPM conversion, got: " .. tostring(result)) + end +) + +test.register_coroutine_test( + "Unit conversion with non-numeric value should return nil", + function() + local result = air_quality_sensor_utils.convert_value_to_unit("not a number", units.PPM, units.PPB, capabilities.carbonMonoxideMeasurement.NAME) + assert(result == nil, "Expected nil when value is not a number, got: " .. tostring(result)) + end +) + +test.run_registered_tests() diff --git a/drivers/SmartThings/matter-switch/fingerprints.yml b/drivers/SmartThings/matter-switch/fingerprints.yml index 6a4321c1a5..dbfe3156b7 100644 --- a/drivers/SmartThings/matter-switch/fingerprints.yml +++ b/drivers/SmartThings/matter-switch/fingerprints.yml @@ -809,7 +809,7 @@ matterManufacturer: productId: 0x6870 deviceProfileName: light-color-level - id: "4999/26272" - deviceLabel: Govee TV Backlight 3 Pro 55-65 + deviceLabel: Govee TV Backlight 3 PRO / 3S PRO vendorId: 0x1387 productId: 0x66A0 deviceProfileName: light-color-level @@ -898,6 +898,56 @@ matterManufacturer: vendorId: 0x1387 productId: 0x60B3 deviceProfileName: light-color-level + - id: "4999/10240" + deviceLabel: Govee Monitor Light Bar + vendorId: 0x1387 + productId: 0x2800 + deviceProfileName: light-color-level + - id: "4999/6833" + deviceLabel: Govee COB Strip Light 2 9.8ft/3m + vendorId: 0x1387 + productId: 0x1AB1 + deviceProfileName: light-color-level + - id: "4999/6834" + deviceLabel: Govee COB Strip Light 2 16.4ft/5m + vendorId: 0x1387 + productId: 0x1AB2 + deviceProfileName: light-color-level + - id: "4999/6835" + deviceLabel: Govee COB Strip Light 2 32.8ft/10m + vendorId: 0x1387 + productId: 0x1AB3 + deviceProfileName: light-color-level + - id: "4999/6818" + deviceLabel: Govee COB Strip Light 2 Pro 6.5ft/2m + vendorId: 0x1387 + productId: 0x1AA2 + deviceProfileName: light-color-level + - id: "4999/6821" + deviceLabel: Govee COB Strip Light 2 Pro 16.4ft/5m + vendorId: 0x1387 + productId: 0x1AA5 + deviceProfileName: light-color-level + - id: "4999/6723" + deviceLabel: Govee Strip Light 2 + vendorId: 0x1387 + productId: 0x1A43 + deviceProfileName: light-color-level + - id: "4999/6001" + deviceLabel: Govee Wallwash Table Lamp + vendorId: 0x1387 + productId: 0x1771 + deviceProfileName: light-color-level + - id: "4999/6161" + deviceLabel: Govee Bubble Projector Light + vendorId: 0x1387 + productId: 0x1811 + deviceProfileName: light-color-level + - id: "4999/10816" + deviceLabel: Govee TV Backlight 3 + vendorId: 0x1387 + productId: 0x2A40 + deviceProfileName: light-color-level # Hager - id: "4741/8" deviceLabel: Hager matter 2 buttons (battery) @@ -1639,6 +1689,11 @@ matterManufacturer: vendorId: 0x143D productId: 0x1001 deviceProfileName: plug-binary + - id: "5181/4098" + deviceLabel: Onvis Outlet T20 + vendorId: 0x143D + productId: 0x1002 + deviceProfileName: plug-power-energy-powerConsumption #Osram - id: "4489/2564" deviceLabel: OSRAM MATTER PLUG UK @@ -2120,6 +2175,16 @@ matterManufacturer: vendorId: 0x1189 productId: 0x1001 deviceProfileName: light-color-level + - id: "4489/4573" + deviceLabel: OSRAM IRIS + vendorId: 0x1189 + productId: 0x11DD + deviceProfileName: light-color-level + - id: "4489/4572" + deviceLabel: OSRAM GISELA + vendorId: 0x1189 + productId: 0x11DC + deviceProfileName: light-color-level #Shelly - id: "5264/1" deviceLabel: Shelly Plug S MTR Gen3 diff --git a/drivers/SmartThings/matter-switch/profiles/ikea-scroll.yml b/drivers/SmartThings/matter-switch/profiles/ikea-scroll.yml index 973c789ac6..1793ae209e 100644 --- a/drivers/SmartThings/matter-switch/profiles/ikea-scroll.yml +++ b/drivers/SmartThings/matter-switch/profiles/ikea-scroll.yml @@ -33,6 +33,13 @@ components: version: 1 categories: - name: Button +preferences: + - preferenceId: knobSensitivityGroup1 + explicit: true + - preferenceId: knobSensitivityGroup2 + explicit: true + - preferenceId: knobSensitivityGroup3 + explicit: true metadata: mnmn: SmartThingsEdge - vid: ikea-scroll \ No newline at end of file + vid: ikea-scroll diff --git a/drivers/SmartThings/matter-switch/src/embedded_clusters/ElectricalEnergyMeasurement/types/EnergyMeasurementStruct.lua b/drivers/SmartThings/matter-switch/src/embedded_clusters/ElectricalEnergyMeasurement/types/EnergyMeasurementStruct.lua index a4c58a3646..5452b287ac 100644 --- a/drivers/SmartThings/matter-switch/src/embedded_clusters/ElectricalEnergyMeasurement/types/EnergyMeasurementStruct.lua +++ b/drivers/SmartThings/matter-switch/src/embedded_clusters/ElectricalEnergyMeasurement/types/EnergyMeasurementStruct.lua @@ -42,6 +42,20 @@ EnergyMeasurementStruct.field_defs = { is_optional = true, data_type = require "st.matter.data_types.Uint64", }, + { + name = "apparent_energy", + field_id = 5, + is_nullable = false, + is_optional = true, + data_type = require "st.matter.data_types.Int64", + }, + { + name = "reactive_energy", + field_id = 6, + is_nullable = false, + is_optional = true, + data_type = require "st.matter.data_types.Int64", + }, } EnergyMeasurementStruct.init = function(cls, tbl) @@ -49,10 +63,10 @@ EnergyMeasurementStruct.init = function(cls, tbl) o.elements = {} o.num_elements = 0 setmetatable(o, new_mt) - for idx, field_def in ipairs(cls.field_defs) do + for _idx, field_def in ipairs(cls.field_defs) do if (not field_def.is_optional and not field_def.is_nullable) and not tbl[field_def.name] then error("Missing non optional or non_nullable field: " .. field_def.name) - else + elseif not (field_def.is_optional and tbl[field_def.name] == nil) then o.elements[field_def.name] = data_types.validate_or_build_type(tbl[field_def.name], field_def.data_type, field_def.name) o.elements[field_def.name].field_id = field_def.field_id o.num_elements = o.num_elements + 1 @@ -71,7 +85,7 @@ new_mt.__index.serialize = EnergyMeasurementStruct.serialize EnergyMeasurementStruct.augment_type = function(self, val) local elems = {} local num_elements = 0 - for _, v in pairs(val.elements) do + for _, v in pairs(val.elements or {}) do for _, field_def in ipairs(self.field_defs) do if field_def.field_id == v.field_id and field_def.is_nullable and @@ -79,11 +93,11 @@ EnergyMeasurementStruct.augment_type = function(self, val) elems[field_def.name] = data_types.validate_or_build_type(v, data_types.Null, field_def.field_name) num_elements = num_elements + 1 elseif field_def.field_id == v.field_id and not - (field_def.is_optional and v.value == nil) then + (field_def.is_optional and v.value == nil and v.elements == nil) then elems[field_def.name] = data_types.validate_or_build_type(v, field_def.data_type, field_def.field_name) num_elements = num_elements + 1 if field_def.element_type ~= nil then - for i, e in ipairs(elems[field_def.name].elements) do + for i, e in ipairs(elems[field_def.name].elements or {}) do elems[field_def.name].elements[i] = data_types.validate_or_build_type(e, field_def.element_type) end end diff --git a/drivers/SmartThings/matter-switch/src/init.lua b/drivers/SmartThings/matter-switch/src/init.lua index 9d4e22fb15..adebbb0ec1 100644 --- a/drivers/SmartThings/matter-switch/src/init.lua +++ b/drivers/SmartThings/matter-switch/src/init.lua @@ -29,6 +29,11 @@ if version.api < 16 then clusters.Descriptor = require "embedded_clusters.Descriptor" end +-- Catch nil elements errors gracefully without receiving a coroutine error +if version.api < 21 then + clusters.ElectricalEnergyMeasurement.types.EnergyMeasurementStruct = require "embedded_clusters.ElectricalEnergyMeasurement.types.EnergyMeasurementStruct" +end + local SwitchLifecycleHandlers = {} function SwitchLifecycleHandlers.device_added(driver, device) diff --git a/drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_handlers/attribute_handlers.lua b/drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_handlers/attribute_handlers.lua index 53b35712e7..075f5cc487 100644 --- a/drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_handlers/attribute_handlers.lua +++ b/drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_handlers/attribute_handlers.lua @@ -292,6 +292,7 @@ function CameraAttributeHandlers.dptz_streams_handler(driver, device, ib, respon end function CameraAttributeHandlers.ptz_position_handler(driver, device, ib, response) + if not ib.data.elements then return end local ptz_map = camera_utils.get_ptz_map(device) local emit_event = function(idx, value) if value ~= ptz_map[idx].current then @@ -300,13 +301,13 @@ function CameraAttributeHandlers.ptz_position_handler(driver, device, ib, respon )) end end - if camera_utils.feature_supported(device, clusters.CameraAvSettingsUserLevelManagement.ID, clusters.CameraAvSettingsUserLevelManagement.types.Feature.MPAN) then + if ib.data.elements.pan and camera_utils.feature_supported(device, clusters.CameraAvSettingsUserLevelManagement.ID, clusters.CameraAvSettingsUserLevelManagement.types.Feature.MECHANICAL_PAN) then emit_event(camera_fields.PAN_IDX, ib.data.elements.pan.value) end - if camera_utils.feature_supported(device, clusters.CameraAvSettingsUserLevelManagement.ID, clusters.CameraAvSettingsUserLevelManagement.types.Feature.MTILT) then + if ib.data.elements.tilt and camera_utils.feature_supported(device, clusters.CameraAvSettingsUserLevelManagement.ID, clusters.CameraAvSettingsUserLevelManagement.types.Feature.MECHANICAL_TILT) then emit_event(camera_fields.TILT_IDX, ib.data.elements.tilt.value) end - if camera_utils.feature_supported(device, clusters.CameraAvSettingsUserLevelManagement.ID, clusters.CameraAvSettingsUserLevelManagement.types.Feature.MZOOM) then + if ib.data.elements.zoom and camera_utils.feature_supported(device, clusters.CameraAvSettingsUserLevelManagement.ID, clusters.CameraAvSettingsUserLevelManagement.types.Feature.MECHANICAL_ZOOM) then emit_event(camera_fields.ZOOM_IDX, ib.data.elements.zoom.value) end end @@ -317,13 +318,13 @@ function CameraAttributeHandlers.ptz_presets_handler(driver, device, ib, respons for _, v in ipairs(ib.data.elements) do local preset = v.elements local pan, tilt, zoom = 0, 0, 1 - if camera_utils.feature_supported(device, clusters.CameraAvSettingsUserLevelManagement.ID, clusters.CameraAvSettingsUserLevelManagement.types.Feature.MPAN) then + if camera_utils.feature_supported(device, clusters.CameraAvSettingsUserLevelManagement.ID, clusters.CameraAvSettingsUserLevelManagement.types.Feature.MECHANICAL_PAN) then pan = preset.settings.elements.pan.value end - if camera_utils.feature_supported(device, clusters.CameraAvSettingsUserLevelManagement.ID, clusters.CameraAvSettingsUserLevelManagement.types.Feature.MTILT) then + if camera_utils.feature_supported(device, clusters.CameraAvSettingsUserLevelManagement.ID, clusters.CameraAvSettingsUserLevelManagement.types.Feature.MECHANICAL_TILT) then tilt = preset.settings.elements.tilt.value end - if camera_utils.feature_supported(device, clusters.CameraAvSettingsUserLevelManagement.ID, clusters.CameraAvSettingsUserLevelManagement.types.Feature.MZOOM) then + if camera_utils.feature_supported(device, clusters.CameraAvSettingsUserLevelManagement.ID, clusters.CameraAvSettingsUserLevelManagement.types.Feature.MECHANICAL_ZOOM) then zoom = preset.settings.elements.zoom.value end table.insert(presets, { id = preset.preset_id.value, label = preset.name.value, pan = pan, tilt = tilt, zoom = zoom }) diff --git a/drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_handlers/capability_handlers.lua b/drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_handlers/capability_handlers.lua index a26afd0ca7..738d6d3556 100644 --- a/drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_handlers/capability_handlers.lua +++ b/drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_handlers/capability_handlers.lua @@ -139,9 +139,11 @@ end CameraCapabilityHandlers.ptz_relative_move_factory = function(index) return function (driver, device, cmd) local endpoint_id = device:component_to_endpoint(cmd.component) - local pan_delta = index == camera_fields.PAN_IDX and cmd.args.delta or 0 - local tilt_delta = index == camera_fields.TILT_IDX and cmd.args.delta or 0 - local zoom_delta = index == camera_fields.ZOOM_IDX and cmd.args.delta or 0 + -- Only the axis being moved should be included; the other two must be omitted (nil) rather + -- than sent as 0, since each delta field's conformance is tied to its own feature bit. + local pan_delta = index == camera_fields.PAN_IDX and cmd.args.delta or nil + local tilt_delta = index == camera_fields.TILT_IDX and cmd.args.delta or nil + local zoom_delta = index == camera_fields.ZOOM_IDX and cmd.args.delta or nil device:send(clusters.CameraAvSettingsUserLevelManagement.server.commands.MPTZRelativeMove( device, endpoint_id, pan_delta, tilt_delta, zoom_delta )) @@ -151,23 +153,23 @@ end CameraCapabilityHandlers.ptz_set_position_factory = function(command) return function (driver, device, cmd) local ptz_map = camera_utils.get_ptz_map(device) + -- MPTZSetPosition coordinates are optional; + -- a single-axis command should only set (and clamp) the axis it targets. + local pan, tilt, zoom if command == capabilities.mechanicalPanTiltZoom.commands.setPanTiltZoom then - ptz_map[camera_fields.PAN_IDX].current = cmd.args.pan - ptz_map[camera_fields.TILT_IDX].current = cmd.args.tilt - ptz_map[camera_fields.ZOOM_IDX].current = cmd.args.zoom + pan = utils.clamp_value(cmd.args.pan, ptz_map[camera_fields.PAN_IDX].range.minimum, ptz_map[camera_fields.PAN_IDX].range.maximum) + tilt = utils.clamp_value(cmd.args.tilt, ptz_map[camera_fields.TILT_IDX].range.minimum, ptz_map[camera_fields.TILT_IDX].range.maximum) + zoom = utils.clamp_value(cmd.args.zoom, ptz_map[camera_fields.ZOOM_IDX].range.minimum, ptz_map[camera_fields.ZOOM_IDX].range.maximum) elseif command == capabilities.mechanicalPanTiltZoom.commands.setPan then - ptz_map[camera_fields.PAN_IDX].current = cmd.args.pan + pan = utils.clamp_value(cmd.args.pan, ptz_map[camera_fields.PAN_IDX].range.minimum, ptz_map[camera_fields.PAN_IDX].range.maximum) elseif command == capabilities.mechanicalPanTiltZoom.commands.setTilt then - ptz_map[camera_fields.TILT_IDX].current = cmd.args.tilt + tilt = utils.clamp_value(cmd.args.tilt, ptz_map[camera_fields.TILT_IDX].range.minimum, ptz_map[camera_fields.TILT_IDX].range.maximum) else - ptz_map[camera_fields.ZOOM_IDX].current = cmd.args.zoom - end - for _, v in pairs(ptz_map) do - v.current = utils.clamp_value(v.current, v.range.minimum, v.range.maximum) + zoom = utils.clamp_value(cmd.args.zoom, ptz_map[camera_fields.ZOOM_IDX].range.minimum, ptz_map[camera_fields.ZOOM_IDX].range.maximum) end local endpoint_id = device:component_to_endpoint(cmd.component) - device:send(clusters.CameraAvSettingsUserLevelManagement.server.commands.MPTZSetPosition(device, endpoint_id, - ptz_map[camera_fields.PAN_IDX].current, ptz_map[camera_fields.TILT_IDX].current, ptz_map[camera_fields.ZOOM_IDX].current + device:send(clusters.CameraAvSettingsUserLevelManagement.server.commands.MPTZSetPosition( + device, endpoint_id, pan, tilt, zoom )) end end diff --git a/drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_utils/device_configuration.lua b/drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_utils/device_configuration.lua index 398150d063..7cb8edd930 100644 --- a/drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_utils/device_configuration.lua +++ b/drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_utils/device_configuration.lua @@ -46,19 +46,19 @@ end local function build_ptz_supported_attributes(device) local supported_attributes = {} - if camera_utils.feature_supported(device, clusters.CameraAvSettingsUserLevelManagement.ID, clusters.CameraAvSettingsUserLevelManagement.types.Feature.MPAN) then + if camera_utils.feature_supported(device, clusters.CameraAvSettingsUserLevelManagement.ID, clusters.CameraAvSettingsUserLevelManagement.types.Feature.MECHANICAL_PAN) then table.insert(supported_attributes, "pan") table.insert(supported_attributes, "panRange") end - if camera_utils.feature_supported(device, clusters.CameraAvSettingsUserLevelManagement.ID, clusters.CameraAvSettingsUserLevelManagement.types.Feature.MTILT) then + if camera_utils.feature_supported(device, clusters.CameraAvSettingsUserLevelManagement.ID, clusters.CameraAvSettingsUserLevelManagement.types.Feature.MECHANICAL_TILT) then table.insert(supported_attributes, "tilt") table.insert(supported_attributes, "tiltRange") end - if camera_utils.feature_supported(device, clusters.CameraAvSettingsUserLevelManagement.ID, clusters.CameraAvSettingsUserLevelManagement.types.Feature.MZOOM) then + if camera_utils.feature_supported(device, clusters.CameraAvSettingsUserLevelManagement.ID, clusters.CameraAvSettingsUserLevelManagement.types.Feature.MECHANICAL_ZOOM) then table.insert(supported_attributes, "zoom") table.insert(supported_attributes, "zoomRange") end - if camera_utils.feature_supported(device, clusters.CameraAvSettingsUserLevelManagement.ID, clusters.CameraAvSettingsUserLevelManagement.types.Feature.MPRESETS) then + if camera_utils.feature_supported(device, clusters.CameraAvSettingsUserLevelManagement.ID, clusters.CameraAvSettingsUserLevelManagement.types.Feature.MECHANICAL_PRESETS) then table.insert(supported_attributes, "presets") table.insert(supported_attributes, "maxPresets") end @@ -259,8 +259,9 @@ function CameraDeviceConfiguration.match_profile(device) clus_has_feature(clusters.CameraAvSettingsUserLevelManagement.types.Feature.MECHANICAL_ZOOM) then table.insert(main_component_capabilities, capabilities.mechanicalPanTiltZoom.ID) end - elseif ep_cluster.cluster_id == clusters.ZoneManagement.ID and has_server_cluster_type(ep_cluster) then - table.insert(main_component_capabilities, capabilities.zoneManagement.ID) + elseif ep_cluster.cluster_id == clusters.ZoneManagement.ID and has_server_cluster_type(ep_cluster) and + clusters.ZoneManagement.are_features_supported(clusters.ZoneManagement.types.Feature.USER_DEFINED, ep_cluster.feature_map) then + table.insert(main_component_capabilities, capabilities.zoneManagement.ID) elseif ep_cluster.cluster_id == clusters.OccupancySensing.ID and has_server_cluster_type(ep_cluster) then table.insert(main_component_capabilities, capabilities.motionSensor.ID) elseif ep_cluster.cluster_id == clusters.WebRTCTransportProvider.ID and has_server_cluster_type(ep_cluster) then diff --git a/drivers/SmartThings/matter-switch/src/sub_drivers/ikea_scroll/scroll_handlers/event_handlers.lua b/drivers/SmartThings/matter-switch/src/sub_drivers/ikea_scroll/scroll_handlers/event_handlers.lua index dbad323784..1fac107a75 100644 --- a/drivers/SmartThings/matter-switch/src/sub_drivers/ikea_scroll/scroll_handlers/event_handlers.lua +++ b/drivers/SmartThings/matter-switch/src/sub_drivers/ikea_scroll/scroll_handlers/event_handlers.lua @@ -10,12 +10,16 @@ local event_utils = require "sub_drivers.ikea_scroll.scroll_utils.event_utils" local IkeaScrollEventHandlers = {} + local function rotate_amount_event_helper(device, endpoint_id, num_presses_to_handle) if num_presses_to_handle <= 0 then return end -- to cut down on checks, we can assume that if the endpoint is not in ENDPOINTS_UP_SCROLL, it is in ENDPOINTS_DOWN_SCROLL local scroll_direction = switch_utils.tbl_contains(scroll_fields.ENDPOINTS_UP_SCROLL, endpoint_id) and 1 or -1 - local scroll_amount = st_utils.clamp_value(scroll_direction * scroll_fields.PER_SCROLL_EVENT_ROTATION * num_presses_to_handle, -100, 100) + local scroll_amount = st_utils.clamp_value( + event_utils.rotate_amount_scaling_helper(device, endpoint_id, scroll_direction * scroll_fields.PER_SCROLL_EVENT_ROTATION * num_presses_to_handle), + -100, 100 + ) if event_utils.is_valid_scroll_amount(device, scroll_amount) then device:emit_event_for_endpoint(endpoint_id, capabilities.knob.rotateAmount(scroll_amount, {state_change = true})) diff --git a/drivers/SmartThings/matter-switch/src/sub_drivers/ikea_scroll/scroll_utils/event_utils.lua b/drivers/SmartThings/matter-switch/src/sub_drivers/ikea_scroll/scroll_utils/event_utils.lua index 8a7a684cf6..d5568d2c9f 100644 --- a/drivers/SmartThings/matter-switch/src/sub_drivers/ikea_scroll/scroll_utils/event_utils.lua +++ b/drivers/SmartThings/matter-switch/src/sub_drivers/ikea_scroll/scroll_utils/event_utils.lua @@ -73,4 +73,18 @@ function IkeaScrollEventUtils.aggregate_scroll_amount_for_info_blocks(device, in return { total_presses = total_presses, presses_in_current_chain = presses_in_current_chain } end +function IkeaScrollEventUtils.rotate_amount_scaling_helper(device, endpoint_id, scroll_amount) + local scale_factor = 1.0 -- the default scale factor is 1.0, i.e none + local component = device:endpoint_to_component(endpoint_id) + if component == "main" then + scale_factor = scroll_fields.KNOB_SENSITIVITY_PREFERENCE_FACTORS[device.preferences.knobSensitivityGroup1] or 1.0 + elseif component == "group2" then + scale_factor = scroll_fields.KNOB_SENSITIVITY_PREFERENCE_FACTORS[device.preferences.knobSensitivityGroup2] or 1.0 + elseif component == "group3" then + scale_factor = scroll_fields.KNOB_SENSITIVITY_PREFERENCE_FACTORS[device.preferences.knobSensitivityGroup3] or 1.0 + end + local scaled_scroll_amount = st_utils.clamp_value(math.floor(scroll_amount * scale_factor), -100, 100) + return scaled_scroll_amount +end + return IkeaScrollEventUtils diff --git a/drivers/SmartThings/matter-switch/src/sub_drivers/ikea_scroll/scroll_utils/fields.lua b/drivers/SmartThings/matter-switch/src/sub_drivers/ikea_scroll/scroll_utils/fields.lua index 27e0dbcd6d..2445e2fd30 100644 --- a/drivers/SmartThings/matter-switch/src/sub_drivers/ikea_scroll/scroll_utils/fields.lua +++ b/drivers/SmartThings/matter-switch/src/sub_drivers/ikea_scroll/scroll_utils/fields.lua @@ -33,6 +33,13 @@ IkeaScrollFields.CLEAR_STATE_TIMER = "__clear_state_timer" -- Delay in seconds to wait before clearing the global rotate amount state after the last scroll event IkeaScrollFields.CLEAR_STATE_DELAY_S = 8 +-- Amounts by which to multiply the scroll amount based on user preference for sensitivity +IkeaScrollFields.KNOB_SENSITIVITY_PREFERENCE_FACTORS = { + ["0"] = 0.5, -- Low + ["1"] = 1.0, -- Medium + ["2"] = 2.0 -- High +} + -- Required Events for the ENDPOINTS_PUSH. IkeaScrollFields.switch_press_subscribed_events = { clusters.Switch.events.InitialPress.ID, diff --git a/drivers/SmartThings/matter-switch/src/switch_handlers/attribute_handlers.lua b/drivers/SmartThings/matter-switch/src/switch_handlers/attribute_handlers.lua index b7feed6344..ae1f219606 100644 --- a/drivers/SmartThings/matter-switch/src/switch_handlers/attribute_handlers.lua +++ b/drivers/SmartThings/matter-switch/src/switch_handlers/attribute_handlers.lua @@ -18,6 +18,11 @@ if version.api < 11 then clusters.PowerTopology = require "embedded_clusters.PowerTopology" end +-- Catch nil elements errors gracefully without receiving a coroutine error +if version.api < 21 then + clusters.ElectricalEnergyMeasurement.types.EnergyMeasurementStruct = require "embedded_clusters.ElectricalEnergyMeasurement.types.EnergyMeasurementStruct" +end + local AttributeHandlers = {} -- [[ ON OFF CLUSTER ATTRIBUTES ]] -- @@ -328,6 +333,8 @@ function AttributeHandlers.available_endpoints_handler(driver, device, ib, respo device.log.warn("Received an AvailableEndpoints response but no Electrical Sensor endpoints have been identified as supporting the Power Topology cluster with SET feature. Ignoring this response.") return end + + device.log.debug_with({hub_logs=true}, string.format("Handling AvailableEndpoints response for endpoint %d with elements: %s", ib.endpoint_id, st_utils.stringify_table(ib.data.elements or {}))) for i, set_ep_info in pairs(set_topology_eps or {}) do if ib.endpoint_id == set_ep_info.endpoint_id then -- since EP response is being handled here, remove it from the ELECTRICAL_SENSOR_EPS table @@ -361,6 +368,8 @@ function AttributeHandlers.parts_list_handler(driver, device, ib, response) device.log.warn("Received a PartsList response but no Electrical Sensor endpoints have been identified as supporting the Power Topology cluster with TREE feature. Ignoring this response.") return end + + device.log.debug_with({hub_logs=true}, string.format("Handling PartsList response for endpoint %d with elements: %s", ib.endpoint_id, st_utils.stringify_table(ib.data.elements or {}))) for i, tree_ep_info in pairs(tree_topology_eps or {}) do if ib.endpoint_id == tree_ep_info.endpoint_id then -- since EP response is being handled here, remove it from the ELECTRICAL_SENSOR_EPS table diff --git a/drivers/SmartThings/matter-switch/src/switch_utils/device_configuration.lua b/drivers/SmartThings/matter-switch/src/switch_utils/device_configuration.lua index 9c5235d1e2..8e5f797877 100644 --- a/drivers/SmartThings/matter-switch/src/switch_utils/device_configuration.lua +++ b/drivers/SmartThings/matter-switch/src/switch_utils/device_configuration.lua @@ -15,6 +15,11 @@ if version.api < 11 then clusters.ValveConfigurationAndControl = require "embedded_clusters.ValveConfigurationAndControl" end +-- Catch nil elements errors gracefully without receiving a coroutine error +if version.api < 21 then + clusters.ElectricalEnergyMeasurement.types.EnergyMeasurementStruct = require "embedded_clusters.ElectricalEnergyMeasurement.types.EnergyMeasurementStruct" +end + local DeviceConfiguration = {} local ChildConfiguration = {} local SwitchDeviceConfiguration = {} @@ -34,6 +39,7 @@ function ChildConfiguration.create_or_update_child_devices(driver, device, serve local child_profile, optional_component_capabilities = assign_profile_fn(device, ep_id, true) local existing_child_device = device:get_field(fields.IS_PARENT_CHILD_DEVICE) and switch_utils.find_child(device, ep_id) if not existing_child_device then + device.log.info_with({hub_logs=true}, string.format("Creating child device for endpoint %d with profile %s", ep_id, child_profile)) driver:try_create_device({ type = "EDGE_CHILD", label = label_and_name, @@ -87,7 +93,9 @@ function SwitchDeviceConfiguration.assign_profile_for_onoff_ep(device, server_on local generic_profile = fields.device_type_profile_map[primary_dt_id] local static_electrical_tags = switch_utils.get_field_for_endpoint(device, fields.ELECTRICAL_TAGS, server_onoff_ep_id) - if static_electrical_tags ~= nil then + if type(static_electrical_tags) == "string" then + -- if no associated profile is found for the device type and static electrical tags are available, use "plug-binary" as a fallback + generic_profile = generic_profile or "plug-binary" -- profiles like 'light-binary' and 'plug-binary' should drop the '-binary' and become 'light-power', 'plug-energy-powerConsumption', etc. generic_profile = string.gsub(generic_profile, "-binary", "") .. static_electrical_tags end diff --git a/drivers/SmartThings/matter-switch/src/switch_utils/utils.lua b/drivers/SmartThings/matter-switch/src/switch_utils/utils.lua index d2457bfb4d..1d12f41781 100644 --- a/drivers/SmartThings/matter-switch/src/switch_utils/utils.lua +++ b/drivers/SmartThings/matter-switch/src/switch_utils/utils.lua @@ -21,6 +21,11 @@ if version.api < 16 then clusters.Descriptor = require "embedded_clusters.Descriptor" end +-- Catch nil elements errors gracefully without receiving a coroutine error +if version.api < 21 then + clusters.ElectricalEnergyMeasurement.types.EnergyMeasurementStruct = require "embedded_clusters.ElectricalEnergyMeasurement.types.EnergyMeasurementStruct" +end + local utils = {} function utils.tbl_contains(array, value) @@ -545,16 +550,14 @@ function utils.subscribe(device) devices_seen[checked_device.id] = true -- only loop through any device once end end - -- The refresh capability command handler in the lua libs uses this key to determine which attributes to read. Note - -- that only attributes_seen needs to be saved here, and not events_seen, since the refresh handler only checks - -- attributes and not events. - device:set_field(fields.SUBSCRIBED_ATTRIBUTES_KEY, attributes_seen) -- If the type of battery support has not yet been determined, add the PowerSource AttributeList to the list of -- subscribed attributes in order to determine which if any battery capability should be used. if device:get_field(fields.profiling_data.BATTERY_SUPPORT) == nil then local ib = im.InteractionInfoBlock(nil, clusters.PowerSource.ID, clusters.PowerSource.attributes.AttributeList.ID) subscribe_request:with_info_block(ib) + attributes_seen[clusters.PowerSource.ID] = attributes_seen[clusters.PowerSource.ID] or {} + attributes_seen[clusters.PowerSource.ID][clusters.PowerSource.attributes.AttributeList.ID] = ib end -- If the power topology of the device has not yet been determined, add the AvailableEndpoints (for SET topology) @@ -566,12 +569,21 @@ function utils.subscribe(device) if clusters.PowerTopology.are_features_supported(clusters.PowerTopology.types.Feature.SET_TOPOLOGY, endpoint_power_topology_cluster.feature_map or 0) then local ib = im.InteractionInfoBlock(nil, clusters.PowerTopology.ID, clusters.PowerTopology.attributes.AvailableEndpoints.ID) subscribe_request:with_info_block(ib) + attributes_seen[clusters.PowerTopology.ID] = attributes_seen[clusters.PowerTopology.ID] or {} + attributes_seen[clusters.PowerTopology.ID][clusters.PowerTopology.attributes.AvailableEndpoints.ID] = ib elseif clusters.PowerTopology.are_features_supported(clusters.PowerTopology.types.Feature.TREE_TOPOLOGY, endpoint_power_topology_cluster.feature_map or 0) then local ib = im.InteractionInfoBlock(nil, clusters.Descriptor.ID, clusters.Descriptor.attributes.PartsList.ID) subscribe_request:with_info_block(ib) + attributes_seen[clusters.Descriptor.ID] = attributes_seen[clusters.Descriptor.ID] or {} + attributes_seen[clusters.Descriptor.ID][clusters.Descriptor.attributes.PartsList.ID] = ib end end + -- The refresh capability command handler in the lua libs uses this key to determine which attributes to read. Note + -- that only attributes_seen needs to be saved here, and not events_seen, since the refresh handler only checks + -- attributes and not events. + device:set_field(fields.SUBSCRIBED_ATTRIBUTES_KEY, attributes_seen) + if #subscribe_request.info_blocks > 0 then device:send(subscribe_request) end diff --git a/drivers/SmartThings/matter-switch/src/test/test_aqara_climate_sensor_w100.lua b/drivers/SmartThings/matter-switch/src/test/test_aqara_climate_sensor_w100.lua index 50713626f2..0e92647a4a 100644 --- a/drivers/SmartThings/matter-switch/src/test/test_aqara_climate_sensor_w100.lua +++ b/drivers/SmartThings/matter-switch/src/test/test_aqara_climate_sensor_w100.lua @@ -160,7 +160,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -185,7 +185,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -213,7 +213,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -232,7 +232,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -257,7 +257,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -282,7 +282,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -323,7 +323,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(aqara_mock_device:generate_test_message("button2", capabilities.button.button.double({state_change = true}))) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -352,7 +352,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -381,7 +381,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -400,7 +400,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -419,7 +419,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -444,7 +444,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -467,7 +467,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -490,7 +490,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-switch/src/test/test_aqara_cube.lua b/drivers/SmartThings/matter-switch/src/test/test_aqara_cube.lua index dbda0c35fc..ad197cf435 100644 --- a/drivers/SmartThings/matter-switch/src/test/test_aqara_cube.lua +++ b/drivers/SmartThings/matter-switch/src/test/test_aqara_cube.lua @@ -235,7 +235,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -270,7 +270,7 @@ test.register_coroutine_test( end, { test_init = test_init_exhausted, - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/matter-switch/src/test/test_aqara_light_switch_h2.lua b/drivers/SmartThings/matter-switch/src/test/test_aqara_light_switch_h2.lua index f763cc769f..08402cf273 100644 --- a/drivers/SmartThings/matter-switch/src/test/test_aqara_light_switch_h2.lua +++ b/drivers/SmartThings/matter-switch/src/test/test_aqara_light_switch_h2.lua @@ -15,6 +15,11 @@ if version.api < 11 then clusters.PowerTopology = require "embedded_clusters.PowerTopology" end +-- Catch nil elements errors gracefully without receiving a coroutine error +if version.api < 21 then + clusters.ElectricalEnergyMeasurement.types.EnergyMeasurementStruct = require "embedded_clusters.ElectricalEnergyMeasurement.types.EnergyMeasurementStruct" +end + local aqara_parent_ep = 4 local aqara_child1_ep = 1 local aqara_child2_ep = 2 @@ -258,7 +263,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -338,7 +343,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-switch/src/test/test_electrical_sensor_set.lua b/drivers/SmartThings/matter-switch/src/test/test_electrical_sensor_set.lua index dae6b09a6c..32989187fa 100644 --- a/drivers/SmartThings/matter-switch/src/test/test_electrical_sensor_set.lua +++ b/drivers/SmartThings/matter-switch/src/test/test_electrical_sensor_set.lua @@ -15,6 +15,11 @@ if version.api < 11 then clusters.PowerTopology = require "embedded_clusters.PowerTopology" end +-- Catch nil elements errors gracefully without receiving a coroutine error +if version.api < 21 then + clusters.ElectricalEnergyMeasurement.types.EnergyMeasurementStruct = require "embedded_clusters.ElectricalEnergyMeasurement.types.EnergyMeasurementStruct" +end + local mock_device = test.mock_device.build_test_matter_device({ profile = t_utils.get_profile_definition("plug-level-power-energy-powerConsumption.yml"), manufacturer_info = { @@ -222,7 +227,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -290,7 +295,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -315,7 +320,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -377,7 +382,7 @@ test.register_coroutine_test( end, { test_init = test_init_periodic, - min_api_version = 17 + min_api_version = 14 } ) @@ -402,7 +407,7 @@ test.register_coroutine_test( end, { test_init = test_init, - min_api_version = 17 + min_api_version = 14 } ) @@ -417,7 +422,7 @@ test.register_coroutine_test( end, { test_init = test_init_periodic, - min_api_version = 17 + min_api_version = 14 } ) @@ -548,7 +553,7 @@ test.register_coroutine_test( end, { test_init = test_init, - min_api_version = 17 + min_api_version = 14 } ) @@ -619,7 +624,7 @@ test.register_coroutine_test( end, { test_init = test_init_periodic, - min_api_version = 17 + min_api_version = 14 } ) @@ -702,7 +707,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/matter-switch/src/test/test_electrical_sensor_tree.lua b/drivers/SmartThings/matter-switch/src/test/test_electrical_sensor_tree.lua index d691f2af27..e285c593e2 100644 --- a/drivers/SmartThings/matter-switch/src/test/test_electrical_sensor_tree.lua +++ b/drivers/SmartThings/matter-switch/src/test/test_electrical_sensor_tree.lua @@ -19,6 +19,11 @@ if version.api < 16 then clusters.Descriptor = require "embedded_clusters.Descriptor" end +-- Catch nil elements errors gracefully without receiving a coroutine error +if version.api < 21 then + clusters.ElectricalEnergyMeasurement.types.EnergyMeasurementStruct = require "embedded_clusters.ElectricalEnergyMeasurement.types.EnergyMeasurementStruct" +end + local mock_device = test.mock_device.build_test_matter_device({ profile = t_utils.get_profile_definition("plug-level-power-energy-powerConsumption.yml"), manufacturer_info = { @@ -158,7 +163,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -226,7 +231,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -252,7 +257,7 @@ test.register_coroutine_test( end, { test_init = test_init, - min_api_version = 17 + min_api_version = 14 } ) @@ -335,7 +340,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/matter-switch/src/test/test_eve_energy.lua b/drivers/SmartThings/matter-switch/src/test/test_eve_energy.lua index e90f5a70da..f51143b813 100644 --- a/drivers/SmartThings/matter-switch/src/test/test_eve_energy.lua +++ b/drivers/SmartThings/matter-switch/src/test/test_eve_energy.lua @@ -197,7 +197,7 @@ test.register_coroutine_test( assert(sub_driver ~= nil, "sub_driver should be returned") end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -209,7 +209,7 @@ test.register_coroutine_test( assert(result == false, "can_handle should return false for device without Eve Private Cluster") end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -242,7 +242,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -275,7 +275,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -295,7 +295,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -310,7 +310,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -343,7 +343,7 @@ test.register_coroutine_test( test.timer.__create_and_queue_test_time_advance_timer(60, "interval", "create_poll_schedule") end, - min_api_version = 17 + min_api_version = 14 } ) @@ -362,7 +362,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -389,7 +389,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -416,7 +416,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -455,7 +455,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -483,7 +483,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -510,7 +510,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -546,7 +546,7 @@ test.register_coroutine_test( test.timer.__create_and_queue_test_time_advance_timer(60 * 15, "interval", "create_poll_report_schedule") test.timer.__create_and_queue_test_time_advance_timer(60, "interval", "create_poll_schedule") end, - min_api_version = 17 + min_api_version = 14 } ) @@ -643,7 +643,7 @@ test.register_coroutine_test( test.disable_startup_messages() test.mock_device.add_test_device(mock_eve_device_using_electrical_sensor) end, - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-switch/src/test/test_hager_waasys.lua b/drivers/SmartThings/matter-switch/src/test/test_hager_waasys.lua index 96a684529d..a85137d0e3 100644 --- a/drivers/SmartThings/matter-switch/src/test/test_hager_waasys.lua +++ b/drivers/SmartThings/matter-switch/src/test/test_hager_waasys.lua @@ -592,7 +592,10 @@ test.register_coroutine_test("Test: 4-Button Device Detection - Profile Changes })) }) -end) +end, + { + min_api_version = 15 + }) test.register_coroutine_test("Test: Button Event Handling - Pushed, Double Press, and Held Events on 4-Button Device", function() test.socket.matter:__set_channel_ordering("relaxed") @@ -796,7 +799,10 @@ test.register_coroutine_test("Test: Button Event Handling - Pushed, Double Press ) }) test.socket.capability:__expect_send(matter_device:generate_test_message("button4", capabilities.button.button.held({ state_change = true }))) -end) +end, + { + min_api_version = 15 + }) test.register_coroutine_test("Test: Device Type Handler - Handles Button (Type 15) and OnOff (Type 256) Device Types with Child Creation", function() test.socket.matter:__set_channel_ordering("relaxed") @@ -889,7 +895,10 @@ test.register_coroutine_test("Test: Device Type Handler - Handles Button (Type 1 parent.id, clusters.OnOff.attributes.OnOff:subscribe(parent, nil) }) -end) +end, + { + min_api_version = 15 + }) test.register_coroutine_test("Test: 2G Relay - Profile Changes Between light-binary and 2-button Based On Endpoint Availability", function() test.socket.matter:__set_channel_ordering("relaxed") @@ -1131,7 +1140,10 @@ test.register_coroutine_test("Test: 2G Relay - Profile Changes Between light-bin parent_device_id = parent.id, parent_assigned_child_key = "4" }) -end) +end, + { + min_api_version = 15 + }) test.register_coroutine_test("Test: Dimmer Device - Child Creation for Dimmable Endpoint with Button Support", function() test.socket.matter:__set_channel_ordering("relaxed") @@ -1227,7 +1239,10 @@ test.register_coroutine_test("Test: Dimmer Device - Child Creation for Dimmable clusters.LevelControl.server.commands.MoveToLevelWithOnOff(child_dimmer, 3, 51, nil, 0, 0) }) -end) +end, + { + min_api_version = 15 + }) test.register_coroutine_test("Test: 1G Dimmer - Initialization and Profile Update to light-level", function() test.socket.matter:__set_channel_ordering("relaxed") @@ -1236,7 +1251,10 @@ test.register_coroutine_test("Test: 1G Dimmer - Initialization and Profile Updat add_matter_device(dimmer, parent, "2-button") test.wait_for_events() configure_parent(parent) -end) +end, + { + min_api_version = 15 + }) test.register_coroutine_test("Test: 1G Dimmer - Host Commands and Level Control Capabilities", function() test.socket.matter:__set_channel_ordering("relaxed") @@ -1308,7 +1326,10 @@ test.register_coroutine_test("Test: 1G Dimmer - Host Commands and Level Control parent_1g.id, clusters.LevelControl.server.commands.MoveToLevelWithOnOff(dimmer, 4, 51, nil, 0, 0) }) -end) +end, + { + min_api_version = 15 + }) test.register_coroutine_test("Test: PIR Device - Initialization with Motion and Illuminance Capabilities", function() test.socket.matter:__set_channel_ordering("relaxed") @@ -1318,7 +1339,10 @@ test.register_coroutine_test("Test: PIR Device - Initialization with Motion and test.wait_for_events() configure_parent(parent_pir) -end) +end, + { + min_api_version = 15 + }) test.register_coroutine_test("Test: PIR Device - Complete Functionality with Motion, Illuminance, and Dimmer Support", function() test.socket.matter:__set_channel_ordering("relaxed") @@ -1472,7 +1496,10 @@ test.register_coroutine_test("Test: PIR Device - Complete Functionality with Mot }) test.socket.capability:__expect_send(child_dimmer:generate_test_message("main", capabilities.switchLevel.level(50))) parent_pir.expect_native_attr_handler_registration(parent_pir, "switchLevel", "level") -end) +end, + { + min_api_version = 15 + }) test.register_coroutine_test("Test: Host with Window Covering - 2-Button Profile with Window Covering Child Device", function() test.socket.matter:__set_channel_ordering("relaxed") @@ -1610,7 +1637,10 @@ test.register_coroutine_test("Test: Host with Window Covering - 2-Button Profile test.socket.capability:__expect_send(child_wc:generate_test_message("main", capabilities.windowShadeLevel.shadeLevel(0))) test.socket.capability:__expect_send(child_wc:generate_test_message("main", capabilities.windowShade.windowShade.closed())) -end) +end, + { + min_api_version = 15 + }) test.register_coroutine_test("Test: Window Covering - Preference Changes for Reverse Polarity and Preset Position", function() test.socket.matter:__set_channel_ordering("relaxed") @@ -1775,6 +1805,9 @@ test.register_coroutine_test("Test: Window Covering - Preference Changes for Rev parent.id, cluster_base.subscribe(parent, nil, clusters.WindowCovering.ID, clusters.WindowCovering.attributes.CurrentPositionLiftPercent100ths.ID, nil) }) -end) +end, + { + min_api_version = 15 + }) test.run_registered_tests() diff --git a/drivers/SmartThings/matter-switch/src/test/test_ikea_scroll.lua b/drivers/SmartThings/matter-switch/src/test/test_ikea_scroll.lua index f421b17f79..6b0bfe32a1 100644 --- a/drivers/SmartThings/matter-switch/src/test/test_ikea_scroll.lua +++ b/drivers/SmartThings/matter-switch/src/test/test_ikea_scroll.lua @@ -233,7 +233,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -347,7 +347,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -461,7 +461,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -512,7 +512,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -563,7 +563,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -614,7 +614,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -665,7 +665,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -699,7 +699,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -733,7 +733,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -747,6 +747,205 @@ test.register_coroutine_test( test.socket.matter:__expect_send({mock_ikea_scroll.id, read_request}) test.wait_for_events() end +, + { + min_api_version = 15 + }) + +-- Coroutine tests for sensitivity preference logic. +-- KNOB_SENSITIVITY_FACTORS = {0.5, 1.0, 2.0}, indexed by the preference value. +-- nil preference falls back to 1.0 (tested by the message tests above). + +test.register_coroutine_test( + "Ikea Scroll low sensitivity (factor 0.5) scales rotateAmount correctly on main", + function() + test.socket.device_lifecycle():__queue_receive(mock_ikea_scroll:generate_info_changed({ preferences = { knobSensitivityGroup1 = "0" } })) + test.wait_for_events() + + test.socket.matter:__queue_receive({ + mock_ikea_scroll.id, + clusters.Switch.events.InitialPress:build_test_event_report( + mock_ikea_scroll, ENDPOINTS_SCROLL[1], {new_position = 1} + ) + }) + + -- MultiPressOngoing count=2 (delta=2) → floor(12 * 0.5) = 6 + test.socket.matter:__queue_receive({ + mock_ikea_scroll.id, + clusters.Switch.events.MultiPressOngoing:build_test_event_report( + mock_ikea_scroll, ENDPOINTS_SCROLL[1], {current_number_of_presses_counted = 2, new_position = 2} + ) + }) + test.socket.capability:__expect_send(mock_ikea_scroll:generate_test_message("main", + capabilities.knob.rotateAmount(6, {state_change = true}))) + + -- MultiPressOngoing count=5 (delta=3) → floor(18 * 0.5) = 9 + test.socket.matter:__queue_receive({ + mock_ikea_scroll.id, + clusters.Switch.events.MultiPressOngoing:build_test_event_report( + mock_ikea_scroll, ENDPOINTS_SCROLL[1], {current_number_of_presses_counted = 5, new_position = 5} + ) + }) + test.socket.capability:__expect_send(mock_ikea_scroll:generate_test_message("main", + capabilities.knob.rotateAmount(9, {state_change = true}))) + + -- MultiPressComplete total=5 (delta=0, no event emitted) + test.socket.matter:__queue_receive({ + mock_ikea_scroll.id, + clusters.Switch.events.MultiPressComplete:build_test_event_report( + mock_ikea_scroll, ENDPOINTS_SCROLL[1], {new_position = 5, total_number_of_presses_counted = 5, previous_position = 0} + ) + }) + + test.wait_for_events() + end, + { + min_api_version = 15 + } +) + +test.register_coroutine_test( + "Ikea Scroll high sensitivity (factor 2.0) scales rotateAmount correctly on main", + function() + test.socket.device_lifecycle():__queue_receive(mock_ikea_scroll:generate_info_changed({ preferences = { knobSensitivityGroup1 = "2" } })) + test.wait_for_events() + + test.socket.matter:__queue_receive({ + mock_ikea_scroll.id, + clusters.Switch.events.InitialPress:build_test_event_report( + mock_ikea_scroll, ENDPOINTS_SCROLL[1], {new_position = 1} + ) + }) + + -- MultiPressOngoing count=2 (delta=2) → floor(12 * 2.0) = 24 + test.socket.matter:__queue_receive({ + mock_ikea_scroll.id, + clusters.Switch.events.MultiPressOngoing:build_test_event_report( + mock_ikea_scroll, ENDPOINTS_SCROLL[1], {current_number_of_presses_counted = 2, new_position = 2} + ) + }) + test.socket.capability:__expect_send(mock_ikea_scroll:generate_test_message("main", + capabilities.knob.rotateAmount(24, {state_change = true}))) + + -- MultiPressOngoing count=5 (delta=3) → floor(18 * 2.0) = 36 + test.socket.matter:__queue_receive({ + mock_ikea_scroll.id, + clusters.Switch.events.MultiPressOngoing:build_test_event_report( + mock_ikea_scroll, ENDPOINTS_SCROLL[1], {current_number_of_presses_counted = 5, new_position = 5} + ) + }) + test.socket.capability:__expect_send(mock_ikea_scroll:generate_test_message("main", + capabilities.knob.rotateAmount(36, {state_change = true}))) + + -- MultiPressComplete total=5 (delta=0, no event emitted) + test.socket.matter:__queue_receive({ + mock_ikea_scroll.id, + clusters.Switch.events.MultiPressComplete:build_test_event_report( + mock_ikea_scroll, ENDPOINTS_SCROLL[1], {new_position = 5, total_number_of_presses_counted = 5, previous_position = 0} + ) + }) + + test.wait_for_events() + end, + { + min_api_version = 15 + } +) + +test.register_coroutine_test( + "Ikea Scroll high sensitivity (factor 2.0) scales rotateAmount correctly on group2", + function() + test.socket.device_lifecycle():__queue_receive(mock_ikea_scroll:generate_info_changed({ preferences = { knobSensitivityGroup2 = "2" } })) + test.wait_for_events() + + test.socket.matter:__queue_receive({ + mock_ikea_scroll.id, + clusters.Switch.events.InitialPress:build_test_event_report( + mock_ikea_scroll, ENDPOINTS_SCROLL[3], {new_position = 1} + ) + }) + + -- MultiPressOngoing count=2 (delta=2) → floor(12 * 2.0) = 24 + test.socket.matter:__queue_receive({ + mock_ikea_scroll.id, + clusters.Switch.events.MultiPressOngoing:build_test_event_report( + mock_ikea_scroll, ENDPOINTS_SCROLL[3], {current_number_of_presses_counted = 2, new_position = 2} + ) + }) + test.socket.capability:__expect_send(mock_ikea_scroll:generate_test_message("group2", + capabilities.knob.rotateAmount(24, {state_change = true}))) + + -- MultiPressOngoing count=5 (delta=3) → floor(18 * 2.0) = 36 + test.socket.matter:__queue_receive({ + mock_ikea_scroll.id, + clusters.Switch.events.MultiPressOngoing:build_test_event_report( + mock_ikea_scroll, ENDPOINTS_SCROLL[3], {current_number_of_presses_counted = 5, new_position = 5} + ) + }) + test.socket.capability:__expect_send(mock_ikea_scroll:generate_test_message("group2", + capabilities.knob.rotateAmount(36, {state_change = true}))) + + -- MultiPressComplete total=5 (delta=0, no event emitted) + test.socket.matter:__queue_receive({ + mock_ikea_scroll.id, + clusters.Switch.events.MultiPressComplete:build_test_event_report( + mock_ikea_scroll, ENDPOINTS_SCROLL[3], {new_position = 5, total_number_of_presses_counted = 5, previous_position = 0} + ) + }) + + test.wait_for_events() + end, + { + min_api_version = 15 + } +) + +test.register_coroutine_test( + "Ikea Scroll low sensitivity (factor 0.5) scales rotateAmount correctly on group3", + function() + test.socket.device_lifecycle():__queue_receive(mock_ikea_scroll:generate_info_changed({ preferences = { knobSensitivityGroup3 = "0" } })) + test.wait_for_events() + + test.socket.matter:__queue_receive({ + mock_ikea_scroll.id, + clusters.Switch.events.InitialPress:build_test_event_report( + mock_ikea_scroll, ENDPOINTS_SCROLL[5], {new_position = 1} + ) + }) + + -- MultiPressOngoing count=2 (delta=2) → floor(12 * 0.5) = 6 + test.socket.matter:__queue_receive({ + mock_ikea_scroll.id, + clusters.Switch.events.MultiPressOngoing:build_test_event_report( + mock_ikea_scroll, ENDPOINTS_SCROLL[5], {current_number_of_presses_counted = 2, new_position = 2} + ) + }) + test.socket.capability:__expect_send(mock_ikea_scroll:generate_test_message("group3", + capabilities.knob.rotateAmount(6, {state_change = true}))) + + -- MultiPressOngoing count=5 (delta=3) → floor(18 * 0.5) = 9 + test.socket.matter:__queue_receive({ + mock_ikea_scroll.id, + clusters.Switch.events.MultiPressOngoing:build_test_event_report( + mock_ikea_scroll, ENDPOINTS_SCROLL[5], {current_number_of_presses_counted = 5, new_position = 5} + ) + }) + test.socket.capability:__expect_send(mock_ikea_scroll:generate_test_message("group3", + capabilities.knob.rotateAmount(9, {state_change = true}))) + + -- MultiPressComplete total=5 (delta=0, no event emitted) + test.socket.matter:__queue_receive({ + mock_ikea_scroll.id, + clusters.Switch.events.MultiPressComplete:build_test_event_report( + mock_ikea_scroll, ENDPOINTS_SCROLL[5], {new_position = 5, total_number_of_presses_counted = 5, previous_position = 0} + ) + }) + + test.wait_for_events() + end, + { + min_api_version = 15 + } ) test.run_registered_tests() diff --git a/drivers/SmartThings/matter-switch/src/test/test_light_illuminance_motion.lua b/drivers/SmartThings/matter-switch/src/test/test_light_illuminance_motion.lua index b22498eaf7..efc80d9e99 100644 --- a/drivers/SmartThings/matter-switch/src/test/test_light_illuminance_motion.lua +++ b/drivers/SmartThings/matter-switch/src/test/test_light_illuminance_motion.lua @@ -78,7 +78,10 @@ test.register_coroutine_test( test.socket.matter:__expect_send({mock_device.id, clusters.ColorControl.attributes.Options:write(mock_device, 1, clusters.ColorControl.types.OptionsBitmap.EXECUTE_IF_OFF)}) mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end -) +, + { + min_api_version = 15 + }) test.register_coroutine_test( "init should cause device to subscribe to all appropriate clusters", function() @@ -109,7 +112,7 @@ test.register_coroutine_test( test.socket.matter:__expect_send({mock_device.id, subscribe_request}) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -131,7 +134,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -166,7 +169,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -245,7 +248,7 @@ test.register_coroutine_test( end, { test_init = test_init_light_level_motion, - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-switch/src/test/test_matter_bridge.lua b/drivers/SmartThings/matter-switch/src/test/test_matter_bridge.lua index 6cb679796d..eda33fbf5b 100644 --- a/drivers/SmartThings/matter-switch/src/test/test_matter_bridge.lua +++ b/drivers/SmartThings/matter-switch/src/test/test_matter_bridge.lua @@ -101,7 +101,7 @@ test.register_coroutine_test( end, { test_init = test_init_mock_bridge, - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-switch/src/test/test_matter_button.lua b/drivers/SmartThings/matter-switch/src/test/test_matter_button.lua index 061f2e2f47..d49d9f2452 100644 --- a/drivers/SmartThings/matter-switch/src/test/test_matter_button.lua +++ b/drivers/SmartThings/matter-switch/src/test/test_matter_button.lua @@ -87,7 +87,7 @@ test.register_coroutine_test( end, { test_init = test_init_for_lifecycle_tests, - min_api_version = 17 + min_api_version = 15 } ) @@ -109,7 +109,7 @@ test.register_coroutine_test( end, { test_init = test_init_for_lifecycle_tests, - min_api_version = 17 + min_api_version = 15 } ) @@ -132,7 +132,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -170,7 +170,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -209,7 +209,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -257,7 +257,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -281,7 +281,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -305,7 +305,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -329,7 +329,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -368,7 +368,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -407,7 +407,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -482,7 +482,7 @@ test.register_coroutine_test( end, { test_init = test_init_battery, - min_api_version = 17 + min_api_version = 15 } ) @@ -509,7 +509,7 @@ test.register_coroutine_test( end, { test_init = test_init_profile_change_with_battery, - min_api_version = 17 + min_api_version = 15 } ) @@ -521,7 +521,7 @@ test.register_coroutine_test( end, { test_init = test_init_profile_change_with_battery, - min_api_version = 17 + min_api_version = 15 } ) @@ -536,7 +536,7 @@ test.register_coroutine_test( end, { test_init = test_init_profile_change_with_battery, - min_api_version = 17 + min_api_version = 15 } ) @@ -551,7 +551,7 @@ test.register_coroutine_test( end, { test_init = test_init_profile_change_with_battery, - min_api_version = 17 + min_api_version = 15 } ) @@ -571,7 +571,7 @@ test.register_coroutine_test( end, { test_init = test_init_profile_change_with_battery, - min_api_version = 17 + min_api_version = 15 } ) @@ -594,7 +594,7 @@ test.register_coroutine_test( end, { test_init = test_init_battery, - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-switch/src/test/test_matter_camera.lua b/drivers/SmartThings/matter-switch/src/test/test_matter_camera.lua index d443bdc573..020b7bb906 100644 --- a/drivers/SmartThings/matter-switch/src/test/test_matter_camera.lua +++ b/drivers/SmartThings/matter-switch/src/test/test_matter_camera.lua @@ -1,12 +1,19 @@ -- Copyright © 2025 SmartThings, Inc. -- Licensed under the Apache License, Version 2.0 +local version = require "version" +local test = require "integration_test" +if version.api < 17 then + -- Run an empty test suite to avoid an error being thrown + test.run_registered_tests() + os.exit(0) +end + local capabilities = require "st.capabilities" local cluster_base = require "st.matter.cluster_base" local clusters = require "st.matter.clusters" local camera_fields = require "sub_drivers.camera.camera_utils.fields" local t_utils = require "integration_test.utils" -local test = require "integration_test" local uint32 = require "st.matter.data_types.Uint32" test.disable_startup_messages() @@ -62,7 +69,8 @@ local mock_device = test.mock_device.build_test_matter_device({ { cluster_id = clusters.ZoneManagement.ID, feature_map = clusters.ZoneManagement.types.Feature.TWO_DIMENSIONAL_CARTESIAN_ZONE | - clusters.ZoneManagement.types.Feature.PER_ZONE_SENSITIVITY, + clusters.ZoneManagement.types.Feature.PER_ZONE_SENSITIVITY | + clusters.ZoneManagement.types.Feature.USER_DEFINED, cluster_type = "SERVER" }, { @@ -120,6 +128,78 @@ local mock_device = test.mock_device.build_test_matter_device({ }) local mock_device_no_per_zone_sensitivity = test.mock_device.build_test_matter_device({ + profile = t_utils.get_profile_definition("camera.yml"), + manufacturer_info = {vendor_id = 0x0000, product_id = 0x0000}, + matter_version = {hardware = 1, software = 1}, + endpoints = { + { + endpoint_id = 0, + clusters = { + { cluster_id = clusters.Basic.ID, cluster_type = "SERVER" } + }, + device_types = { + { device_type_id = 0x0016, device_type_revision = 1 } -- RootNode + } + }, + { + endpoint_id = CAMERA_EP, + clusters = { + { + cluster_id = clusters.CameraAvStreamManagement.ID, + feature_map = clusters.CameraAvStreamManagement.types.Feature.VIDEO, + cluster_type = "SERVER" + }, + { + cluster_id = clusters.ZoneManagement.ID, + feature_map = clusters.ZoneManagement.types.Feature.TWO_DIMENSIONAL_CARTESIAN_ZONE | + clusters.ZoneManagement.types.Feature.USER_DEFINED, + cluster_type = "SERVER" + }, + { + cluster_id = clusters.PushAvStreamTransport.ID, + cluster_type = "SERVER" + } + }, + device_types = { + {device_type_id = 0x0142, device_type_revision = 1} -- Camera + } + } + } +}) + +local mock_device_pan_tilt_only = test.mock_device.build_test_matter_device({ + profile = t_utils.get_profile_definition("camera.yml"), + manufacturer_info = {vendor_id = 0x0000, product_id = 0x0000}, + matter_version = {hardware = 1, software = 1}, + endpoints = { + { + endpoint_id = 0, + clusters = { + { cluster_id = clusters.Basic.ID, cluster_type = "SERVER" } + }, + device_types = { + { device_type_id = 0x0016, device_type_revision = 1 } -- RootNode + } + }, + { + endpoint_id = CAMERA_EP, + clusters = { + { + cluster_id = clusters.CameraAvSettingsUserLevelManagement.ID, + feature_map = clusters.CameraAvSettingsUserLevelManagement.types.Feature.MECHANICAL_PAN | + clusters.CameraAvSettingsUserLevelManagement.types.Feature.MECHANICAL_TILT | + clusters.CameraAvSettingsUserLevelManagement.types.Feature.MECHANICAL_PRESETS, + cluster_type = "SERVER" + } + }, + device_types = { + {device_type_id = 0x0142, device_type_revision = 1} -- Camera + } + } + } +}) + +local mock_device_no_user_defined_zone = test.mock_device.build_test_matter_device({ profile = t_utils.get_profile_definition("camera.yml"), manufacturer_info = {vendor_id = 0x0000, product_id = 0x0000}, matter_version = {hardware = 1, software = 1}, @@ -229,6 +309,51 @@ local function test_init_no_per_zone_sensitivity() mock_device_no_per_zone_sensitivity:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end +local subscribe_request_no_user_defined_zone +local subscribed_attributes_no_user_defined_zone = { + clusters.CameraAvStreamManagement.attributes.AttributeList, +} + +local function test_init_no_user_defined_zone() + test.mock_device.add_test_device(mock_device_no_user_defined_zone) + test.socket.device_lifecycle:__queue_receive({ mock_device_no_user_defined_zone.id, "added" }) + test.socket.device_lifecycle:__queue_receive({ mock_device_no_user_defined_zone.id, "init" }) + subscribe_request_no_user_defined_zone = subscribed_attributes_no_user_defined_zone[1]:subscribe(mock_device_no_user_defined_zone) + subscribe_request_no_user_defined_zone:merge(cluster_base.subscribe(mock_device_no_user_defined_zone, nil, camera_fields.CameraAVSMFeatureMapAttr.cluster, camera_fields.CameraAVSMFeatureMapAttr.ID)) + subscribe_request_no_user_defined_zone:merge(cluster_base.subscribe(mock_device_no_user_defined_zone, nil, camera_fields.ZoneManagementFeatureMapAttr.cluster, camera_fields.ZoneManagementFeatureMapAttr.ID)) + for i, attr in ipairs(subscribed_attributes_no_user_defined_zone) do + if i > 1 then subscribe_request_no_user_defined_zone:merge(attr:subscribe(mock_device_no_user_defined_zone)) end + end + test.socket.matter:__expect_send({mock_device_no_user_defined_zone.id, subscribe_request_no_user_defined_zone}) + test.socket.device_lifecycle:__queue_receive({ mock_device_no_user_defined_zone.id, "doConfigure" }) + mock_device_no_user_defined_zone:expect_metadata_update({ provisioning_state = "PROVISIONED" }) +end + +-- mock_device_pan_tilt_only has no CameraAvStreamManagement cluster at all, so do_configure's +-- `if #device:get_endpoints(clusters.CameraAvStreamManagement.ID) == 0` branch calls match_profile +-- directly and synchronously during doConfigure, rather than waiting on an AttributeList report +-- like the other reduced fixtures above. That means the profile/capability metadata update and the +-- "PROVISIONED" transition both happen back-to-back off of the same doConfigure lifecycle event. +local subscribe_request_pan_tilt_only + +local function test_init_pan_tilt_only() + test.mock_device.add_test_device(mock_device_pan_tilt_only) + test.socket.device_lifecycle:__queue_receive({ mock_device_pan_tilt_only.id, "added" }) + test.socket.device_lifecycle:__queue_receive({ mock_device_pan_tilt_only.id, "init" }) + subscribe_request_pan_tilt_only = cluster_base.subscribe( + mock_device_pan_tilt_only, nil, camera_fields.CameraAVSULMFeatureMapAttr.cluster, camera_fields.CameraAVSULMFeatureMapAttr.ID + ) + test.socket.matter:__expect_send({mock_device_pan_tilt_only.id, subscribe_request_pan_tilt_only}) + test.socket.device_lifecycle:__queue_receive({ mock_device_pan_tilt_only.id, "doConfigure" }) + mock_device_pan_tilt_only:expect_metadata_update({ + optional_component_capabilities = { + { "main", { "mechanicalPanTiltZoom" } } + }, + profile = "camera" + }) + mock_device_pan_tilt_only:expect_metadata_update({ provisioning_state = "PROVISIONED" }) +end + local additional_subscribed_attributes = { clusters.CameraAvStreamManagement.attributes.HDRModeEnabled, clusters.CameraAvStreamManagement.attributes.ImageRotation, @@ -485,6 +610,103 @@ local function update_device_profile_no_per_zone_sensitivity() test.socket.matter:__expect_send({mock_device_no_per_zone_sensitivity.id, subscribe_request_no_per_zone_sensitivity}) end +local additional_subscribed_attributes_no_user_defined_zone = { + clusters.CameraAvStreamManagement.attributes.StatusLightBrightness, + clusters.CameraAvStreamManagement.attributes.StatusLightEnabled, + clusters.CameraAvStreamManagement.attributes.RateDistortionTradeOffPoints, + clusters.CameraAvStreamManagement.attributes.MaxEncodedPixelRate, + clusters.CameraAvStreamManagement.attributes.VideoSensorParams, + clusters.CameraAvStreamManagement.attributes.AllocatedVideoStreams, + clusters.CameraAvSettingsUserLevelManagement.attributes.DPTZStreams, + clusters.CameraAvStreamManagement.attributes.MinViewportResolution, + clusters.CameraAvStreamManagement.attributes.Viewport, + clusters.CameraAvStreamManagement.attributes.AttributeList, + clusters.OnOff.attributes.OnOff, +} + +local function update_device_profile_no_user_defined_zone() + local expected_metadata = { + optional_component_capabilities = { + { + "main", + { + "videoCapture2", + "cameraViewportSettings", + "videoStreamSettings", + } + }, + { + "statusLed", + { + "switch", + "mode" + } + } + }, + profile = "camera" + } + + test.socket.matter:__queue_receive({ + mock_device_no_user_defined_zone.id, + clusters.CameraAvStreamManagement.attributes.AttributeList:build_test_report_data(mock_device_no_user_defined_zone, CAMERA_EP, { + uint32(clusters.CameraAvStreamManagement.attributes.StatusLightEnabled.ID), + uint32(clusters.CameraAvStreamManagement.attributes.StatusLightBrightness.ID) + }) + }) + mock_device_no_user_defined_zone:expect_metadata_update(expected_metadata) + test.wait_for_events() + local updated_device_profile = t_utils.get_profile_definition( + "camera.yml", {enabled_optional_capabilities = expected_metadata.optional_component_capabilities} + ) + test.wait_for_events() + test.socket.device_lifecycle:__queue_receive(mock_device_no_user_defined_zone:generate_info_changed({ profile = updated_device_profile })) + + test.socket.capability:__expect_send( + mock_device_no_user_defined_zone:generate_test_message("main", capabilities.videoStreamSettings.supportedFeatures( + {"liveStreaming", "clipRecording", "perStreamViewports"} + )) + ) + + for _, attr in ipairs(additional_subscribed_attributes_no_user_defined_zone) do + subscribe_request_no_user_defined_zone:merge(attr:subscribe(mock_device_no_user_defined_zone)) + end + test.socket.matter:__expect_send({mock_device_no_user_defined_zone.id, subscribe_request_no_user_defined_zone}) +end + +local additional_subscribed_attributes_pan_tilt_only = { + clusters.CameraAvSettingsUserLevelManagement.attributes.MPTZPosition, + clusters.CameraAvSettingsUserLevelManagement.attributes.MPTZPresets, + clusters.CameraAvSettingsUserLevelManagement.attributes.MaxPresets, + clusters.CameraAvSettingsUserLevelManagement.attributes.ZoomMax, + clusters.CameraAvSettingsUserLevelManagement.attributes.PanMax, + clusters.CameraAvSettingsUserLevelManagement.attributes.PanMin, + clusters.CameraAvSettingsUserLevelManagement.attributes.TiltMax, + clusters.CameraAvSettingsUserLevelManagement.attributes.TiltMin, +} + +-- Unlike the other reduced fixtures, mock_device_pan_tilt_only's profile/capability update already +-- happened synchronously during doConfigure (see test_init_pan_tilt_only), so this only needs to +-- simulate the platform pushing the updated profile back down via infoChanged, then confirm the PTZ +-- capability is initialized with pan/tilt/presets only -- no zoom or zoomRange, since this device's +-- CameraAvSettingsUserLevelManagement feature_map never claimed MECHANICAL_ZOOM support. +local function update_device_profile_pan_tilt_only() + local updated_device_profile = t_utils.get_profile_definition( + "camera.yml", {enabled_optional_capabilities = { + { "main", { "mechanicalPanTiltZoom" } } + }} + ) + test.socket.device_lifecycle:__queue_receive(mock_device_pan_tilt_only:generate_info_changed({ profile = updated_device_profile })) + test.socket.capability:__expect_send( + mock_device_pan_tilt_only:generate_test_message("main", capabilities.mechanicalPanTiltZoom.supportedAttributes( + {"pan", "panRange", "tilt", "tiltRange", "presets", "maxPresets"} + )) + ) + for _, attr in ipairs(additional_subscribed_attributes_pan_tilt_only) do + subscribe_request_pan_tilt_only:merge(attr:subscribe(mock_device_pan_tilt_only)) + end + test.socket.matter:__expect_send({mock_device_pan_tilt_only.id, subscribe_request_pan_tilt_only}) +end + -- Matter Handler UTs test.register_coroutine_test( @@ -542,7 +764,7 @@ test.register_coroutine_test( test.socket.matter:__expect_send({mock_device.id, clusters.Switch.attributes.MultiPressMax:read(mock_device, DOORBELL_EP)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -608,7 +830,7 @@ test.register_coroutine_test( assert(not configure_buttons_called, "configure_buttons should not be called when capability state is unchanged") end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -635,7 +857,7 @@ test.register_coroutine_test( assert(reconcile_called, "reconcile_profile_and_capabilities should be called") end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -683,7 +905,7 @@ test.register_coroutine_test( assert(init_event_count == 0, "cameraPrivacyMode should not be reinitialized for equal values with metatable differences") end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -733,7 +955,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -776,7 +998,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -805,7 +1027,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -849,7 +1071,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -880,7 +1102,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -930,7 +1152,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -955,7 +1177,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1008,7 +1230,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1132,7 +1354,7 @@ test.register_coroutine_test( emit_supported_resolutions() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1150,7 +1372,7 @@ test.register_coroutine_test( emit_supported_resolutions() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1168,7 +1390,7 @@ test.register_coroutine_test( emit_supported_resolutions() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1223,7 +1445,33 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 + } +) + +test.register_coroutine_test( + "PTZ Position report with zoom omitted should be handled normally on a device with no zoom feature", + function() + update_device_profile_pan_tilt_only() + test.wait_for_events() + -- This device has no zoom feature, so its MPTZPosition report never has a zoom field; + -- pan/tilt should still be handled normally. + test.socket.matter:__queue_receive({ + mock_device_pan_tilt_only.id, + clusters.CameraAvSettingsUserLevelManagement.attributes.MPTZPosition:build_test_report_data( + mock_device_pan_tilt_only, CAMERA_EP, {pan = 10, tilt = 20}) + }) + test.socket.capability:__set_channel_ordering("relaxed") + test.socket.capability:__expect_send( + mock_device_pan_tilt_only:generate_test_message("main", capabilities.mechanicalPanTiltZoom.pan(10)) + ) + test.socket.capability:__expect_send( + mock_device_pan_tilt_only:generate_test_message("main", capabilities.mechanicalPanTiltZoom.tilt(20)) + ) + end, + { + min_api_version = 14, + test_init = test_init_pan_tilt_only } ) @@ -1247,7 +1495,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1265,7 +1513,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1283,7 +1531,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1331,7 +1579,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1369,7 +1617,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1395,7 +1643,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1424,7 +1672,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.sounds.selectedSound(2))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1467,7 +1715,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1508,7 +1756,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1534,7 +1782,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1574,7 +1822,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1610,7 +1858,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1635,7 +1883,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1702,7 +1950,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1810,7 +2058,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1836,7 +2084,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1861,7 +2109,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1875,25 +2123,25 @@ test.register_coroutine_test( { capability = "mechanicalPanTiltZoom", component = "main", command = "panRelative", args = { 10 } }, }) test.socket.matter:__expect_send({ - mock_device.id, clusters.CameraAvSettingsUserLevelManagement.server.commands.MPTZRelativeMove(mock_device, CAMERA_EP, 10, 0, 0) + mock_device.id, clusters.CameraAvSettingsUserLevelManagement.server.commands.MPTZRelativeMove(mock_device, CAMERA_EP, 10, nil, nil) }) test.socket.capability:__queue_receive({ mock_device.id, { capability = "mechanicalPanTiltZoom", component = "main", command = "tiltRelative", args = { -35 } }, }) test.socket.matter:__expect_send({ - mock_device.id, clusters.CameraAvSettingsUserLevelManagement.server.commands.MPTZRelativeMove(mock_device, CAMERA_EP, 0, -35, 0) + mock_device.id, clusters.CameraAvSettingsUserLevelManagement.server.commands.MPTZRelativeMove(mock_device, CAMERA_EP, nil, -35, nil) }) test.socket.capability:__queue_receive({ mock_device.id, { capability = "mechanicalPanTiltZoom", component = "main", command = "zoomRelative", args = { 80 } }, }) test.socket.matter:__expect_send({ - mock_device.id, clusters.CameraAvSettingsUserLevelManagement.server.commands.MPTZRelativeMove(mock_device, CAMERA_EP, 0, 0, 80) + mock_device.id, clusters.CameraAvSettingsUserLevelManagement.server.commands.MPTZRelativeMove(mock_device, CAMERA_EP, nil, nil, 80) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1930,7 +2178,7 @@ test.register_coroutine_test( { capability = "mechanicalPanTiltZoom", component = "main", command = "setPan", args = { 50 } }, }) test.socket.matter:__expect_send({ - mock_device.id, clusters.CameraAvSettingsUserLevelManagement.server.commands.MPTZSetPosition(mock_device, CAMERA_EP, 50, 20, 30) + mock_device.id, clusters.CameraAvSettingsUserLevelManagement.server.commands.MPTZSetPosition(mock_device, CAMERA_EP, 50, nil, nil) }) test.socket.matter:__queue_receive({ mock_device.id, @@ -1946,7 +2194,7 @@ test.register_coroutine_test( { capability = "mechanicalPanTiltZoom", component = "main", command = "setTilt", args = { -44 } }, }) test.socket.matter:__expect_send({ - mock_device.id, clusters.CameraAvSettingsUserLevelManagement.server.commands.MPTZSetPosition(mock_device, CAMERA_EP, 50, -44, 30) + mock_device.id, clusters.CameraAvSettingsUserLevelManagement.server.commands.MPTZSetPosition(mock_device, CAMERA_EP, nil, -44, nil) }) test.socket.matter:__queue_receive({ mock_device.id, @@ -1962,7 +2210,7 @@ test.register_coroutine_test( { capability = "mechanicalPanTiltZoom", component = "main", command = "setZoom", args = { 5 } }, }) test.socket.matter:__expect_send({ - mock_device.id, clusters.CameraAvSettingsUserLevelManagement.server.commands.MPTZSetPosition(mock_device, CAMERA_EP, 50, -44, 5) + mock_device.id, clusters.CameraAvSettingsUserLevelManagement.server.commands.MPTZSetPosition(mock_device, CAMERA_EP, nil, nil, 5) }) test.socket.matter:__queue_receive({ mock_device.id, @@ -1974,7 +2222,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2006,7 +2254,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2031,7 +2279,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2105,7 +2353,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2178,7 +2426,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2254,7 +2502,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2346,7 +2594,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2452,7 +2700,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2528,7 +2776,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -3139,7 +3387,7 @@ test.register_coroutine_test( camera_cfg.reconcile_profile_and_capabilities = original_reconcile end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -3180,55 +3428,67 @@ test.register_coroutine_test( test.socket.matter:__expect_send({mock_device.id, clusters.Switch.attributes.MultiPressMax:read(mock_device, DOORBELL_EP)}) end, { - min_api_version = 17 + min_api_version = 14 } ) test.register_coroutine_test( - "Zone Management trigger reports should omit sensitivity when per-zone sensitivity is unsupported, even if provided by client", + "Camera profile should include zoneManagement when USER_DEFINED feature is present", function() update_device_profile_no_per_zone_sensitivity() test.wait_for_events() - -- Create a trigger with + end, + { + test_init = test_init_no_per_zone_sensitivity, + min_api_version = 14 + } +) + +test.register_coroutine_test( + "Camera profile should not include zoneManagement when USER_DEFINED feature is missing", + function() + update_device_profile_no_user_defined_zone() + test.wait_for_events() + end, + { + test_init = test_init_no_user_defined_zone, + min_api_version = 14 + } +) + +test.register_coroutine_test( + "Zone Management trigger command should be ignored when zoneManagement capability is not exposed", + function() + update_device_profile_no_user_defined_zone() + test.wait_for_events() test.socket.capability:__queue_receive({ - mock_device_no_per_zone_sensitivity.id, + mock_device_no_user_defined_zone.id, { capability = "zoneManagement", component = "main", command = "createOrUpdateTrigger", args = { 1, 10, 3, 15, 3, 5 }} }) - test.socket.matter:__expect_send({ - mock_device_no_per_zone_sensitivity.id, clusters.ZoneManagement.server.commands.CreateOrUpdateTrigger(mock_device_no_per_zone_sensitivity, CAMERA_EP, { - zone_id = 1, - initial_duration = 10, - augmentation_duration = 3, - max_duration = 15, - blind_duration = 3 - }) - }) + test.wait_for_events() end, { - test_init = test_init_no_per_zone_sensitivity, - min_api_version = 17 + test_init = test_init_no_user_defined_zone, + min_api_version = 14 } ) test.register_coroutine_test( - "Zone Management setSensitivity command should handle global sensitivity when per-zone sensitivity is unsupported", + "Zone Management setSensitivity command should be ignored when zoneManagement capability is not exposed", function() - update_device_profile_no_per_zone_sensitivity() + update_device_profile_no_user_defined_zone() test.wait_for_events() test.socket.capability:__queue_receive({ - mock_device_no_per_zone_sensitivity.id, + mock_device_no_user_defined_zone.id, { capability = "zoneManagement", component = "main", command = "setSensitivity", args = { 5 } } }) - test.socket.matter:__expect_send({ - mock_device_no_per_zone_sensitivity.id, - clusters.ZoneManagement.attributes.Sensitivity:write(mock_device_no_per_zone_sensitivity, CAMERA_EP, 5) - }) + test.wait_for_events() end, { - test_init = test_init_no_per_zone_sensitivity, - min_api_version = 17 + test_init = test_init_no_user_defined_zone, + min_api_version = 14 } ) diff --git a/drivers/SmartThings/matter-switch/src/test/test_matter_irrigation_system.lua b/drivers/SmartThings/matter-switch/src/test/test_matter_irrigation_system.lua index 3acf4129f9..31795f91ea 100644 --- a/drivers/SmartThings/matter-switch/src/test/test_matter_irrigation_system.lua +++ b/drivers/SmartThings/matter-switch/src/test/test_matter_irrigation_system.lua @@ -1,6 +1,14 @@ -- Copyright © 2026 SmartThings, Inc. -- Licensed under the Apache License, Version 2.0 +local version = require "version" +local test = require "integration_test" +if version.api < 17 then + test.run_registered_tests() + os.exit(0) +end + + local capabilities = require "st.capabilities" local clusters = require "st.matter.clusters" local t_utils = require "integration_test.utils" diff --git a/drivers/SmartThings/matter-switch/src/test/test_matter_light_fan.lua b/drivers/SmartThings/matter-switch/src/test/test_matter_light_fan.lua index 32023a36cb..d3be60f352 100644 --- a/drivers/SmartThings/matter-switch/src/test/test_matter_light_fan.lua +++ b/drivers/SmartThings/matter-switch/src/test/test_matter_light_fan.lua @@ -157,7 +157,10 @@ test.register_coroutine_test( ) test.socket.matter:__expect_send({mock_device_capabilities_disabled.id, subscribe_request}) end, - { test_init = function() test.mock_device.add_test_device(mock_device_capabilities_disabled) end } + { + test_init = function() test.mock_device.add_test_device(mock_device_capabilities_disabled) end, + min_api_version = 15 + } ) test.register_coroutine_test( @@ -165,7 +168,10 @@ test.register_coroutine_test( -- simulate no actual change test.socket.device_lifecycle:__queue_receive(mock_device_capabilities_disabled:generate_info_changed({})) end, - { test_init = function() test.mock_device.add_test_device(mock_device_capabilities_disabled) end } + { + test_init = function() test.mock_device.add_test_device(mock_device_capabilities_disabled) end, + min_api_version = 15 + } ) local FanMode = clusters.FanControl.attributes.FanMode @@ -213,7 +219,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -249,7 +255,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -274,7 +280,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -299,7 +305,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-switch/src/test/test_matter_multi_button.lua b/drivers/SmartThings/matter-switch/src/test/test_matter_multi_button.lua index d7d5efde97..0f4c1e28b1 100644 --- a/drivers/SmartThings/matter-switch/src/test/test_matter_multi_button.lua +++ b/drivers/SmartThings/matter-switch/src/test/test_matter_multi_button.lua @@ -278,7 +278,7 @@ test.register_coroutine_test( end, { test_init = test_init_battery, - min_api_version = 17 + min_api_version = 15 } ) @@ -302,7 +302,7 @@ test.register_coroutine_test( end, { test_init = test_init_battery, - min_api_version = 17 + min_api_version = 15 } ) @@ -325,7 +325,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -358,7 +358,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -383,7 +383,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("button2", button_attr.held({state_change = true}))) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -408,7 +408,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("button3", button_attr.pushed({state_change = true}))) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -432,7 +432,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -472,7 +472,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("button5", button_attr.double({state_change = true}))) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -500,7 +500,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -528,7 +528,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -566,7 +566,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -605,7 +605,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -653,7 +653,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -677,7 +677,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -701,7 +701,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -725,7 +725,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -764,7 +764,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -803,7 +803,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -827,7 +827,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -871,7 +871,7 @@ test.register_message_test( -- no double event }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -929,7 +929,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -951,7 +951,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -972,7 +972,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ profile = "5-button-batteryLevel" }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -993,7 +993,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ profile = "5-button-battery" }) end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-switch/src/test/test_matter_multi_button_motion.lua b/drivers/SmartThings/matter-switch/src/test/test_matter_multi_button_motion.lua index 44ee11861e..ec2e7ae289 100644 --- a/drivers/SmartThings/matter-switch/src/test/test_matter_multi_button_motion.lua +++ b/drivers/SmartThings/matter-switch/src/test/test_matter_multi_button_motion.lua @@ -184,7 +184,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -217,7 +217,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -242,7 +242,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("button2", button_attr.held({state_change = true}))) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -267,7 +267,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("button3", button_attr.pushed({state_change = true}))) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -291,7 +291,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -331,7 +331,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("button6", button_attr.double({state_change = true}))) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -359,7 +359,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -378,7 +378,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.motionSensor.motion.inactive())) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -406,7 +406,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -444,7 +444,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -483,7 +483,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -531,7 +531,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -555,7 +555,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -579,7 +579,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -603,7 +603,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -643,7 +643,7 @@ test.register_message_test( }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -683,7 +683,7 @@ test.register_message_test( }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -707,7 +707,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -751,7 +751,7 @@ test.register_message_test( -- no double event }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -809,7 +809,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) -- run the tests diff --git a/drivers/SmartThings/matter-switch/src/test/test_matter_multi_button_switch_mcd.lua b/drivers/SmartThings/matter-switch/src/test/test_matter_multi_button_switch_mcd.lua index 70f9666542..b3390edc29 100644 --- a/drivers/SmartThings/matter-switch/src/test/test_matter_multi_button_switch_mcd.lua +++ b/drivers/SmartThings/matter-switch/src/test/test_matter_multi_button_switch_mcd.lua @@ -271,7 +271,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -294,7 +294,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -327,7 +327,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -352,7 +352,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("button3", button_attr.pushed({state_change = true}))) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -411,7 +411,7 @@ test.register_coroutine_test( end, { test_init = test_init_mcd_unsupported_switch_device_type, - min_api_version = 17 + min_api_version = 15 } ) @@ -432,7 +432,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -450,7 +450,7 @@ test.register_coroutine_test( expect_configure_buttons() end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -464,7 +464,7 @@ test.register_coroutine_test( expect_configure_buttons() end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -484,7 +484,7 @@ test.register_coroutine_test( test.socket.device_lifecycle:__queue_receive({ mock_child.id, "doConfigure" }) end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-switch/src/test/test_matter_on_off_device_configuration.lua b/drivers/SmartThings/matter-switch/src/test/test_matter_on_off_device_configuration.lua index d27ee2c383..fc729ed3fa 100644 --- a/drivers/SmartThings/matter-switch/src/test/test_matter_on_off_device_configuration.lua +++ b/drivers/SmartThings/matter-switch/src/test/test_matter_on_off_device_configuration.lua @@ -50,7 +50,7 @@ test.register_coroutine_test( end, { test_init = function() test.mock_device.add_test_device(mock_device_onoff_switch_as_server) end, - min_api_version = 17 + min_api_version = 15 } ) @@ -83,7 +83,7 @@ test.register_coroutine_test( end, { test_init = function() test.mock_device.add_test_device(mock_device_onoff_switch_as_client) end, - min_api_version = 17 + min_api_version = 15 } ) @@ -122,7 +122,7 @@ test.register_coroutine_test( end, { test_init = function() test.mock_device.add_test_device(mock_device_dimmer_switch_as_server) end, - min_api_version = 17 + min_api_version = 15 } ) @@ -159,7 +159,7 @@ test.register_coroutine_test( end, { test_init = function() test.mock_device.add_test_device(mock_device_plug_with_switch_profile_vendor_override) end, - min_api_version = 17 + min_api_version = 15 } ) @@ -196,7 +196,7 @@ test.register_coroutine_test( end, { test_init = function() test.mock_device.add_test_device(mock_device_color_dimmer) end, - min_api_version = 17 + min_api_version = 15 } ) @@ -241,7 +241,7 @@ test.register_coroutine_test( end, { test_init = function() test.mock_device.add_test_device(mock_device_mounted_on_off_control) end, - min_api_version = 17 + min_api_version = 15 } ) @@ -296,7 +296,7 @@ test.register_coroutine_test( end, { test_init = function() test.mock_device.add_test_device(mock_device_mounted_dimmable_load_control) end, - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-switch/src/test/test_matter_on_off_parent_child.lua b/drivers/SmartThings/matter-switch/src/test/test_matter_on_off_parent_child.lua index 608112d61c..02a01dc44e 100644 --- a/drivers/SmartThings/matter-switch/src/test/test_matter_on_off_parent_child.lua +++ b/drivers/SmartThings/matter-switch/src/test/test_matter_on_off_parent_child.lua @@ -177,7 +177,7 @@ test.register_coroutine_test( end, { test_init = test_init_for_lifecycle_tests, - min_api_version = 17 + min_api_version = 15 } ) @@ -193,7 +193,7 @@ test.register_coroutine_test( end, { test_init = test_init_for_lifecycle_tests, - min_api_version = 17 + min_api_version = 15 } ) @@ -207,7 +207,7 @@ test.register_coroutine_test( end, { test_init = test_init_for_generate_info_changed_tests, - min_api_version = 17 + min_api_version = 15 } ) @@ -238,7 +238,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -289,7 +289,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -320,6 +320,9 @@ test.register_message_test( clusters.ColorControl.server.commands.MoveToColor:build_test_command_response(mock_device, extended_color_ep_id) } }, + }, + { + min_api_version = 15 } ) @@ -354,7 +357,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -460,7 +463,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -514,7 +517,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -613,7 +616,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -692,7 +695,7 @@ test.register_coroutine_test( test_init = function() test.mock_device.add_test_device(mock_plug) end, - min_api_version = 17 + min_api_version = 15 } ) @@ -710,7 +713,7 @@ test.register_coroutine_test( test_init = function() test.mock_device.add_test_device(mock_plug) end, - min_api_version = 17 + min_api_version = 15 } ) @@ -771,7 +774,7 @@ test.register_coroutine_test( test_init = function() test.mock_device.add_test_device(mock_plug_profile_override) end, - min_api_version = 17 + min_api_version = 15 } ) @@ -871,7 +874,7 @@ test.register_coroutine_test( end, { test_init = function() test.mock_device.add_test_device(mock_switch) end, - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/matter-switch/src/test/test_matter_sensor_offset_preferences.lua b/drivers/SmartThings/matter-switch/src/test/test_matter_sensor_offset_preferences.lua index eabc9246f7..e6d51d1f36 100644 --- a/drivers/SmartThings/matter-switch/src/test/test_matter_sensor_offset_preferences.lua +++ b/drivers/SmartThings/matter-switch/src/test/test_matter_sensor_offset_preferences.lua @@ -61,7 +61,7 @@ test.register_coroutine_test("Read appropriate attribute values after tempOffset }))) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -84,7 +84,7 @@ test.register_coroutine_test("Read appropriate attribute values after humidityOf }))) end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-switch/src/test/test_matter_switch.lua b/drivers/SmartThings/matter-switch/src/test/test_matter_switch.lua index e68f1d0101..d48a89b9cc 100644 --- a/drivers/SmartThings/matter-switch/src/test/test_matter_switch.lua +++ b/drivers/SmartThings/matter-switch/src/test/test_matter_switch.lua @@ -93,7 +93,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -110,7 +110,7 @@ test.register_coroutine_test( test.socket.matter:__expect_send({mock_device.id, subscribe_request}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -143,7 +143,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -176,7 +176,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -204,7 +204,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -229,7 +229,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -291,7 +291,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -316,7 +316,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -346,7 +346,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -376,7 +376,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -448,7 +448,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -526,7 +526,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -551,7 +551,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -576,7 +576,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -606,7 +606,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -631,7 +631,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -676,7 +676,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -694,7 +694,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -759,7 +759,7 @@ test.register_coroutine_test( end, { test_init = test_init_x_y_color_mode, - min_api_version = 17 + min_api_version = 14 } ) @@ -791,7 +791,7 @@ test.register_coroutine_test( end, { test_init = test_init_x_y_color_mode, - min_api_version = 17 + min_api_version = 14 } ) @@ -823,7 +823,7 @@ test.register_coroutine_test( end, { test_init = test_init_x_y_color_mode, - min_api_version = 17 + min_api_version = 14 } ) @@ -881,7 +881,7 @@ test.register_coroutine_test( end, { test_init = test_init_x_y_color_mode, - min_api_version = 17 + min_api_version = 14 } ) @@ -979,7 +979,7 @@ test.register_message_test( }, { test_init = test_init_with_hue_sat_color_mode_set, - min_api_version = 17 + min_api_version = 14 } ) @@ -1065,7 +1065,7 @@ test.register_message_test( }, { test_init = test_init_with_hue_sat_color_mode_set, - min_api_version = 17 + min_api_version = 14 } ) @@ -1143,7 +1143,7 @@ test.register_coroutine_test( end, { test_init = test_init_no_hue_sat, - min_api_version = 17 + min_api_version = 15 } ) @@ -1195,7 +1195,7 @@ test.register_coroutine_test( end, { test_init = test_init_color_temp, - min_api_version = 17 + min_api_version = 15 } ) @@ -1222,7 +1222,7 @@ test.register_coroutine_test( end, { test_init = test_init_color_temp, - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-switch/src/test/test_matter_water_valve.lua b/drivers/SmartThings/matter-switch/src/test/test_matter_water_valve.lua index 788a00d76e..221405a62a 100644 --- a/drivers/SmartThings/matter-switch/src/test/test_matter_water_valve.lua +++ b/drivers/SmartThings/matter-switch/src/test/test_matter_water_valve.lua @@ -69,7 +69,10 @@ test.register_coroutine_test( test.socket.device_lifecycle:__queue_receive({ mock_device.id, "doConfigure" }) mock_device:expect_metadata_update({ profile = "water-valve-level" }) mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) - end + end, + { + min_api_version = 15 + } ) test.register_message_test( @@ -93,7 +96,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -118,7 +121,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -159,7 +162,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -179,8 +182,6 @@ test.register_message_test( direction = "send", message = mock_device:generate_test_message("main", capabilities.valve.valve.closed()) }, - }, - { { channel = "matter", direction = "receive", @@ -209,7 +210,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -231,7 +232,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-switch/src/test/test_multi_switch_mcd.lua b/drivers/SmartThings/matter-switch/src/test/test_multi_switch_mcd.lua index 5b1b569b25..0b68428669 100644 --- a/drivers/SmartThings/matter-switch/src/test/test_multi_switch_mcd.lua +++ b/drivers/SmartThings/matter-switch/src/test/test_multi_switch_mcd.lua @@ -200,7 +200,7 @@ test.register_message_test( }, { test_init = test_init_mock_3switch, - min_api_version = 17 + min_api_version = 14 } ) @@ -227,7 +227,7 @@ test.register_message_test( }, { test_init = test_init_mock_2switch, - min_api_version = 17 + min_api_version = 14 } ) @@ -254,7 +254,7 @@ test.register_message_test( }, { test_init = test_init_mock_3switch_non_sequential, - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/matter-switch/src/test/test_stateless_step.lua b/drivers/SmartThings/matter-switch/src/test/test_stateless_step.lua index a92c547ac7..eec293013b 100644 --- a/drivers/SmartThings/matter-switch/src/test/test_stateless_step.lua +++ b/drivers/SmartThings/matter-switch/src/test/test_stateless_step.lua @@ -128,7 +128,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -210,7 +210,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/matter-switch/src/test/test_third_reality_subdrivers.lua b/drivers/SmartThings/matter-switch/src/test/test_third_reality_subdrivers.lua index a32ce8f8ff..8ed1a78031 100644 --- a/drivers/SmartThings/matter-switch/src/test/test_third_reality_subdrivers.lua +++ b/drivers/SmartThings/matter-switch/src/test/test_third_reality_subdrivers.lua @@ -95,6 +95,9 @@ test.register_message_test( direction = "send", message = mock_device:generate_test_message("main", capabilities.doorControl.door.open()) } + }, + { + min_api_version = 15 } ) @@ -114,6 +117,9 @@ test.register_message_test( direction = "send", message = mock_device:generate_test_message("main", capabilities.doorControl.door.closed()) } + }, + { + min_api_version = 15 } ) @@ -143,6 +149,9 @@ test.register_message_test( clusters.OnOff.server.commands.On(mock_device, 1) } } + }, + { + min_api_version = 15 } ) @@ -170,6 +179,9 @@ test.register_message_test( clusters.OnOff.server.commands.Off(mock_device, 1) } } + }, + { + min_api_version = 15 } ) @@ -192,6 +204,9 @@ test.register_message_test( -- BatPercentRemaining is in units of 0.5%, so 200 = 100% message = mock_device:generate_test_message("main", capabilities.battery.battery(100)) } + }, + { + min_api_version = 15 } ) @@ -212,6 +227,9 @@ test.register_message_test( -- 150 * 0.5 = 75% message = mock_device:generate_test_message("main", capabilities.battery.battery(75)) } + }, + { + min_api_version = 15 } ) @@ -224,7 +242,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({profile = "garage-door-battery"}) mock_device:expect_metadata_update({provisioning_state = "PROVISIONED"}) end, - {min_api_version = 17} + {min_api_version = 15} ) test.register_coroutine_test( @@ -234,7 +252,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({profile = "garage-door-battery"}) mock_device:expect_metadata_update({provisioning_state = "PROVISIONED"}) end, - {min_api_version = 17} + {min_api_version = 15} ) @@ -298,6 +316,7 @@ test.register_coroutine_test( end, { test_init = function() test.mock_device.add_test_device(mock_device_misprofiled) end, + min_api_version = 15 } ) @@ -525,7 +544,7 @@ test.register_coroutine_test( end, { test_init = test_init_mk1, - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-thermostat/fingerprints.yml b/drivers/SmartThings/matter-thermostat/fingerprints.yml index 814261790e..399f3861fc 100644 --- a/drivers/SmartThings/matter-thermostat/fingerprints.yml +++ b/drivers/SmartThings/matter-thermostat/fingerprints.yml @@ -89,6 +89,21 @@ matterManufacturer: vendorId: 0x134E productId: 0x0002 deviceProfileName: thermostat-humidity-heating-only-nostate-nobattery + - id: "4942/7" + deviceLabel: Smart Thermostat X (2nd Gen) + vendorId: 0x134E + productId: 0x0007 + deviceProfileName: thermostat-humidity-heating-only-nostate-batteryLevel + - id: "4942/8" + deviceLabel: Wireless Temperature Sensor X (2nd Gen) + vendorId: 0x134E + productId: 0x0008 + deviceProfileName: thermostat-humidity-heating-only-nostate-batteryLevel + - id: "4942/9" + deviceLabel: Smart Radiator Thermostat X + vendorId: 0x134E + productId: 0x0009 + deviceProfileName: thermostat-humidity-heating-only-nostate-batteryLevel #Taruie - id: "5151/4101" deviceLabel: TARUIE AC Remote diff --git a/drivers/SmartThings/matter-thermostat/src/test/test_matter_air_purifier.lua b/drivers/SmartThings/matter-thermostat/src/test/test_matter_air_purifier.lua index 0a97b12181..630896d25c 100644 --- a/drivers/SmartThings/matter-thermostat/src/test/test_matter_air_purifier.lua +++ b/drivers/SmartThings/matter-thermostat/src/test/test_matter_air_purifier.lua @@ -432,7 +432,7 @@ test.register_coroutine_test( end, { test_init = test_init_ap_aqs, - min_api_version = 17 + min_api_version = 15 } ) @@ -448,7 +448,7 @@ test.register_coroutine_test( end, { test_init = test_init_ap_thermo_aqs, - min_api_version = 17 + min_api_version = 15 } ) @@ -473,7 +473,7 @@ test.register_coroutine_test( end, { test_init = test_init_ap_thermo_aqs_preconfigured, - min_api_version = 17 + min_api_version = 15 } ) @@ -530,7 +530,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -574,7 +574,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -612,7 +612,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -660,7 +660,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -721,7 +721,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -777,7 +777,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -799,7 +799,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -870,7 +870,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -888,7 +888,7 @@ test.register_coroutine_test( end, { test_init = test_init_ap_thermo_aqs_preconfigured, - min_api_version = 17 + min_api_version = 15 } ) @@ -914,7 +914,7 @@ test.register_coroutine_test( end, { test_init = test_init_ap_thermo_aqs_preconfigured, - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-thermostat/src/test/test_matter_air_purifier_api9.lua b/drivers/SmartThings/matter-thermostat/src/test/test_matter_air_purifier_api9.lua index 8bb8a6c920..4fed28f10f 100644 --- a/drivers/SmartThings/matter-thermostat/src/test/test_matter_air_purifier_api9.lua +++ b/drivers/SmartThings/matter-thermostat/src/test/test_matter_air_purifier_api9.lua @@ -6,9 +6,6 @@ local capabilities = require "st.capabilities" local clusters = require "st.matter.clusters" local SinglePrecisionFloat = require "st.matter.data_types.SinglePrecisionFloat" local t_utils = require "integration_test.utils" -local version = require "version" - -version.api = 9 -- include driver-side cluster definitions to test embedded clusters on lower api versions clusters.HepaFilterMonitoring = require "embedded_clusters.HepaFilterMonitoring" @@ -432,7 +429,8 @@ test.register_coroutine_test( end, { test_init = test_init_ap_aqs, - min_api_version = 17 + min_api_version = 9, + max_api_version = 10 } ) @@ -448,7 +446,8 @@ test.register_coroutine_test( end, { test_init = test_init_ap_thermo_aqs, - min_api_version = 17 + min_api_version = 9, + max_api_version = 10 } ) @@ -473,7 +472,8 @@ test.register_coroutine_test( end, { test_init = test_init_ap_thermo_aqs_preconfigured, - min_api_version = 17 + min_api_version = 9, + max_api_version = 10 } ) @@ -530,7 +530,8 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 9, + max_api_version = 10 } ) @@ -574,7 +575,8 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 9, + max_api_version = 10 } ) @@ -612,7 +614,8 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 9, + max_api_version = 10 } ) @@ -660,7 +663,8 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 9, + max_api_version = 10 } ) @@ -721,7 +725,8 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 9, + max_api_version = 10 } ) @@ -778,7 +783,8 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 9, + max_api_version = 10 } ) @@ -800,7 +806,8 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 9, + max_api_version = 10 } ) @@ -872,7 +879,8 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 9, + max_api_version = 10 } ) @@ -890,7 +898,8 @@ test.register_coroutine_test( end, { test_init = test_init_ap_thermo_aqs_preconfigured, - min_api_version = 17 + min_api_version = 9, + max_api_version = 10 } ) @@ -916,7 +925,8 @@ test.register_coroutine_test( end, { test_init = test_init_ap_thermo_aqs_preconfigured, - min_api_version = 17 + min_api_version = 9, + max_api_version = 10 } ) diff --git a/drivers/SmartThings/matter-thermostat/src/test/test_matter_air_purifier_modular.lua b/drivers/SmartThings/matter-thermostat/src/test/test_matter_air_purifier_modular.lua index 6aefcb5045..fcc8740458 100644 --- a/drivers/SmartThings/matter-thermostat/src/test/test_matter_air_purifier_modular.lua +++ b/drivers/SmartThings/matter-thermostat/src/test/test_matter_air_purifier_modular.lua @@ -317,7 +317,7 @@ test.register_coroutine_test( end, { test_init = test_init_basic, - min_api_version = 17 + min_api_version = 15 } ) @@ -394,7 +394,7 @@ test.register_coroutine_test( end, { test_init = test_init_ap_thermo_aqs_preconfigured, - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-thermostat/src/test/test_matter_fan.lua b/drivers/SmartThings/matter-thermostat/src/test/test_matter_fan.lua index 91d3303f78..8d8964acf0 100644 --- a/drivers/SmartThings/matter-thermostat/src/test/test_matter_fan.lua +++ b/drivers/SmartThings/matter-thermostat/src/test/test_matter_fan.lua @@ -113,7 +113,7 @@ test.register_coroutine_test( end, { test_init = test_init, - min_api_version = 17 + min_api_version = 15 } ) @@ -128,7 +128,7 @@ test.register_coroutine_test( end, { test_init = test_init_generic, - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-thermostat/src/test/test_matter_heat_pump.lua b/drivers/SmartThings/matter-thermostat/src/test/test_matter_heat_pump.lua index 66c6e593ed..730a5db48a 100644 --- a/drivers/SmartThings/matter-thermostat/src/test/test_matter_heat_pump.lua +++ b/drivers/SmartThings/matter-thermostat/src/test/test_matter_heat_pump.lua @@ -148,7 +148,7 @@ test.register_coroutine_test( assert(component_to_endpoint_map["thermostatTwo"] == THERMOSTAT_TWO_EP, string.format("Thermostat Two Endpoint must be %d", THERMOSTAT_TWO_EP)) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -193,7 +193,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -238,7 +238,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -279,7 +279,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -320,7 +320,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -387,7 +387,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -475,7 +475,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -546,7 +546,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -613,7 +613,7 @@ test.register_message_test( }, { test_init = test_init_auto, - min_api_version = 17 + min_api_version = 15 } ) @@ -637,7 +637,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -662,7 +662,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -710,7 +710,7 @@ test.register_coroutine_test( test_init = function() test_init() end, - min_api_version = 17 + min_api_version = 15 } ) @@ -763,7 +763,7 @@ test.register_coroutine_test( test_init = function() test_init() end, - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-thermostat/src/test/test_matter_room_ac.lua b/drivers/SmartThings/matter-thermostat/src/test/test_matter_room_ac.lua index 2f7085bff2..012fc0ab66 100644 --- a/drivers/SmartThings/matter-thermostat/src/test/test_matter_room_ac.lua +++ b/drivers/SmartThings/matter-thermostat/src/test/test_matter_room_ac.lua @@ -296,7 +296,7 @@ test.register_coroutine_test( end, { test_init = test_init_configure, - min_api_version = 17 + min_api_version = 15 } ) @@ -317,7 +317,7 @@ test.register_coroutine_test( end, { test_init = test_init_nostate, - min_api_version = 17 + min_api_version = 15 } ) @@ -355,7 +355,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -411,7 +411,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -459,7 +459,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -495,7 +495,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -544,7 +544,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -584,7 +584,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-thermostat/src/test/test_matter_room_ac_modular.lua b/drivers/SmartThings/matter-thermostat/src/test/test_matter_room_ac_modular.lua index aac1ecd4bc..fe15fdb026 100644 --- a/drivers/SmartThings/matter-thermostat/src/test/test_matter_room_ac_modular.lua +++ b/drivers/SmartThings/matter-thermostat/src/test/test_matter_room_ac_modular.lua @@ -314,7 +314,7 @@ test.register_coroutine_test( end, { test_init = test_init_basic, - min_api_version = 17 + min_api_version = 15 } ) @@ -342,7 +342,7 @@ test.register_coroutine_test( end, { test_init = test_init_no_state, - min_api_version = 17 + min_api_version = 15 } ) test.run_registered_tests() diff --git a/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermo_battery.lua b/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermo_battery.lua index 5352a65a9d..0206d949f5 100644 --- a/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermo_battery.lua +++ b/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermo_battery.lua @@ -107,7 +107,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ profile = "thermostat-cooling-only-nostate" }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -129,7 +129,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ profile = "thermostat-cooling-only-nostate-batteryLevel" }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -144,7 +144,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermo_featuremap.lua b/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermo_featuremap.lua index 377725fba0..efdeeec6fe 100644 --- a/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermo_featuremap.lua +++ b/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermo_featuremap.lua @@ -228,7 +228,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ profile = "thermostat-humidity-fan-heating-only" }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -252,7 +252,7 @@ test.register_coroutine_test( test.socket.device_lifecycle:__queue_receive(mock_device:generate_info_changed(updates)) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -277,7 +277,7 @@ test.register_coroutine_test( mock_device_simple:expect_metadata_update({ profile = "thermostat-cooling-only-nostate" }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -294,7 +294,7 @@ test.register_coroutine_test( mock_device_no_battery:expect_metadata_update({ profile = "thermostat-cooling-only-nostate-nobattery" }) end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermo_multiple_device_types.lua b/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermo_multiple_device_types.lua index 4e7704feb1..ac72e56018 100644 --- a/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermo_multiple_device_types.lua +++ b/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermo_multiple_device_types.lua @@ -240,7 +240,7 @@ test.register_coroutine_test( get_subscribe_request(mock_device, new_cluster_subscribe_list)) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -252,7 +252,7 @@ test.register_coroutine_test( end, { test_init = test_init_disorder_endpoints, - min_api_version = 17 + min_api_version = 15 } ) @@ -286,7 +286,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermo_setpoint_limits.lua b/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermo_setpoint_limits.lua index 1d772fb2f1..ae5dcc10af 100644 --- a/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermo_setpoint_limits.lua +++ b/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermo_setpoint_limits.lua @@ -150,7 +150,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -179,7 +179,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -208,7 +208,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -237,7 +237,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -259,7 +259,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -281,7 +281,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -297,7 +297,7 @@ test.register_coroutine_test( assert(min_setpoint_deadband_checked == true, "min_setpoint_deadband_checked is True") end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -327,7 +327,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -357,7 +357,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -387,7 +387,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermo_setpoint_limits_rpc.lua b/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermo_setpoint_limits_rpc.lua index 3dd153d270..13702d015d 100644 --- a/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermo_setpoint_limits_rpc.lua +++ b/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermo_setpoint_limits_rpc.lua @@ -101,7 +101,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -126,7 +126,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -151,7 +151,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermostat.lua b/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermostat.lua index d1373c036d..c7ab7d646f 100644 --- a/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermostat.lua +++ b/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermostat.lua @@ -169,7 +169,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -191,7 +191,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -213,7 +213,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -240,7 +240,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -267,7 +267,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -289,7 +289,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -311,7 +311,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -333,7 +333,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -355,7 +355,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -392,7 +392,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -441,7 +441,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -490,7 +490,7 @@ test.register_message_test( }, { test_init = test_init_auto, - min_api_version = 17 + min_api_version = 15 } ) @@ -530,7 +530,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -571,7 +571,7 @@ test.register_message_test( }, { test_init = test_init_auto, - min_api_version = 17 + min_api_version = 15 } ) @@ -623,7 +623,7 @@ test.register_message_test( }, { test_init = test_init_auto, - min_api_version = 17 + min_api_version = 15 } ) @@ -680,7 +680,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -716,7 +716,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -741,7 +741,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -766,7 +766,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -791,7 +791,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -832,7 +832,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -857,7 +857,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -878,7 +878,7 @@ test.register_coroutine_test("Battery percent reports should generate correct me test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -933,7 +933,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermostat_composed_bridged.lua b/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermostat_composed_bridged.lua index af44bf73f6..07e9e94604 100644 --- a/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermostat_composed_bridged.lua +++ b/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermostat_composed_bridged.lua @@ -98,7 +98,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -121,7 +121,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -144,7 +144,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -173,7 +173,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -202,7 +202,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -225,7 +225,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -248,7 +248,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -271,7 +271,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -294,7 +294,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -329,7 +329,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -382,7 +382,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -424,7 +424,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -474,7 +474,7 @@ test.register_message_test( }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -512,7 +512,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -537,7 +537,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -562,7 +562,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -587,7 +587,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -628,7 +628,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -653,7 +653,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -674,7 +674,7 @@ test.register_coroutine_test("Battery percent reports should generate correct me test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -729,7 +729,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermostat_modular.lua b/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermostat_modular.lua index a678e85499..b1aca3242e 100644 --- a/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermostat_modular.lua +++ b/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermostat_modular.lua @@ -179,7 +179,7 @@ test.register_coroutine_test( end, { test_init = test_init, - min_api_version = 17 + min_api_version = 15 } ) @@ -245,7 +245,10 @@ test.register_coroutine_test( test.socket.device_lifecycle:__queue_receive(mock_device_modular:generate_info_changed({ profile = updated_device_profile })) test.socket.matter:__expect_send({mock_device_modular.id, subscribe_request}) end, - { test_init = test_init_modular_fingerprint } + { + test_init = test_init_modular_fingerprint, + min_api_version = 15 + } ) test.register_coroutine_test( @@ -253,7 +256,10 @@ test.register_coroutine_test( -- simulate no actual change test.socket.device_lifecycle:__queue_receive(mock_device_modular:generate_info_changed({})) end, - { test_init = function() test.mock_device.add_test_device(mock_device_modular) end } + { + test_init = function() test.mock_device.add_test_device(mock_device_modular) end, + min_api_version = 15 + } ) local function initialize_subscribe_request(mock_device, subscribed_attributes) @@ -318,7 +324,10 @@ test.register_coroutine_test( test.socket.device_lifecycle:__queue_receive(mock_device_modular:generate_info_changed({ profile = updated_device_profile })) test.socket.matter:__expect_send({mock_device_modular.id, subscribe_request}) end, - { test_init = test_init_modular_fingerprint } + { + test_init = test_init_modular_fingerprint, + min_api_version = 15 + } ) test.register_coroutine_test( @@ -326,7 +335,10 @@ test.register_coroutine_test( -- simulate no actual change test.socket.device_lifecycle:__queue_receive(mock_device_modular:generate_info_changed({})) end, - { test_init = function() test.mock_device.add_test_device(mock_device_modular) end } + { + test_init = function() test.mock_device.add_test_device(mock_device_modular) end, + min_api_version = 15 + } ) -- run tests diff --git a/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermostat_rpc5.lua b/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermostat_rpc5.lua index f7078703ac..6c05f671e5 100644 --- a/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermostat_rpc5.lua +++ b/drivers/SmartThings/matter-thermostat/src/test/test_matter_thermostat_rpc5.lua @@ -137,7 +137,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-thermostat/src/test/test_matter_water_heater.lua b/drivers/SmartThings/matter-thermostat/src/test/test_matter_water_heater.lua index b4336beeb4..7c279a68c0 100644 --- a/drivers/SmartThings/matter-thermostat/src/test/test_matter_water_heater.lua +++ b/drivers/SmartThings/matter-thermostat/src/test/test_matter_water_heater.lua @@ -117,7 +117,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -142,7 +142,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -204,7 +204,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -236,7 +236,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -261,7 +261,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -331,7 +331,7 @@ test.register_coroutine_test( test_init = function() test_init() end, - min_api_version = 17 + min_api_version = 15 } ) @@ -433,7 +433,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/matter-thermostat/src/test/test_unsupported_unit_conversion.lua b/drivers/SmartThings/matter-thermostat/src/test/test_unsupported_unit_conversion.lua new file mode 100644 index 0000000000..6c29de18a9 --- /dev/null +++ b/drivers/SmartThings/matter-thermostat/src/test/test_unsupported_unit_conversion.lua @@ -0,0 +1,63 @@ +-- Copyright © 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + +local test = require "integration_test" +local capabilities = require "st.capabilities" + +-- Unit conversion utilities for thermostat +local thermostat_utils = require "thermostat_utils.utils" +local thermostat_fields = require "thermostat_utils.fields" + +local units = thermostat_fields.units + +test.register_coroutine_test( + "Unsupported unit conversion from PPT to MGM3 should return nil", + function() + local result = thermostat_utils.convert_value_to_unit(100, units.PPT, units.MGM3, capabilities.ozoneMeasurement.NAME) + assert(result == nil, "Expected nil for unsupported PPT to MGM3 conversion, got: " .. tostring(result)) + end +) + +test.register_coroutine_test( + "Unsupported unit conversion from PPB to UGM3 should return nil", + function() + local result = thermostat_utils.convert_value_to_unit(100, units.PPB, units.UGM3, capabilities.carbonMonoxideMeasurement.NAME) + assert(result == nil, "Expected nil for unsupported PPB to UGM3 conversion, got: " .. tostring(result)) + end +) + +test.register_coroutine_test( + "Unsupported unit conversion from NGM3 to PPM should return nil", + function() + local result = thermostat_utils.convert_value_to_unit(100, units.NGM3, units.PPM, capabilities.carbonMonoxideMeasurement.NAME) + assert(result == nil, "Expected nil for unsupported NGM3 to PPM conversion, got: " .. tostring(result)) + end +) + +test.register_coroutine_test( + "Supported unit conversion from PPM to PPB should return correct value", + function() + local result = thermostat_utils.convert_value_to_unit(100, units.PPM, units.PPB, capabilities.carbonMonoxideMeasurement.NAME) + assert(result ~= nil, "Expected a value for supported PPM to PPB conversion") + assert(result == 100000, "Expected 100000 for PPM to PPB conversion, got: " .. tostring(result)) + end +) + +test.register_coroutine_test( + "Supported unit conversion from PPB to PPM should return correct value", + function() + local result = thermostat_utils.convert_value_to_unit(1000, units.PPB, units.PPM, capabilities.carbonMonoxideMeasurement.NAME) + assert(result ~= nil, "Expected a value for supported PPB to PPM conversion") + assert(result == 1, "Expected 1 for PPB to PPM conversion, got: " .. tostring(result)) + end +) + +test.register_coroutine_test( + "Unit conversion with non-numeric value should return nil", + function() + local result = thermostat_utils.convert_value_to_unit("not a number", units.PPM, units.PPB, capabilities.carbonMonoxideMeasurement.NAME) + assert(result == nil, "Expected nil when value is not a number, got: " .. tostring(result)) + end +) + +test.run_registered_tests() diff --git a/drivers/SmartThings/matter-thermostat/src/thermostat_handlers/attribute_handlers.lua b/drivers/SmartThings/matter-thermostat/src/thermostat_handlers/attribute_handlers.lua index f0a210bc16..e5b3728b61 100644 --- a/drivers/SmartThings/matter-thermostat/src/thermostat_handlers/attribute_handlers.lua +++ b/drivers/SmartThings/matter-thermostat/src/thermostat_handlers/attribute_handlers.lua @@ -494,23 +494,15 @@ end function AttributeHandlers.concentration_measured_value_factory(capability_name, attribute, target_unit) return function(driver, device, ib, response) - local reporting_unit = device:get_field(capability_name.."_unit") + if not ib.data.value then return end + local reporting_unit = device:get_field(capability_name.."_unit") or fields.unit_default[capability_name] + local converted_value = thermostat_utils.convert_value_to_unit(ib.data.value, reporting_unit, target_unit, capability_name) - if not reporting_unit then - reporting_unit = fields.unit_default[capability_name] - device:set_field(capability_name.."_unit", reporting_unit, {persist = true}) - end - - local value = nil - if reporting_unit then - value = thermostat_utils.unit_conversion(ib.data.value, reporting_unit, target_unit, capability_name) - end - - if value then - device:emit_event_for_endpoint(ib.endpoint_id, attribute({value = value, unit = fields.unit_strings[target_unit]})) + if converted_value then + device:emit_event_for_endpoint(ib.endpoint_id, attribute({value = converted_value, unit = fields.unit_strings[target_unit]})) -- handle case where device profile supports both fineDustLevel and dustLevel if capability_name == capabilities.fineDustSensor.NAME and device:supports_capability(capabilities.dustSensor) then - device:emit_event_for_endpoint(ib.endpoint_id, capabilities.dustSensor.fineDustLevel({value = value, unit = fields.unit_strings[target_unit]})) + device:emit_event_for_endpoint(ib.endpoint_id, capabilities.dustSensor.fineDustLevel({value = converted_value, unit = fields.unit_strings[target_unit]})) end end end diff --git a/drivers/SmartThings/matter-thermostat/src/thermostat_utils/fields.lua b/drivers/SmartThings/matter-thermostat/src/thermostat_utils/fields.lua index 770fd7d65e..ddedab385d 100644 --- a/drivers/SmartThings/matter-thermostat/src/thermostat_utils/fields.lua +++ b/drivers/SmartThings/matter-thermostat/src/thermostat_utils/fields.lua @@ -1,6 +1,7 @@ -- Copyright © 2025 SmartThings, Inc. -- Licensed under the Apache License, Version 2.0 +local log = require "log" local version = require "version" local capabilities = require "st.capabilities" local clusters = require "st.matter.clusters" @@ -205,13 +206,24 @@ ThermostatFields.molecular_weights = { [capabilities.tvocMeasurement.NAME] = "N/A", } -ThermostatFields.conversion_tables = { +local function is_valid_molecular_weight(molecular_weight) + if type(molecular_weight) ~= "number" or molecular_weight <= 0 then + log.warn_with({hub_logs = true}, string.format("unit conversion molecular weight (%s) is not a valid number", molecular_weight)) + return false + end + return true +end + +ThermostatFields.unit_conversion = { [units.PPM] = { [units.PPM] = function(value) return st_utils.round(value) end, [units.PPB] = function(value) return st_utils.round(value * (10^3)) end, - [units.UGM3] = function(value, molecular_weight) return st_utils.round((value * molecular_weight * 10^3) / ThermostatFields.MGM3_PPM_CONVERSION_FACTOR) end, - [units.MGM3] = function(value, molecular_weight) return st_utils.round((value * molecular_weight) / ThermostatFields.MGM3_PPM_CONVERSION_FACTOR) end, - }, + [units.UGM3] = function(value, molecular_weight) if is_valid_molecular_weight(molecular_weight) then + return st_utils.round((value * molecular_weight * 10^3) / ThermostatFields.MGM3_PPM_CONVERSION_FACTOR) end + end, + [units.MGM3] = function(value, molecular_weight) if is_valid_molecular_weight(molecular_weight) then + return st_utils.round((value * molecular_weight) / ThermostatFields.MGM3_PPM_CONVERSION_FACTOR) end + end,}, [units.PPB] = { [units.PPM] = function(value) return st_utils.round(value/(10^3)) end, [units.PPB] = function(value) return st_utils.round(value) end, @@ -221,11 +233,15 @@ ThermostatFields.conversion_tables = { }, [units.MGM3] = { [units.UGM3] = function(value) return st_utils.round(value * (10^3)) end, - [units.PPM] = function(value, molecular_weight) return st_utils.round((value * ThermostatFields.MGM3_PPM_CONVERSION_FACTOR) / molecular_weight) end, + [units.PPM] = function(value, molecular_weight) if is_valid_molecular_weight(molecular_weight) then + return st_utils.round((value * ThermostatFields.MGM3_PPM_CONVERSION_FACTOR) / molecular_weight) end + end, }, [units.UGM3] = { [units.UGM3] = function(value) return st_utils.round(value) end, - [units.PPM] = function(value, molecular_weight) return st_utils.round((value * ThermostatFields.MGM3_PPM_CONVERSION_FACTOR) / (molecular_weight * 10^3)) end, + [units.PPM] = function(value, molecular_weight) if is_valid_molecular_weight(molecular_weight) then + return st_utils.round((value * ThermostatFields.MGM3_PPM_CONVERSION_FACTOR) / (molecular_weight * 10^3)) end + end, }, [units.NGM3] = { [units.UGM3] = function(value) return st_utils.round(value/(10^3)) end diff --git a/drivers/SmartThings/matter-thermostat/src/thermostat_utils/utils.lua b/drivers/SmartThings/matter-thermostat/src/thermostat_utils/utils.lua index a233a0c0e7..940fe9835e 100644 --- a/drivers/SmartThings/matter-thermostat/src/thermostat_utils/utils.lua +++ b/drivers/SmartThings/matter-thermostat/src/thermostat_utils/utils.lua @@ -180,18 +180,15 @@ function ThermostatUtils.get_device_type(device) return main_device_type end -function ThermostatUtils.unit_conversion(value, from_unit, to_unit, capability_name) - local conversion_function = fields.conversion_tables[from_unit] and fields.conversion_tables[from_unit][to_unit] or nil +function ThermostatUtils.convert_value_to_unit(value, from_unit, to_unit, capability_name) + local conversion_function = fields.unit_conversion[from_unit] and fields.unit_conversion[from_unit][to_unit] if not conversion_function then log.info_with( {hub_logs = true} , string.format("Unsupported unit conversion from %s to %s", fields.unit_strings[from_unit], fields.unit_strings[to_unit])) return - end - - if not value then - log.info_with( {hub_logs = true} , "unit conversion value is nil") + elseif type(value) ~= "number" then + log.info_with( {hub_logs = true} , string.format("unit conversion value (%s) is not a number", value)) return end - return conversion_function(value, fields.molecular_weights[capability_name]) end diff --git a/drivers/SmartThings/matter-window-covering/profiles/window-covering-battery.yml b/drivers/SmartThings/matter-window-covering/profiles/window-covering-battery.yml index a1896ca634..ad2dc6f0ac 100644 --- a/drivers/SmartThings/matter-window-covering/profiles/window-covering-battery.yml +++ b/drivers/SmartThings/matter-window-covering/profiles/window-covering-battery.yml @@ -8,6 +8,8 @@ components: version: 1 - id: windowShadeLevel version: 1 + - id: statelessWindowShadeLevelStep + version: 1 - id: battery version: 1 - id: firmwareUpdate diff --git a/drivers/SmartThings/matter-window-covering/profiles/window-covering-batteryLevel.yml b/drivers/SmartThings/matter-window-covering/profiles/window-covering-batteryLevel.yml index fa46d87cc6..c541d47ae8 100644 --- a/drivers/SmartThings/matter-window-covering/profiles/window-covering-batteryLevel.yml +++ b/drivers/SmartThings/matter-window-covering/profiles/window-covering-batteryLevel.yml @@ -8,6 +8,8 @@ components: version: 1 - id: windowShadeLevel version: 1 + - id: statelessWindowShadeLevelStep + version: 1 - id: batteryLevel version: 1 - id: firmwareUpdate diff --git a/drivers/SmartThings/matter-window-covering/profiles/window-covering-profile.yml b/drivers/SmartThings/matter-window-covering/profiles/window-covering-profile.yml index 903565e68c..94e98998b3 100644 --- a/drivers/SmartThings/matter-window-covering/profiles/window-covering-profile.yml +++ b/drivers/SmartThings/matter-window-covering/profiles/window-covering-profile.yml @@ -9,6 +9,8 @@ components: version: 1 - id: windowShadeLevel version: 1 + - id: statelessWindowShadeLevelStep + version: 1 - id: battery version: 1 - id: firmwareUpdate diff --git a/drivers/SmartThings/matter-window-covering/profiles/window-covering-tilt-battery.yml b/drivers/SmartThings/matter-window-covering/profiles/window-covering-tilt-battery.yml index 27f7f1f61a..bca45d37af 100644 --- a/drivers/SmartThings/matter-window-covering/profiles/window-covering-tilt-battery.yml +++ b/drivers/SmartThings/matter-window-covering/profiles/window-covering-tilt-battery.yml @@ -8,6 +8,8 @@ components: version: 1 - id: windowShadeLevel version: 1 + - id: statelessWindowShadeLevelStep + version: 1 - id: windowShadeTiltLevel version: 1 - id: battery diff --git a/drivers/SmartThings/matter-window-covering/profiles/window-covering-tilt.yml b/drivers/SmartThings/matter-window-covering/profiles/window-covering-tilt.yml index c6a759b610..99a579e2c6 100644 --- a/drivers/SmartThings/matter-window-covering/profiles/window-covering-tilt.yml +++ b/drivers/SmartThings/matter-window-covering/profiles/window-covering-tilt.yml @@ -8,6 +8,8 @@ components: version: 1 - id: windowShadeLevel version: 1 + - id: statelessWindowShadeLevelStep + version: 1 - id: windowShadeTiltLevel version: 1 - id: firmwareUpdate diff --git a/drivers/SmartThings/matter-window-covering/profiles/window-covering.yml b/drivers/SmartThings/matter-window-covering/profiles/window-covering.yml index fbd40ed08d..e90a3fdb23 100644 --- a/drivers/SmartThings/matter-window-covering/profiles/window-covering.yml +++ b/drivers/SmartThings/matter-window-covering/profiles/window-covering.yml @@ -8,6 +8,8 @@ components: version: 1 - id: windowShadeLevel version: 1 + - id: statelessWindowShadeLevelStep + version: 1 - id: firmwareUpdate version: 1 - id: refresh diff --git a/drivers/SmartThings/matter-window-covering/src/init.lua b/drivers/SmartThings/matter-window-covering/src/init.lua index 66581d0ae8..ba03737a73 100644 --- a/drivers/SmartThings/matter-window-covering/src/init.lua +++ b/drivers/SmartThings/matter-window-covering/src/init.lua @@ -6,21 +6,135 @@ --Note: No support for setting device into calibration mode, it must be done manually local capabilities = require "st.capabilities" local im = require "st.matter.interaction_model" -local log = require "log" local clusters = require "st.matter.clusters" local MatterDriver = require "st.matter.driver" +local utils = require "st.utils" -local CURRENT_LIFT = "__current_lift" -local CURRENT_TILT = "__current_tilt" local battery_support = { NO_BATTERY = "NO_BATTERY", BATTERY_LEVEL = "BATTERY_LEVEL", BATTERY_PERCENTAGE = "BATTERY_PERCENTAGE" } -local REVERSE_POLARITY = "__reverse_polarity" -local PRESET_LEVEL_KEY = "__preset_level_key" +local OP_STATUS_BITMAP = { + idle = 0x00, + opening = 0x01, + closing = 0x02 +} local DEFAULT_PRESET_LEVEL = 50 +local TARGET_LIFT_PERCENT = { + TIMEOUT_DELAY_S = 120, + TIMEOUT = "__target_lift_percent_timeout", + STATE = "__target_lift_percent" +} + +local TARGET_TILT_PERCENT = { + TIMEOUT_DELAY_S = 120, + TIMEOUT = "__target_tilt_percent_timeout", + STATE = "__target_tilt_percent" +} + +local TARGET_REACH_TOLERANCE = 0.5 + +--- Gets the current window shade status based on the lift and tilt positions. +---@param device any a Matter device object +---@return any status the current window shade status +local function get_idle_window_shade_status(device) + -- Update the window shade status according to the lift and tilt positions. + -- LIFT TILT Window Shade + -- 100 any Open + -- 1-99 any Partially Open + -- 0 1-100 Partially Open + -- 0 0 Closed + -- 0 nil Closed + -- nil 100 Open + -- nil 1-99 Partially Open + -- nil 0 Closed + -- Note that lift or tilt may be nil if either the window shade does not + -- support them or if they haven't been received from a device report yet. + + local lift_position = device:get_latest_state( + "main", + capabilities.windowShadeLevel.ID, + capabilities.windowShadeLevel.shadeLevel.NAME + ) + local tilt_position = device:get_latest_state( + "main", + capabilities.windowShadeTiltLevel.ID, + capabilities.windowShadeTiltLevel.shadeTiltLevel.NAME + ) + local reverse = device.preferences.reverse + local windowShade = capabilities.windowShade.windowShade + local status_event = windowShade.unknown() + + if lift_position == nil then + if tilt_position == 0 then + status_event = reverse and windowShade.open() or windowShade.closed() + elseif tilt_position == 100 then + status_event = reverse and windowShade.closed() or windowShade.open() + else + status_event = windowShade.partially_open() + end + elseif lift_position == 100 then + status_event = reverse and windowShade.closed() or windowShade.open() + elseif lift_position > 0 then + status_event = windowShade.partially_open() + elseif lift_position == 0 then + if tilt_position == nil or tilt_position == 0 then + status_event = reverse and windowShade.open() or windowShade.closed() + elseif tilt_position > 0 then + status_event = windowShade.partially_open() + end + end + return status_event +end + +--- Clears the cached target percentage and cancels any associated timeout. +--- @param device any a Matter device object +--- @param op_fields table a table containing operational field constants used for caching target percentages and timeouts. +local function clear_cached_data(device, op_fields) + local current_timer = device:get_field(op_fields.TIMEOUT) + if current_timer then + device.thread:cancel_timer(current_timer) + end + device:set_field(op_fields.STATE, nil) + device:set_field(op_fields.TIMEOUT, nil) +end + +--- Tries to emit the idle window shade status if no target percentages are set. +--- @param device any a Matter device object +local function try_emit_idle_window_shade_status(device) + if not device:get_field(TARGET_LIFT_PERCENT.STATE) and + not device:get_field(TARGET_TILT_PERCENT.STATE) then + device:emit_event(get_idle_window_shade_status(device)) + end +end + +--- Caches the target percentage for a device and sets a timeout to clear it. +--- @param device any a Matter device object +--- @param data number the target percentage to cache +--- @param op_fields table a table containing operational field constants used for caching target percentages and timeouts. +local function cache_data_with_timeout(device, data, op_fields) + device:set_field(op_fields.STATE, data) + local previous_timer = device:get_field(op_fields.TIMEOUT) + if previous_timer then + device.thread:cancel_timer(previous_timer) + end + local new_timer = device.thread:call_with_delay(op_fields.TIMEOUT_DELAY_S, function() + device:set_field(op_fields.STATE, nil) + device:set_field(op_fields.TIMEOUT, nil) + try_emit_idle_window_shade_status(device) + end) + device:set_field(op_fields.TIMEOUT, new_timer) +end + +local function is_target_value_reached(current_value, target_value) + if (target_value and math.abs(current_value - target_value) <= TARGET_REACH_TOLERANCE) then + return true + end + return false +end + local function find_default_endpoint(device, cluster) local res = device.MATTER_DEFAULT_ENDPOINT local eps = device:get_endpoints(cluster) @@ -60,17 +174,18 @@ local function match_profile(device, battery_supported) end local function device_init(driver, device) + -- set unused fields to nil. These field settings can be removed after a single driver update. + device:set_field("__preset_level_key", nil) + device:set_field("__reverse_polarity", nil) + device:set_component_to_endpoint_fn(component_to_endpoint) if device:supports_capability_by_id(capabilities.windowShadePreset.ID) and device:get_latest_state("main", capabilities.windowShadePreset.ID, capabilities.windowShadePreset.position.NAME) == nil then -- These should only ever be nil once (and at the same time) for already-installed devices -- It can be removed after migration is complete device:emit_event(capabilities.windowShadePreset.supportedCommands({"presetPosition", "setPresetPosition"}, {visibility = {displayed = false}})) - local preset_position = device:get_field(PRESET_LEVEL_KEY) or - (device.preferences ~= nil and device.preferences.presetPosition) or - DEFAULT_PRESET_LEVEL + local preset_position = device.preferences.presetPosition or DEFAULT_PRESET_LEVEL device:emit_event(capabilities.windowShadePreset.position(preset_position, {visibility = {displayed = false}})) - device:set_field(PRESET_LEVEL_KEY, preset_position, {persist = true}) end device:subscribe() end @@ -88,17 +203,8 @@ end local function info_changed(driver, device, event, args) if device.profile.id ~= args.old_st_store.profile.id then - -- Profile has changed, resubscribe device:subscribe() - elseif args.old_st_store.preferences.reverse ~= device.preferences.reverse then - if device.preferences.reverse then - device:set_field(REVERSE_POLARITY, true, { persist = true }) - else - device:set_field(REVERSE_POLARITY, false, { persist = true }) - end - else - -- Something else has changed info (SW update, reinterview, etc.), so - -- try updating profile as needed + elseif device.matter_version.software ~= args.old_st_store.matter_version.software then local battery_feature_eps = device:get_endpoints(clusters.PowerSource.ID, {feature_bitmap = clusters.PowerSource.types.PowerSourceFeature.BATTERY}) if #battery_feature_eps > 0 then local attribute_list_read = im.InteractionRequest(im.InteractionRequest.RequestType.READ, {}) @@ -114,17 +220,18 @@ local function device_added(driver, device) device:emit_event( capabilities.windowShade.supportedWindowShadeCommands({"open", "close", "pause"}, {visibility = {displayed = false}}) ) - device:set_field(REVERSE_POLARITY, false, { persist = true }) end -local function device_removed(driver, device) log.info("device removed") end - -- capability handlers local function handle_preset(driver, device, cmd) - local lift_value = device:get_latest_state( - "main", capabilities.windowShadePreset.ID, capabilities.windowShadePreset.position.NAME - ) or DEFAULT_PRESET_LEVEL - local hundredths_lift_percent = (100 - lift_value) * 100 + local preset_target_percent = device:get_latest_state( + "main", + capabilities.windowShadePreset.ID, + capabilities.windowShadePreset.position.NAME, + DEFAULT_PRESET_LEVEL + ) + cache_data_with_timeout(device, preset_target_percent, TARGET_LIFT_PERCENT) + local hundredths_lift_percent = (100 - preset_target_percent) * 100 local endpoint_id = device:component_to_endpoint(cmd.component) device:send(clusters.WindowCovering.server.commands.GoToLiftPercentage( device, endpoint_id, hundredths_lift_percent @@ -133,136 +240,157 @@ end local function handle_set_preset(driver, device, cmd) local endpoint_id = device:component_to_endpoint(cmd.component) - device:set_field(PRESET_LEVEL_KEY, cmd.args.position) device:emit_event_for_endpoint(endpoint_id, capabilities.windowShadePreset.position(cmd.args.position)) end --- close covering local function handle_close(driver, device, cmd) local endpoint_id = device:component_to_endpoint(cmd.component) - local req = clusters.WindowCovering.server.commands.DownOrClose(device, endpoint_id) - if device:get_field(REVERSE_POLARITY) then - req = clusters.WindowCovering.server.commands.UpOrOpen(device, endpoint_id) + if #device:get_endpoints(clusters.WindowCovering.ID, {feature_bitmap = clusters.WindowCovering.types.Feature.LIFT}) > 0 then + cache_data_with_timeout(device, device.preferences.reverse and 100 or 0, TARGET_LIFT_PERCENT) end - device:send(req) + if #device:get_endpoints(clusters.WindowCovering.ID, {feature_bitmap = clusters.WindowCovering.types.Feature.TILT}) > 0 then + cache_data_with_timeout(device, device.preferences.reverse and 100 or 0, TARGET_TILT_PERCENT) + end + device:send(device.preferences.reverse and + clusters.WindowCovering.server.commands.UpOrOpen(device, endpoint_id) or + clusters.WindowCovering.server.commands.DownOrClose(device, endpoint_id) + ) end --- open covering local function handle_open(driver, device, cmd) local endpoint_id = device:component_to_endpoint(cmd.component) - local req = clusters.WindowCovering.server.commands.UpOrOpen(device, endpoint_id) - if device:get_field(REVERSE_POLARITY) then - req = clusters.WindowCovering.server.commands.DownOrClose(device, endpoint_id) + if #device:get_endpoints(clusters.WindowCovering.ID, {feature_bitmap = clusters.WindowCovering.types.Feature.LIFT}) > 0 then + cache_data_with_timeout(device, device.preferences.reverse and 0 or 100, TARGET_LIFT_PERCENT) end - device:send(req) + if #device:get_endpoints(clusters.WindowCovering.ID, {feature_bitmap = clusters.WindowCovering.types.Feature.TILT}) > 0 then + cache_data_with_timeout(device, device.preferences.reverse and 0 or 100, TARGET_TILT_PERCENT) + end + device:send(device.preferences.reverse and + clusters.WindowCovering.server.commands.DownOrClose(device, endpoint_id) or + clusters.WindowCovering.server.commands.UpOrOpen(device, endpoint_id) + ) end --- pause covering local function handle_pause(driver, device, cmd) local endpoint_id = device:component_to_endpoint(cmd.component) - local req = clusters.WindowCovering.server.commands.StopMotion(device, endpoint_id) - device:send(req) + device:send(clusters.WindowCovering.server.commands.StopMotion(device, endpoint_id)) end -- move to shade level between 0-100 local function handle_shade_level(driver, device, cmd) local endpoint_id = device:component_to_endpoint(cmd.component) - local lift_percentage_value = 100 - cmd.args.shadeLevel - local hundredths_lift_percentage = lift_percentage_value * 100 - local req = clusters.WindowCovering.server.commands.GoToLiftPercentage( - device, endpoint_id, hundredths_lift_percentage - ) - device:send(req) + local hundredths_lift_percentage = (100 - cmd.args.shadeLevel) * 100 + cache_data_with_timeout(device, cmd.args.shadeLevel, TARGET_LIFT_PERCENT) + device:send(clusters.WindowCovering.server.commands.GoToLiftPercentage( + device, endpoint_id, hundredths_lift_percentage + )) +end + +local function handle_step_shade_level(driver, device, cmd) + local step = cmd.args.stepSize + local latest_lift_percentage = device:get_latest_state( + "main", + capabilities.windowShadeLevel.ID, + capabilities.windowShadeLevel.shadeLevel.NAME, + 0 + ) + local target_lift_percent = device:get_field(TARGET_LIFT_PERCENT.STATE) or latest_lift_percentage + local updated_target_lift = utils.clamp_value(target_lift_percent + step, 0, 100) + cache_data_with_timeout(device, updated_target_lift, TARGET_LIFT_PERCENT) + driver:inject_capability_command(device, { + capability = capabilities.windowShadeLevel.ID, + component = cmd.component, + command = capabilities.windowShadeLevel.commands.setShadeLevel.NAME, + named_args = { shadeLevel = updated_target_lift } + }) end -- move to shade tilt level between 0-100 local function handle_shade_tilt_level(driver, device, cmd) local endpoint_id = device:component_to_endpoint(cmd.component) - local tilt_percentage_value = 100 - cmd.args.level - local hundredths_tilt_percentage = tilt_percentage_value * 100 - local req = clusters.WindowCovering.server.commands.GoToTiltPercentage( + local hundredths_tilt_percentage = (100 - cmd.args.level) * 100 + cache_data_with_timeout(device, cmd.args.level, TARGET_TILT_PERCENT) + device:send(clusters.WindowCovering.server.commands.GoToTiltPercentage( device, endpoint_id, hundredths_tilt_percentage - ) - device:send(req) + )) end --- current lift/tilt percentage, changed to 100ths percent -local current_pos_handler = function(attribute) - return function(driver, device, ib, response) - if ib.data.value == nil then - return - end - local windowShade = capabilities.windowShade.windowShade - local position = 100 - math.floor(ib.data.value / 100) - local reverse = device:get_field(REVERSE_POLARITY) - device:emit_event_for_endpoint(ib.endpoint_id, attribute(position)) +-- attribute handlers +local function current_position_lift_percent_100ths_handler(driver, device, ib, response) + if not ib.data.value then return end + local lift_percent = 100 - math.floor(ib.data.value / 100) + device:emit_event_for_endpoint(ib.endpoint_id, capabilities.windowShadeLevel.shadeLevel(lift_percent)) - if attribute == capabilities.windowShadeLevel.shadeLevel then - device:set_field(CURRENT_LIFT, position) + if is_target_value_reached(lift_percent, device:get_field(TARGET_LIFT_PERCENT.STATE)) then + clear_cached_data(device, TARGET_LIFT_PERCENT) + try_emit_idle_window_shade_status(device) + end +end + +local function current_position_tilt_percent_100ths_handler(driver, device, ib, response) + if not ib.data.value then return end + local tilt_percent = 100 - math.floor(ib.data.value / 100) + device:emit_event_for_endpoint(ib.endpoint_id, capabilities.windowShadeTiltLevel.shadeTiltLevel(tilt_percent)) + + if is_target_value_reached(tilt_percent, device:get_field(TARGET_TILT_PERCENT.STATE)) then + clear_cached_data(device, TARGET_TILT_PERCENT) + try_emit_idle_window_shade_status(device) + end +end + +local function target_position_lift_percent_100ths_handler(driver, device, ib, response) + if type(ib.data.value) == "number" then + local target_lift_percent = 100 - math.floor(ib.data.value / 100) + local latest_lift_percentage = device:get_latest_state( + "main", + capabilities.windowShadeLevel.ID, + capabilities.windowShadeLevel.shadeLevel.NAME + ) + if latest_lift_percentage and is_target_value_reached(latest_lift_percentage, target_lift_percent) then + clear_cached_data(device, TARGET_LIFT_PERCENT) + try_emit_idle_window_shade_status(device) else - device:set_field(CURRENT_TILT, position) + cache_data_with_timeout(device, target_lift_percent, TARGET_LIFT_PERCENT) end + end +end - local lift_position = device:get_field(CURRENT_LIFT) - local tilt_position = device:get_field(CURRENT_TILT) - - -- Update the window shade status according to the lift and tilt positions. - -- LIFT TILT Window Shade - -- 100 any Open - -- 1-99 any Partially Open - -- 0 1-100 Partially Open - -- 0 0 Closed - -- 0 nil Closed - -- nil 100 Open - -- nil 1-99 Partially Open - -- nil 0 Closed - -- Note that lift or tilt may be nil if either the window shade does not - -- support them or if they haven't been received from a device report yet. - - if lift_position == nil then - if tilt_position == 0 then - device:emit_event_for_endpoint(ib.endpoint_id, reverse and windowShade.open() or windowShade.closed()) - elseif tilt_position == 100 then - device:emit_event_for_endpoint(ib.endpoint_id, reverse and windowShade.closed() or windowShade.open()) - else - device:emit_event_for_endpoint(ib.endpoint_id, windowShade.partially_open()) - end - - elseif lift_position == 100 then - device:emit_event_for_endpoint(ib.endpoint_id, reverse and windowShade.closed() or windowShade.open()) - - elseif lift_position > 0 then - device:emit_event_for_endpoint(ib.endpoint_id, windowShade.partially_open()) - - elseif lift_position == 0 then - if tilt_position == nil or tilt_position == 0 then - device:emit_event_for_endpoint(ib.endpoint_id, reverse and windowShade.open() or windowShade.closed()) - elseif tilt_position > 0 then - device:emit_event_for_endpoint(ib.endpoint_id, windowShade.partially_open()) - end +local function target_position_tilt_percent_100ths_handler(driver, device, ib, response) + if type(ib.data.value) == "number" then + local target_tilt_percent = 100 - math.floor(ib.data.value / 100) + local latest_tilt_percent = device:get_latest_state( + "main", + capabilities.windowShadeTiltLevel.ID, + capabilities.windowShadeTiltLevel.shadeTiltLevel.NAME + ) + if latest_tilt_percent and is_target_value_reached(latest_tilt_percent, target_tilt_percent) then + clear_cached_data(device, TARGET_TILT_PERCENT) + try_emit_idle_window_shade_status(device) + else + cache_data_with_timeout(device, target_tilt_percent, TARGET_TILT_PERCENT) end end end -- checks the current position of the shade -local function current_status_handler(driver, device, ib, response) +local function operational_status_handler(driver, device, ib, response) + if not ib.data.value then return end + local global_op_status = ib.data.value & clusters.WindowCovering.types.OperationalStatus.GLOBAL + + local reverse = device.preferences.reverse local windowShade = capabilities.windowShade.windowShade - local reverse = device:get_field(REVERSE_POLARITY) - local state = ib.data.value & clusters.WindowCovering.types.OperationalStatus.GLOBAL - if state == 1 then -- opening - device:emit_event_for_endpoint(ib.endpoint_id, reverse and windowShade.closing() or windowShade.opening()) - elseif state == 2 then -- closing - device:emit_event_for_endpoint(ib.endpoint_id, reverse and windowShade.opening() or windowShade.closing()) - elseif state ~= 0 then -- unknown - device:emit_event_for_endpoint(ib.endpoint_id, windowShade.unknown()) + local status_event + if global_op_status == OP_STATUS_BITMAP.idle then + try_emit_idle_window_shade_status(device) + elseif global_op_status == OP_STATUS_BITMAP.opening then + status_event = reverse and windowShade.closing() or windowShade.opening() + elseif global_op_status == OP_STATUS_BITMAP.closing then + status_event = reverse and windowShade.opening() or windowShade.closing() + else + status_event = windowShade.unknown() end -end - -local function level_attr_handler(driver, device, ib, response) - if ib.data.value ~= nil then - --TODO should we invert this like we do for CurrentLiftPercentage100ths? - local level = math.floor((ib.data.value / 254.0 * 100) + 0.5) - device:emit_event_for_endpoint(ib.endpoint_id, capabilities.windowShadeLevel.shadeLevel(level)) + if status_event then + device:emit_event_for_endpoint(ib.endpoint_id, status_event) end end @@ -283,7 +411,7 @@ local function battery_charge_level_attr_handler(driver, device, ib, response) end local function power_source_attribute_list_handler(driver, device, ib, response) - for _, attr in ipairs(ib.data.elements) do + for _, attr in ipairs(ib.data.elements or {}) do -- Re-profile the device if BatPercentRemaining (Attribute ID 0x0C) is present. if attr.value == 0x0C then match_profile(device, battery_support.BATTERY_PERCENTAGE) @@ -298,23 +426,18 @@ end local matter_driver_template = { lifecycle_handlers = { init = device_init, - removed = device_removed, added = device_added, infoChanged = info_changed, doConfigure = do_configure }, matter_handlers = { attr = { - --TODO LevelControl may not be needed for certified devices since - -- certified should use CurrentPositionLiftPercent100ths attr - [clusters.LevelControl.ID] = { - [clusters.LevelControl.attributes.CurrentLevel.ID] = level_attr_handler, - }, [clusters.WindowCovering.ID] = { - --uses percent100ths more often - [clusters.WindowCovering.attributes.CurrentPositionLiftPercent100ths.ID] = current_pos_handler(capabilities.windowShadeLevel.shadeLevel), - [clusters.WindowCovering.attributes.CurrentPositionTiltPercent100ths.ID] = current_pos_handler(capabilities.windowShadeTiltLevel.shadeTiltLevel), - [clusters.WindowCovering.attributes.OperationalStatus.ID] = current_status_handler, + [clusters.WindowCovering.attributes.CurrentPositionLiftPercent100ths.ID] = current_position_lift_percent_100ths_handler, + [clusters.WindowCovering.attributes.CurrentPositionTiltPercent100ths.ID] = current_position_tilt_percent_100ths_handler, + [clusters.WindowCovering.attributes.TargetPositionLiftPercent100ths.ID] = target_position_lift_percent_100ths_handler, + [clusters.WindowCovering.attributes.TargetPositionTiltPercent100ths.ID] = target_position_tilt_percent_100ths_handler, + [clusters.WindowCovering.attributes.OperationalStatus.ID] = operational_status_handler, }, [clusters.PowerSource.ID] = { [clusters.PowerSource.attributes.AttributeList.ID] = power_source_attribute_list_handler, @@ -330,9 +453,11 @@ local matter_driver_template = { [capabilities.windowShadeLevel.ID] = { clusters.LevelControl.attributes.CurrentLevel, clusters.WindowCovering.attributes.CurrentPositionLiftPercent100ths, + clusters.WindowCovering.attributes.TargetPositionLiftPercent100ths, }, [capabilities.windowShadeTiltLevel.ID] = { clusters.WindowCovering.attributes.CurrentPositionTiltPercent100ths, + clusters.WindowCovering.attributes.TargetPositionTiltPercent100ths, }, [capabilities.battery.ID] = { clusters.PowerSource.attributes.BatPercentRemaining @@ -354,6 +479,9 @@ local matter_driver_template = { [capabilities.windowShadeLevel.ID] = { [capabilities.windowShadeLevel.commands.setShadeLevel.NAME] = handle_shade_level, }, + [capabilities.statelessWindowShadeLevelStep.ID] = { + [capabilities.statelessWindowShadeLevelStep.commands.stepShadeLevel.NAME] = handle_step_shade_level + }, [capabilities.windowShadeTiltLevel.ID] = { [capabilities.windowShadeTiltLevel.commands.setShadeTiltLevel.NAME] = handle_shade_tilt_level, }, diff --git a/drivers/SmartThings/matter-window-covering/src/sub_drivers.lua b/drivers/SmartThings/matter-window-covering/src/sub_drivers.lua index ad3e53e4b0..3a833f39bc 100644 --- a/drivers/SmartThings/matter-window-covering/src/sub_drivers.lua +++ b/drivers/SmartThings/matter-window-covering/src/sub_drivers.lua @@ -4,6 +4,5 @@ local lazy_load_if_possible = require "lazy_load_subdriver" local sub_drivers = { lazy_load_if_possible("sub_drivers.closure"), - lazy_load_if_possible("sub_drivers.matter-window-covering-position-updates-while-moving"), } return sub_drivers diff --git a/drivers/SmartThings/matter-window-covering/src/sub_drivers/matter-window-covering-position-updates-while-moving/can_handle.lua b/drivers/SmartThings/matter-window-covering/src/sub_drivers/matter-window-covering-position-updates-while-moving/can_handle.lua deleted file mode 100644 index e3e12116e1..0000000000 --- a/drivers/SmartThings/matter-window-covering/src/sub_drivers/matter-window-covering-position-updates-while-moving/can_handle.lua +++ /dev/null @@ -1,19 +0,0 @@ --- Copyright 2025 SmartThings, Inc. --- Licensed under the Apache License, Version 2.0 - -local function is_matter_window_covering_position_updates_while_moving(opts, driver, device) - local device_lib = require "st.device" - if device.network_type ~= device_lib.NETWORK_TYPE_MATTER then - return false - end - local FINGERPRINTS = require("sub_drivers.matter-window-covering-position-updates-while-moving.fingerprints") - for i, v in ipairs(FINGERPRINTS) do - if device.manufacturer_info.vendor_id == v[1] and - device.manufacturer_info.product_id == v[2] then - return true, require("sub_drivers.matter-window-covering-position-updates-while-moving") - end - end - return false -end - -return is_matter_window_covering_position_updates_while_moving diff --git a/drivers/SmartThings/matter-window-covering/src/sub_drivers/matter-window-covering-position-updates-while-moving/fingerprints.lua b/drivers/SmartThings/matter-window-covering/src/sub_drivers/matter-window-covering-position-updates-while-moving/fingerprints.lua deleted file mode 100644 index 37800fc680..0000000000 --- a/drivers/SmartThings/matter-window-covering/src/sub_drivers/matter-window-covering-position-updates-while-moving/fingerprints.lua +++ /dev/null @@ -1,8 +0,0 @@ --- Copyright 2025 SmartThings, Inc. --- Licensed under the Apache License, Version 2.0 - -local SUB_WINDOW_COVERING_VID_PID = { - {0x10e1, 0x1005} -- VDA -} - -return SUB_WINDOW_COVERING_VID_PID diff --git a/drivers/SmartThings/matter-window-covering/src/sub_drivers/matter-window-covering-position-updates-while-moving/init.lua b/drivers/SmartThings/matter-window-covering/src/sub_drivers/matter-window-covering-position-updates-while-moving/init.lua deleted file mode 100644 index 5db95ba28c..0000000000 --- a/drivers/SmartThings/matter-window-covering/src/sub_drivers/matter-window-covering-position-updates-while-moving/init.lua +++ /dev/null @@ -1,126 +0,0 @@ --- Copyright 2023 SmartThings, Inc. --- Licensed under the Apache License, Version 2.0 - - -local capabilities = require "st.capabilities" -local clusters = require "st.matter.clusters" - -local DEFAULT_LEVEL = 0 -local STATE_MACHINE = "__state_machine" -local REVERSE_POLARITY = "__reverse_polarity" - -local StateMachineEnum = { - STATE_IDLE = 0x00, - STATE_MOVING = 0x01, - STATE_OPERATIONAL_STATE_FIRED = 0x02, - STATE_CURRENT_POSITION_FIRED = 0x03 -} - - - -local function device_init(driver, device) - device:subscribe() -end - --- current lift percentage, changed to 100ths percent -local function current_pos_handler(driver, device, ib, response) - if ib.data.value == nil then - return - end - local position = 100 - math.floor(ib.data.value / 100) - device:emit_event_for_endpoint(ib.endpoint_id, capabilities.windowShadeLevel.shadeLevel(position)) - local windowShade = capabilities.windowShade.windowShade - local reverse = device:get_field(REVERSE_POLARITY) - local state_machine = device:get_field(STATE_MACHINE) - -- When state_machine is STATE_IDLE or STATE_CURRENT_POSITION_FIRED, nothing to do - if state_machine == StateMachineEnum.STATE_MOVING then - device:set_field(STATE_MACHINE, StateMachineEnum.STATE_CURRENT_POSITION_FIRED) - elseif state_machine == StateMachineEnum.STATE_OPERATIONAL_STATE_FIRED or state_machine == nil then - if position == 0 then - device:emit_event_for_endpoint(ib.endpoint_id, reverse and windowShade.open() or windowShade.closed()) - elseif position == 100 then - device:emit_event_for_endpoint(ib.endpoint_id, reverse and windowShade.closed() or windowShade.open()) - elseif position > 0 and position < 100 then - device:emit_event_for_endpoint(ib.endpoint_id, windowShade.partially_open()) - else - device:emit_event_for_endpoint(ib.endpoint_id, windowShade.unknown()) - end - device:set_field(STATE_MACHINE, StateMachineEnum.STATE_IDLE) - end -end - --- checks the current position of the shade -local function current_status_handler(driver, device, ib, response) - local attr = capabilities.windowShade.windowShade - local position = device:get_latest_state( - "main", capabilities.windowShadeLevel.ID, - capabilities.windowShadeLevel.shadeLevel.NAME - ) or DEFAULT_LEVEL - for _, rb in ipairs(response.info_blocks) do - if rb.info_block.attribute_id == clusters.WindowCovering.attributes.CurrentPositionLiftPercent100ths.ID and - rb.info_block.cluster_id == clusters.WindowCovering.ID and - rb.info_block.data ~= nil and - rb.info_block.data.value ~= nil then - position = math.floor(rb.info_block.data.value / 100) - end - end - position = 100 - position - local reverse = device:get_field(REVERSE_POLARITY) - local state = ib.data.value & clusters.WindowCovering.types.OperationalStatus.GLOBAL - local state_machine = device:get_field(STATE_MACHINE) - -- When state_machine is STATE_OPERATIONAL_STATE_FIRED, nothing to do - if state_machine == StateMachineEnum.STATE_IDLE then - if state == 1 then -- opening - device:emit_event_for_endpoint(ib.endpoint_id, reverse and attr.closing() or attr.opening()) - device:set_field(STATE_MACHINE, StateMachineEnum.STATE_MOVING) - elseif state == 2 then -- closing - device:emit_event_for_endpoint(ib.endpoint_id, reverse and attr.opening() or attr.closing()) - device:set_field(STATE_MACHINE, StateMachineEnum.STATE_MOVING) - end - elseif state_machine == StateMachineEnum.STATE_MOVING then - if state == 0 then -- not moving - device:set_field(STATE_MACHINE, StateMachineEnum.STATE_OPERATIONAL_STATE_FIRED) - elseif state == 1 then -- opening - device:emit_event_for_endpoint(ib.endpoint_id, reverse and attr.closing() or attr.opening()) - elseif state == 2 then -- closing - device:emit_event_for_endpoint(ib.endpoint_id, reverse and attr.opening() or attr.closing()) - else - device:emit_event_for_endpoint(ib.endpoint_id, attr.unknown()) - device:set_field(STATE_MACHINE, StateMachineEnum.STATE_IDLE) - end - elseif state_machine == StateMachineEnum.STATE_CURRENT_POSITION_FIRED then - if state == 0 then -- not moving - if position == 100 then - device:emit_event_for_endpoint(ib.endpoint_id, reverse and attr.closed() or attr.open()) - elseif position == 0 then - device:emit_event_for_endpoint(ib.endpoint_id, reverse and attr.open() or attr.closed()) - else - device:emit_event_for_endpoint(ib.endpoint_id, attr.partially_open()) - end - else - device:emit_event_for_endpoint(ib.endpoint_id, attr.unknown()) - end - device:set_field(STATE_MACHINE, StateMachineEnum.STATE_IDLE) - end -end - -local matter_window_covering_position_updates_while_moving_handler = { - NAME = "matter-window-covering-position-updates-while-moving", - lifecycle_handlers = { - init = device_init, - }, - matter_handlers = { - attr = { - [clusters.WindowCovering.ID] = { - [clusters.WindowCovering.attributes.CurrentPositionLiftPercent100ths.ID] = current_pos_handler, - [clusters.WindowCovering.attributes.OperationalStatus.ID] = current_status_handler, - } - } - }, - capability_handlers = { - }, - can_handle = require("sub_drivers.matter-window-covering-position-updates-while-moving.can_handle"), - shared_device_thread_enabled = true, -} - -return matter_window_covering_position_updates_while_moving_handler diff --git a/drivers/SmartThings/matter-window-covering/src/test/test_matter_closure.lua b/drivers/SmartThings/matter-window-covering/src/test/test_matter_closure.lua index e39cb428c8..1c61a6c96a 100644 --- a/drivers/SmartThings/matter-window-covering/src/test/test_matter_closure.lua +++ b/drivers/SmartThings/matter-window-covering/src/test/test_matter_closure.lua @@ -300,7 +300,10 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_device:generate_test_message("main", capabilities.windowShade.windowShade.closing()) ) - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -323,7 +326,10 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_device:generate_test_message("main", capabilities.windowShade.windowShade.opening()) ) - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -343,7 +349,10 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_device:generate_test_message("main", capabilities.windowShade.windowShade.closed()) ) - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -363,7 +372,10 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_device:generate_test_message("main", capabilities.windowShade.windowShade.open()) ) - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -383,7 +395,10 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_device:generate_test_message("main", capabilities.windowShade.windowShade.partially_open()) ) - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -427,7 +442,10 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_device:generate_test_message("main", capabilities.windowShade.windowShade.closed()) ) - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -442,7 +460,10 @@ test.register_coroutine_test( mock_device, 10, clusters.ClosureControl.types.TargetPositionEnum.MOVE_TO_FULLY_CLOSED ) }) - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -457,7 +478,10 @@ test.register_coroutine_test( mock_device, 10, clusters.ClosureControl.types.TargetPositionEnum.MOVE_TO_FULLY_OPEN ) }) - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -470,7 +494,10 @@ test.register_coroutine_test( mock_device.id, clusters.ClosureControl.server.commands.Stop(mock_device, 10) }) - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -484,7 +511,10 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_device:generate_test_message("main", capabilities.battery.battery(math.floor(150 / 2.0 + 0.5))) ) - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -499,7 +529,10 @@ test.register_coroutine_test( mock_device.id, clusters.ClosureDimension.server.commands.SetTarget(mock_device, 11, 75 * 100) }) - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -514,7 +547,10 @@ test.register_coroutine_test( mock_device.id, clusters.ClosureDimension.server.commands.SetTarget(mock_device, 12, 40 * 100) }) - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -534,7 +570,10 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_device:generate_test_message("windowShade1", capabilities.windowShadeLevel.shadeLevel(60)) ) - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -554,7 +593,10 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_device:generate_test_message("windowShade2", capabilities.windowShadeLevel.shadeLevel(25)) ) - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -574,7 +616,10 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_device:generate_test_message("windowShade1", capabilities.windowShadeLevel.shadeLevel(0)) ) - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -594,7 +639,10 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_device:generate_test_message("windowShade1", capabilities.windowShadeLevel.shadeLevel(100)) ) - end + end, + { + min_api_version = 15 + } ) -- --------------------------------------------------------------------------- @@ -622,7 +670,10 @@ test.register_coroutine_test( mock_door_device:generate_test_message("main", capabilities.doorControl.door.closing()) ) end, - {test_init = test_init_door} + { + test_init = test_init_door, + min_api_version = 17 + } ) test.register_coroutine_test( @@ -646,7 +697,10 @@ test.register_coroutine_test( mock_door_device:generate_test_message("main", capabilities.doorControl.door.opening()) ) end, - {test_init = test_init_door} + { + test_init = test_init_door, + min_api_version = 17 + } ) test.register_coroutine_test( @@ -667,9 +721,13 @@ test.register_coroutine_test( mock_door_device:generate_test_message("main", capabilities.doorControl.door.closed()) ) end, - {test_init = test_init_door} + { + test_init = test_init_door, + min_api_version = 17 + } ) + test.register_coroutine_test( "doorControl open following OverallCurrentState FULLY_OPENED", function() update_profile_door() @@ -688,7 +746,10 @@ test.register_coroutine_test( mock_door_device:generate_test_message("main", capabilities.doorControl.door.open()) ) end, - {test_init = test_init_door} + { + test_init = test_init_door, + min_api_version = 17 + } ) test.register_coroutine_test( @@ -710,7 +771,10 @@ test.register_coroutine_test( mock_door_device:generate_test_message("main", capabilities.doorControl.door.open()) ) end, - {test_init = test_init_door} + { + test_init = test_init_door, + min_api_version = 17 + } ) test.register_coroutine_test( @@ -726,7 +790,10 @@ test.register_coroutine_test( ) }) end, - {test_init = test_init_door} + { + test_init = test_init_door, + min_api_version = 15 + } ) test.register_coroutine_test( @@ -742,9 +809,11 @@ test.register_coroutine_test( ) }) end, - {test_init = test_init_door} + { + test_init = test_init_door, + min_api_version = 15 + } ) - test.register_coroutine_test( "ClosureDimension CurrentState on endpoint 11 emits level on door1 for door device", function() update_profile_door() @@ -763,7 +832,10 @@ test.register_coroutine_test( mock_door_device:generate_test_message("door1", capabilities.level.level(75)) ) end, - {test_init = test_init_door} + { + test_init = test_init_door, + min_api_version = 17 + } ) test.register_coroutine_test( @@ -784,7 +856,10 @@ test.register_coroutine_test( mock_door_device:generate_test_message("door2", capabilities.level.level(30)) ) end, - {test_init = test_init_door} + { + test_init = test_init_door, + min_api_version = 17 + } ) test.run_registered_tests() diff --git a/drivers/SmartThings/matter-window-covering/src/test/test_matter_window_covering.lua b/drivers/SmartThings/matter-window-covering/src/test/test_matter_window_covering.lua index cf2b9fd681..7199e3704d 100644 --- a/drivers/SmartThings/matter-window-covering/src/test/test_matter_window_covering.lua +++ b/drivers/SmartThings/matter-window-covering/src/test/test_matter_window_covering.lua @@ -21,6 +21,7 @@ local mock_device = test.mock_device.build_test_matter_device( { profile = t_utils.get_profile_definition("window-covering-tilt-battery.yml"), manufacturer_info = {vendor_id = 0x0000, product_id = 0x0000}, + matter_version = {software = 1}, endpoints = { { endpoint_id = 2, @@ -83,6 +84,8 @@ local CLUSTER_SUBSCRIBE_LIST = { clusters.LevelControl.server.attributes.CurrentLevel, WindowCovering.server.attributes.CurrentPositionLiftPercent100ths, WindowCovering.server.attributes.CurrentPositionTiltPercent100ths, + WindowCovering.server.attributes.TargetPositionLiftPercent100ths, + WindowCovering.server.attributes.TargetPositionTiltPercent100ths, WindowCovering.server.attributes.OperationalStatus, clusters.PowerSource.server.attributes.BatPercentRemaining } @@ -91,6 +94,7 @@ local CLUSTER_SUBSCRIBE_LIST_NO_BATTERY = { clusters.LevelControl.server.attributes.CurrentLevel, WindowCovering.server.attributes.CurrentPositionLiftPercent100ths, WindowCovering.server.attributes.OperationalStatus, + WindowCovering.server.attributes.TargetPositionLiftPercent100ths, } local function set_preset(device) @@ -156,24 +160,18 @@ end test.set_test_init_function(test_init) test.register_coroutine_test( - "WindowCovering OperationalStatus state closed following lift position update", function() - test.socket.capability:__set_channel_ordering("relaxed") + "Idle WindowCovering OperationalStatus state triggers 'open' capability emission if lift position is 100", function() test.socket.matter:__queue_receive( { mock_device.id, WindowCovering.attributes.CurrentPositionLiftPercent100ths:build_test_report_data( - mock_device, 10, 10000 + mock_device, 10, 0 ), } ) test.socket.capability:__expect_send( mock_device:generate_test_message( - "main", capabilities.windowShadeLevel.shadeLevel(0) - ) - ) - test.socket.capability:__expect_send( - mock_device:generate_test_message( - "main", capabilities.windowShade.windowShade.closed() + "main", capabilities.windowShadeLevel.shadeLevel(100) ) ) test.socket.matter:__queue_receive( @@ -182,6 +180,11 @@ test.register_coroutine_test( WindowCovering.attributes.OperationalStatus:build_test_report_data(mock_device, 10, 0), } ) + test.socket.capability:__expect_send( + mock_device:generate_test_message( + "main", capabilities.windowShade.windowShade.open() + ) + ) end, { min_api_version = 17 @@ -189,24 +192,18 @@ test.register_coroutine_test( ) test.register_coroutine_test( - "WindowCovering OperationalStatus state closed following tilt position update", function() - test.socket.capability:__set_channel_ordering("relaxed") + "Idle WindowCovering OperationalStatus state triggers 'closed' capability emission if lift position is 0", function() test.socket.matter:__queue_receive( { mock_device.id, - WindowCovering.attributes.CurrentPositionTiltPercent100ths:build_test_report_data( + WindowCovering.attributes.CurrentPositionLiftPercent100ths:build_test_report_data( mock_device, 10, 10000 ), } ) test.socket.capability:__expect_send( mock_device:generate_test_message( - "main", capabilities.windowShadeTiltLevel.shadeTiltLevel(0) - ) - ) - test.socket.capability:__expect_send( - mock_device:generate_test_message( - "main", capabilities.windowShade.windowShade.closed() + "main", capabilities.windowShadeLevel.shadeLevel(0) ) ) test.socket.matter:__queue_receive( @@ -215,6 +212,11 @@ test.register_coroutine_test( WindowCovering.attributes.OperationalStatus:build_test_report_data(mock_device, 10, 0), } ) + test.socket.capability:__expect_send( + mock_device:generate_test_message( + "main", capabilities.windowShade.windowShade.closed() + ) + ) end, { min_api_version = 17 @@ -222,30 +224,29 @@ test.register_coroutine_test( ) test.register_coroutine_test( - "WindowCovering OperationalStatus state closed before lift position 0", function() - test.socket.capability:__set_channel_ordering("relaxed") - test.socket.matter:__queue_receive( - { - mock_device.id, - WindowCovering.attributes.OperationalStatus:build_test_report_data(mock_device, 10, 0), - } - ) + "Idle WindowCovering OperationalStatus state triggers 'partially open' capability emission if lift position is 50", function() test.socket.matter:__queue_receive( { mock_device.id, WindowCovering.attributes.CurrentPositionLiftPercent100ths:build_test_report_data( - mock_device, 10, 10000 + mock_device, 10, 5000 ), } ) test.socket.capability:__expect_send( mock_device:generate_test_message( - "main", capabilities.windowShadeLevel.shadeLevel(0) + "main", capabilities.windowShadeLevel.shadeLevel(50) ) ) + test.socket.matter:__queue_receive( + { + mock_device.id, + WindowCovering.attributes.OperationalStatus:build_test_report_data(mock_device, 10, 0), + } + ) test.socket.capability:__expect_send( mock_device:generate_test_message( - "main", capabilities.windowShade.windowShade.closed() + "main", capabilities.windowShade.windowShade.partially_open() ) ) end, @@ -255,30 +256,30 @@ test.register_coroutine_test( ) test.register_coroutine_test( - "WindowCovering OperationalStatus state closed before tilt position 0", function() + "Idle WindowCovering OperationalStatus state triggers 'partially open' capability emission if tilt position is between 1-100", function() test.socket.capability:__set_channel_ordering("relaxed") - test.socket.matter:__queue_receive( - { - mock_device.id, - WindowCovering.attributes.OperationalStatus:build_test_report_data(mock_device, 10, 0), - } - ) test.socket.matter:__queue_receive( { mock_device.id, WindowCovering.attributes.CurrentPositionTiltPercent100ths:build_test_report_data( - mock_device, 10, 10000 + mock_device, 10, ((100 - 15) *100) ), } ) test.socket.capability:__expect_send( mock_device:generate_test_message( - "main", capabilities.windowShadeTiltLevel.shadeTiltLevel(0) + "main", capabilities.windowShadeTiltLevel.shadeTiltLevel(15) ) ) + test.socket.matter:__queue_receive( + { + mock_device.id, + WindowCovering.attributes.OperationalStatus:build_test_report_data(mock_device, 10, 0), + } + ) test.socket.capability:__expect_send( mock_device:generate_test_message( - "main", capabilities.windowShade.windowShade.closed() + "main", capabilities.windowShade.windowShade.partially_open() ) ) end, @@ -288,32 +289,18 @@ test.register_coroutine_test( ) test.register_coroutine_test( - "WindowCovering OperationalStatus state open following lift position update", function() - test.socket.capability:__set_channel_ordering("relaxed") + "Unknown WindowCovering OperationalStatus state triggers 'unknown' capability emission", function() test.socket.matter:__queue_receive( { mock_device.id, - WindowCovering.attributes.CurrentPositionLiftPercent100ths:build_test_report_data( - mock_device, 10, 0 - ), + WindowCovering.attributes.OperationalStatus:build_test_report_data(mock_device, 10, 99), } ) test.socket.capability:__expect_send( mock_device:generate_test_message( - "main", capabilities.windowShadeLevel.shadeLevel(100) - ) - ) - test.socket.capability:__expect_send( - mock_device:generate_test_message( - "main", capabilities.windowShade.windowShade.open() + "main", capabilities.windowShade.windowShade.unknown() ) ) - test.socket.matter:__queue_receive( - { - mock_device.id, - WindowCovering.attributes.OperationalStatus:build_test_report_data(mock_device, 10, 0), - } - ) end, { min_api_version = 17 @@ -321,32 +308,18 @@ test.register_coroutine_test( ) test.register_coroutine_test( - "WindowCovering OperationalStatus state open following tilt position update", function() - test.socket.capability:__set_channel_ordering("relaxed") + "Opening WindowCovering OperationalStatus state triggers 'closing' capability emission", function() test.socket.matter:__queue_receive( { mock_device.id, - WindowCovering.attributes.CurrentPositionTiltPercent100ths:build_test_report_data( - mock_device, 10, 0 - ), + WindowCovering.attributes.OperationalStatus:build_test_report_data(mock_device, 10, 2), } ) test.socket.capability:__expect_send( mock_device:generate_test_message( - "main", capabilities.windowShadeTiltLevel.shadeTiltLevel(100) - ) - ) - test.socket.capability:__expect_send( - mock_device:generate_test_message( - "main", capabilities.windowShade.windowShade.open() + "main", capabilities.windowShade.windowShade.closing() ) ) - test.socket.matter:__queue_receive( - { - mock_device.id, - WindowCovering.attributes.OperationalStatus:build_test_report_data(mock_device, 10, 0), - } - ) end, { min_api_version = 17 @@ -354,65 +327,66 @@ test.register_coroutine_test( ) test.register_coroutine_test( - "WindowCovering OperationalStatus state open before lift position event", function() - test.socket.capability:__set_channel_ordering("relaxed") + "Closing WindowCovering OperationalStatus state triggers 'opening' capability emission", function() test.socket.matter:__queue_receive( { mock_device.id, - WindowCovering.attributes.OperationalStatus:build_test_report_data(mock_device, 10, 0), + WindowCovering.attributes.OperationalStatus:build_test_report_data(mock_device, 10, 1), } ) test.socket.capability:__expect_send( mock_device:generate_test_message( - "main", capabilities.windowShadeLevel.shadeLevel(100) - ) - ) - test.socket.capability:__expect_send( - mock_device:generate_test_message( - "main", capabilities.windowShade.windowShade.open() + "main", capabilities.windowShade.windowShade.opening() ) ) - test.socket.matter:__queue_receive( - { - mock_device.id, - WindowCovering.attributes.CurrentPositionLiftPercent100ths:build_test_report_data( - mock_device, 10, 0 - ), - } - ) end, { min_api_version = 17 } ) + test.register_coroutine_test( - "WindowCovering OperationalStatus state open before tilt position event", function() - test.socket.capability:__set_channel_ordering("relaxed") + "WindowCovering CurrentPositionLiftPercent100ths triggers appropriate capability emission", function() test.socket.matter:__queue_receive( { mock_device.id, - WindowCovering.attributes.OperationalStatus:build_test_report_data(mock_device, 10, 0), + WindowCovering.attributes.CurrentPositionLiftPercent100ths:build_test_report_data( + mock_device, 10, 10000 + ), } ) test.socket.capability:__expect_send( mock_device:generate_test_message( - "main", capabilities.windowShadeTiltLevel.shadeTiltLevel(100) + "main", capabilities.windowShadeLevel.shadeLevel(0) ) ) + test.socket.matter:__queue_receive( + { + mock_device.id, + WindowCovering.attributes.CurrentPositionLiftPercent100ths:build_test_report_data( + mock_device, 10, 0 + ), + } + ) test.socket.capability:__expect_send( mock_device:generate_test_message( - "main", capabilities.windowShade.windowShade.open() + "main", capabilities.windowShadeLevel.shadeLevel(100) ) ) test.socket.matter:__queue_receive( { mock_device.id, - WindowCovering.attributes.CurrentPositionTiltPercent100ths:build_test_report_data( - mock_device, 10, 0 + WindowCovering.attributes.CurrentPositionLiftPercent100ths:build_test_report_data( + mock_device, 10, ((100 - 25) *100) ), } ) + test.socket.capability:__expect_send( + mock_device:generate_test_message( + "main", capabilities.windowShadeLevel.shadeLevel(25) + ) + ) end, { min_api_version = 17 @@ -420,41 +394,33 @@ test.register_coroutine_test( ) test.register_coroutine_test( - "WindowCovering OperationalStatus partially open following lift position update", function() - test.socket.capability:__set_channel_ordering("relaxed") + "WindowCovering CurrentPositionTiltPercent100ths triggers appropriate capability emission", function() test.socket.matter:__queue_receive( { mock_device.id, - WindowCovering.attributes.CurrentPositionLiftPercent100ths:build_test_report_data( - mock_device, 10, ((100 - 25) *100) + WindowCovering.attributes.CurrentPositionTiltPercent100ths:build_test_report_data( + mock_device, 10, 10000 ), } ) test.socket.capability:__expect_send( mock_device:generate_test_message( - "main", capabilities.windowShadeLevel.shadeLevel(25) - ) - ) - test.socket.capability:__expect_send( - mock_device:generate_test_message( - "main", capabilities.windowShade.windowShade.partially_open() + "main", capabilities.windowShadeTiltLevel.shadeTiltLevel(0) ) ) test.socket.matter:__queue_receive( { mock_device.id, - WindowCovering.attributes.OperationalStatus:build_test_report_data(mock_device, 10, 0), + WindowCovering.attributes.CurrentPositionTiltPercent100ths:build_test_report_data( + mock_device, 10, 0 + ), } ) - end, - { - min_api_version = 17 - } -) - -test.register_coroutine_test( - "WindowCovering OperationalStatus partially open following tilt position update", function() - test.socket.capability:__set_channel_ordering("relaxed") + test.socket.capability:__expect_send( + mock_device:generate_test_message( + "main", capabilities.windowShadeTiltLevel.shadeTiltLevel(100) + ) + ) test.socket.matter:__queue_receive( { mock_device.id, @@ -468,17 +434,38 @@ test.register_coroutine_test( "main", capabilities.windowShadeTiltLevel.shadeTiltLevel(15) ) ) + test.socket.matter:__queue_receive( + { + mock_device.id, + WindowCovering.attributes.CurrentPositionTiltPercent100ths:build_test_report_data( + mock_device, 10, ((100 - 65) *100) + ), + } + ) test.socket.capability:__expect_send( mock_device:generate_test_message( - "main", capabilities.windowShade.windowShade.partially_open() + "main", capabilities.windowShadeTiltLevel.shadeTiltLevel(65) ) ) + end, + { + min_api_version = 17 + } +) + +test.register_coroutine_test( + "WindowCovering TargetPositionLiftPercent100ths sets field appropriately", + function() test.socket.matter:__queue_receive( { mock_device.id, - WindowCovering.attributes.OperationalStatus:build_test_report_data(mock_device, 10, 0), + WindowCovering.attributes.TargetPositionLiftPercent100ths:build_test_report_data( + mock_device, 10, 5000 + ), } ) + test.wait_for_events() + assert(mock_device:get_field("__target_lift_percent") == 50) end, { min_api_version = 17 @@ -486,27 +473,48 @@ test.register_coroutine_test( ) test.register_coroutine_test( - "WindowCovering OperationalStatus partially open before lift position event", function() - test.socket.capability:__set_channel_ordering("relaxed") + "WindowCovering TargetPositionTiltPercent100ths sets field appropriately", + function() test.socket.matter:__queue_receive( { mock_device.id, - WindowCovering.attributes.OperationalStatus:build_test_report_data(mock_device, 10, 0), + WindowCovering.attributes.TargetPositionTiltPercent100ths:build_test_report_data( + mock_device, 10, 5000 + ), } ) + test.wait_for_events() + assert(mock_device:get_field("__target_tilt_percent") == 50) + end, + { + min_api_version = 17 + } +) + +test.register_coroutine_test( + "WindowCovering TargetPositionLiftPercent100ths triggers operational status update when appropriate", + function() test.socket.matter:__queue_receive( { mock_device.id, WindowCovering.attributes.CurrentPositionLiftPercent100ths:build_test_report_data( - mock_device, 10, ((100 - 25) *100) + mock_device, 10, ((100 - 65) *100) ), } ) test.socket.capability:__expect_send( mock_device:generate_test_message( - "main", capabilities.windowShadeLevel.shadeLevel(25) + "main", capabilities.windowShadeLevel.shadeLevel(65) ) ) + test.socket.matter:__queue_receive( + { + mock_device.id, + WindowCovering.attributes.OperationalStatus:build_test_report_data( + mock_device, 10, 0 + ), + } + ) test.socket.capability:__expect_send( mock_device:generate_test_message( "main", capabilities.windowShade.windowShade.partially_open() @@ -514,19 +522,13 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 17 } ) test.register_coroutine_test( - "WindowCovering OperationalStatus partially open before tilt position event", function() - test.socket.capability:__set_channel_ordering("relaxed") - test.socket.matter:__queue_receive( - { - mock_device.id, - WindowCovering.attributes.OperationalStatus:build_test_report_data(mock_device, 10, 0), - } - ) + "WindowCovering TargetPositionTiltPercent100ths triggers operational status update when appropriate", + function() test.socket.matter:__queue_receive( { mock_device.id, @@ -540,6 +542,14 @@ test.register_coroutine_test( "main", capabilities.windowShadeTiltLevel.shadeTiltLevel(65) ) ) + test.socket.matter:__queue_receive( + { + mock_device.id, + WindowCovering.attributes.OperationalStatus:build_test_report_data( + mock_device, 10, 0 + ), + } + ) test.socket.capability:__expect_send( mock_device:generate_test_message( "main", capabilities.windowShade.windowShade.partially_open() @@ -551,129 +561,51 @@ test.register_coroutine_test( } ) -test.register_coroutine_test("WindowCovering OperationalStatus opening", function() - test.socket.capability:__set_channel_ordering("relaxed") - test.socket.matter:__queue_receive( - { - mock_device.id, - WindowCovering.attributes.CurrentPositionLiftPercent100ths:build_test_report_data( - mock_device, 10, ((100 - 25) *100) - ), - } - ) - test.socket.capability:__expect_send( - mock_device:generate_test_message( - "main", capabilities.windowShadeLevel.shadeLevel(25) +test.register_coroutine_test( + "Open capability command triggers appropriate Matter command", function() + test.socket.capability:__queue_receive( + { + mock_device.id, + {capability = "windowShade", component = "main", command = "open", args = {}}, + } ) - ) - test.socket.capability:__expect_send( - mock_device:generate_test_message( - "main", capabilities.windowShade.windowShade.partially_open() + test.socket.matter:__expect_send( + {mock_device.id, WindowCovering.server.commands.UpOrOpen(mock_device, 10)} ) - ) - test.socket.matter:__queue_receive( - { - mock_device.id, - WindowCovering.attributes.OperationalStatus:build_test_report_data(mock_device, 10, 1), - } - ) - test.socket.capability:__expect_send( - mock_device:generate_test_message( - "main", capabilities.windowShade.windowShade.opening() - ) - ) -end, -{ - min_api_version = 17 -} -) - -test.register_coroutine_test("WindowCovering OperationalStatus closing", function() - test.socket.capability:__set_channel_ordering("relaxed") - test.socket.matter:__queue_receive( - { - mock_device.id, - WindowCovering.attributes.CurrentPositionLiftPercent100ths:build_test_report_data( - mock_device, 10, ((100 - 25) *100) - ), - } - ) - test.socket.capability:__expect_send( - mock_device:generate_test_message( - "main", capabilities.windowShadeLevel.shadeLevel(25) - ) - ) - test.socket.capability:__expect_send( - mock_device:generate_test_message( - "main", capabilities.windowShade.windowShade.partially_open() - ) - ) - test.socket.matter:__queue_receive( - { - mock_device.id, - WindowCovering.attributes.OperationalStatus:build_test_report_data(mock_device, 10, 2), - } - ) - test.socket.capability:__expect_send( - mock_device:generate_test_message( - "main", capabilities.windowShade.windowShade.closing() - ) - ) -end, -{ - min_api_version = 17 -} + end, + { + min_api_version = 17 + } ) -test.register_coroutine_test("WindowCovering OperationalStatus unknown", function() - test.socket.capability:__set_channel_ordering("relaxed") - test.socket.matter:__queue_receive( - { - mock_device.id, - WindowCovering.attributes.CurrentPositionLiftPercent100ths:build_test_report_data( - mock_device, 10, ((100 - 25) *100) - ), - } - ) - test.socket.capability:__expect_send( - mock_device:generate_test_message( - "main", capabilities.windowShadeLevel.shadeLevel(25) - ) - ) - test.socket.capability:__expect_send( - mock_device:generate_test_message( - "main", capabilities.windowShade.windowShade.partially_open() +test.register_coroutine_test( + "Close capability command triggers appropriate Matter command", function() + test.socket.capability:__queue_receive( + { + mock_device.id, + {capability = "windowShade", component = "main", command = "close", args = {}}, + } ) - ) - test.socket.matter:__queue_receive( - { - mock_device.id, - WindowCovering.attributes.OperationalStatus:build_test_report_data(mock_device, 10, 3), - } - ) - test.socket.capability:__expect_send( - mock_device:generate_test_message( - "main", capabilities.windowShade.windowShade.unknown() + test.socket.matter:__expect_send( + {mock_device.id, WindowCovering.server.commands.DownOrClose(mock_device, 10)} ) - ) -end, -{ - min_api_version = 17 -} + end, + { + min_api_version = 17 + } ) test.register_coroutine_test( - "WindowShade open cmd handler", function() + "Pause capability command triggers appropriate Matter command", function() test.socket.capability:__queue_receive( { mock_device.id, - {capability = "windowShade", component = "main", command = "open", args = {}}, + {capability = "windowShade", component = "main", command = "pause", args = {}}, } ) test.socket.matter:__expect_send( - {mock_device.id, WindowCovering.server.commands.UpOrOpen(mock_device, 10)} + {mock_device.id, WindowCovering.server.commands.StopMotion(mock_device, 10)} ) - test.wait_for_events() end, { min_api_version = 17 @@ -681,17 +613,53 @@ test.register_coroutine_test( ) test.register_coroutine_test( - "WindowShade close cmd handler", function() + "Cached target lift/tilt position timeouts trigger one operational status update", + function() + test.socket.matter:__queue_receive( + { + mock_device.id, + WindowCovering.attributes.CurrentPositionTiltPercent100ths:build_test_report_data( + mock_device, 10, 50 * 100 + ), + } + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message( + "main", capabilities.windowShadeTiltLevel.shadeTiltLevel(50) + ) + ) + test.socket.matter:__queue_receive( + { + mock_device.id, + WindowCovering.attributes.CurrentPositionLiftPercent100ths:build_test_report_data( + mock_device, 10, 5000 + ), + } + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message( + "main", capabilities.windowShadeLevel.shadeLevel(50) + ) + ) test.socket.capability:__queue_receive( { mock_device.id, - {capability = "windowShade", component = "main", command = "close", args = {}}, + {capability = "windowShade", component = "main", command = "open", args = {}}, } ) + test.timer.__create_and_queue_test_time_advance_timer(120, "oneshot") + test.timer.__create_and_queue_test_time_advance_timer(120, "oneshot") test.socket.matter:__expect_send( - {mock_device.id, WindowCovering.server.commands.DownOrClose(mock_device, 10)} + {mock_device.id, WindowCovering.server.commands.UpOrOpen(mock_device, 10)} ) + test.wait_for_events() + test.mock_time.advance_time(120) + + test.socket.capability:__expect_send({ + mock_device.id, { capability_id = "windowShade", component_id = "main", attribute_id = "windowShade", state = { value = "partially open" } }, + } + ) end, { min_api_version = 17 @@ -699,17 +667,79 @@ test.register_coroutine_test( ) test.register_coroutine_test( - "WindowShade pause cmd handler", function() + "Cached target lift timeout triggers one operational status update if tilt target and idle state are first reached appropriately", + function() + test.socket.matter:__queue_receive( + { + mock_device.id, + WindowCovering.attributes.CurrentPositionTiltPercent100ths:build_test_report_data( + mock_device, 10, 5000 + ), + } + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message( + "main", capabilities.windowShadeTiltLevel.shadeTiltLevel(50) + ) + ) + test.socket.matter:__queue_receive( + { + mock_device.id, + WindowCovering.attributes.CurrentPositionLiftPercent100ths:build_test_report_data( + mock_device, 10, 5000 + ), + } + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message( + "main", capabilities.windowShadeLevel.shadeLevel(50) + ) + ) test.socket.capability:__queue_receive( { mock_device.id, - {capability = "windowShade", component = "main", command = "pause", args = {}}, + {capability = "windowShade", component = "main", command = "open", args = {}}, } ) + -- two timers are made when open is called + test.timer.__create_and_queue_test_time_advance_timer(120, "oneshot") + test.timer.__create_and_queue_test_time_advance_timer(120, "oneshot") test.socket.matter:__expect_send( - {mock_device.id, WindowCovering.server.commands.StopMotion(mock_device, 10)} + {mock_device.id, WindowCovering.server.commands.UpOrOpen(mock_device, 10)} + ) + + -- ensure target state is cached before queueing responses + test.wait_for_events() + test.socket.matter:__queue_receive( + { + mock_device.id, + WindowCovering.attributes.CurrentPositionTiltPercent100ths:build_test_report_data( + mock_device, 10, 0 + ), + } + ) + test.socket.capability:__expect_send( + mock_device:generate_test_message( + "main", capabilities.windowShadeTiltLevel.shadeTiltLevel(100) + ) + ) + test.socket.matter:__queue_receive( + { + mock_device.id, + WindowCovering.attributes.OperationalStatus:build_test_report_data( + mock_device, 10, 0 + ), + } ) + + -- advance time to trigger the single remaining timer test.wait_for_events() + test.mock_time.advance_time(120) + test.socket.capability:__expect_send({ + mock_device.id, { capability_id = "windowShade", component_id = "main", attribute_id = "windowShade", state = { value = "partially open" } }, + } + ) + end, { min_api_version = 17 @@ -748,7 +778,7 @@ test.register_coroutine_test( } ) -test.register_coroutine_test("WindowShade setShadeLevel cmd handler", function() +test.register_coroutine_test("SetShadeLevel capability command triggers appropriate Matter command", function() test.socket.capability:__queue_receive( { mock_device.id, @@ -764,7 +794,7 @@ end, } ) -test.register_coroutine_test("WindowShade setShadeTiltLevel cmd handler", function() +test.register_coroutine_test("SetShadeTiltLevel capability command triggers appropriate Matter command", function() test.socket.capability:__queue_receive( { mock_device.id, @@ -780,24 +810,6 @@ end, } ) -test.register_coroutine_test("LevelControl CurrentLevel handler", function() - test.socket.matter:__queue_receive( - { - mock_device.id, - clusters.LevelControl.attributes.CurrentLevel:build_test_report_data(mock_device, 10, 100), - } - ) - test.socket.capability:__expect_send( - mock_device:generate_test_message( - "main", capabilities.windowShadeLevel.shadeLevel(math.floor((100 / 254.0 * 100) + .5)) - ) - ) -end, -{ - min_api_version = 17 -} -) - --test battery test.register_coroutine_test( "Battery percent reports should generate correct messages", function() @@ -820,29 +832,6 @@ test.register_coroutine_test( } ) -test.register_coroutine_test("OperationalStatus report contains current position report", function() - test.socket.capability:__set_channel_ordering("relaxed") - local report = WindowCovering.attributes.CurrentPositionLiftPercent100ths:build_test_report_data( - mock_device, 10, ((100 - 25) *100) - ) - table.insert(report.info_blocks, WindowCovering.attributes.OperationalStatus:build_test_report_data(mock_device, 10, 0).info_blocks[1]) - test.socket.matter:__queue_receive({ mock_device.id, report}) - test.socket.capability:__expect_send( - mock_device:generate_test_message( - "main", capabilities.windowShadeLevel.shadeLevel(25) - ) - ) - test.socket.capability:__expect_send( - mock_device:generate_test_message( - "main", capabilities.windowShade.windowShade.partially_open() - ) - ) -end, -{ - min_api_version = 17 -} -) - test.register_coroutine_test( "Handle preset commands", function() @@ -911,9 +900,9 @@ test.register_coroutine_test( ) test.register_coroutine_test( - "InfoChanged event checks for new profile match if device has changed (i.e. through reinterview or SW update)", + "InfoChanged event updates new profile if sw updated has occurred", function() - test.socket.device_lifecycle:__queue_receive(mock_device:generate_info_changed({})) + test.socket.device_lifecycle:__queue_receive(mock_device:generate_info_changed({ matter_version = {software = 2} })) local read_attribute_list = clusters.PowerSource.attributes.AttributeList:read() test.socket.matter:__expect_send({mock_device.id, read_attribute_list}) test.wait_for_events() @@ -926,178 +915,274 @@ test.register_coroutine_test( ) test.register_coroutine_test( - "WindowCovering shade level adjusted by greater than 2%; status reflects Closing followed by Partially Open", function() - test.socket.capability:__set_channel_ordering("relaxed") - test.socket.matter:__queue_receive( - { - mock_device.id, - WindowCovering.attributes.OperationalStatus:build_test_report_data(mock_device, 10, 0), - } - ) - test.socket.matter:__queue_receive( - { - mock_device.id, - WindowCovering.attributes.CurrentPositionLiftPercent100ths:build_test_report_data( - mock_device, 10, ((100 - 25) *100) - ), - } - ) - test.socket.capability:__expect_send( - mock_device:generate_test_message( - "main", capabilities.windowShadeLevel.shadeLevel(25) + "Check that preference updates to reverse polarity after being set to true and that the shade lift operates as expected when opening and closing", function() + test.socket.device_lifecycle():__queue_receive(mock_device:generate_info_changed({ preferences = { reverse = "true" } })) + test.wait_for_events() + test.socket.matter:__queue_receive({ + mock_device.id, + WindowCovering.attributes.CurrentPositionLiftPercent100ths:build_test_report_data( + mock_device, 10, 100 * 100 ) - ) + }) test.socket.capability:__expect_send( mock_device:generate_test_message( - "main", capabilities.windowShade.windowShade.partially_open() + "main", capabilities.windowShadeLevel.shadeLevel(0) ) ) test.wait_for_events() - test.socket.capability:__queue_receive( - { - mock_device.id, - {capability = "windowShadeLevel", component = "main", command = "setShadeLevel", args = { 19 }}, - } - ) - test.socket.matter:__expect_send( - {mock_device.id, WindowCovering.server.commands.GoToLiftPercentage(mock_device, 10, 8100)} - ) - test.wait_for_events() - test.socket.matter:__queue_receive( - { - mock_device.id, - WindowCovering.attributes.OperationalStatus:build_test_report_data(mock_device, 10, 10), - } - ) + test.socket.matter:__queue_receive({ + mock_device.id, + WindowCovering.attributes.OperationalStatus:build_test_report_data( + mock_device, 10, 0 + ) + }) test.socket.capability:__expect_send( mock_device:generate_test_message( - "main", capabilities.windowShade.windowShade.closing() + "main", capabilities.windowShade.windowShade.open() ) ) test.wait_for_events() - test.socket.matter:__queue_receive( - { - mock_device.id, - WindowCovering.attributes.CurrentPositionLiftPercent100ths:build_test_report_data( - mock_device, 10, ((100 - 23) *100) - ), - } - ) + test.socket.matter:__queue_receive({ + mock_device.id, + WindowCovering.attributes.CurrentPositionLiftPercent100ths:build_test_report_data( + mock_device, 10, 0 + ) + }) test.socket.capability:__expect_send( mock_device:generate_test_message( - "main", capabilities.windowShadeLevel.shadeLevel(23) + "main", capabilities.windowShadeLevel.shadeLevel(100) ) ) + test.wait_for_events() + test.socket.matter:__queue_receive({ + mock_device.id, + WindowCovering.attributes.OperationalStatus:build_test_report_data( + mock_device, 10, 0 + ) + }) test.socket.capability:__expect_send( mock_device:generate_test_message( - "main", capabilities.windowShade.windowShade.partially_open() + "main", capabilities.windowShade.windowShade.closed() ) ) test.wait_for_events() - test.socket.matter:__queue_receive( - { - mock_device.id, - WindowCovering.attributes.CurrentPositionLiftPercent100ths:build_test_report_data( - mock_device, 10, ((100 - 21) *100) - ), - } + test.socket.capability:__queue_receive({ + mock_device.id, + {capability = "windowShadeLevel", component = "main", command = "setShadeLevel", args = { 85 }}, + }) + test.socket.matter:__expect_send( + {mock_device.id, WindowCovering.server.commands.GoToLiftPercentage(mock_device, 10, 1500)} + ) + test.socket.capability:__queue_receive({ + mock_device.id, + {capability = "windowShadeLevel", component = "main", command = "setShadeLevel", args = { 100 }}, + }) + test.socket.matter:__expect_send( + {mock_device.id, WindowCovering.server.commands.GoToLiftPercentage(mock_device, 10, 0)} ) + end, + { + min_api_version = 17 + } +) + +test.register_coroutine_test( + "Check that preference updates to reverse polarity after being set to true and that the shade tilt operates as expected when opening and closing", function() + test.socket.device_lifecycle():__queue_receive(mock_device:generate_info_changed({ preferences = { reverse = "true" } })) + test.wait_for_events() + test.socket.matter:__queue_receive({ + mock_device.id, + WindowCovering.attributes.CurrentPositionTiltPercent100ths:build_test_report_data( + mock_device, 10, 100 * 100 + ) + }) test.socket.capability:__expect_send( mock_device:generate_test_message( - "main", capabilities.windowShadeLevel.shadeLevel(21) + "main", capabilities.windowShadeTiltLevel.shadeTiltLevel(0) ) ) + test.socket.matter:__queue_receive({ + mock_device.id, + WindowCovering.attributes.OperationalStatus:build_test_report_data( + mock_device, 10, 0 + ) + }) test.socket.capability:__expect_send( mock_device:generate_test_message( - "main", capabilities.windowShade.windowShade.partially_open() + "main", capabilities.windowShade.windowShade.open() ) ) - test.wait_for_events() - test.socket.matter:__queue_receive( - { - mock_device.id, - WindowCovering.attributes.CurrentPositionLiftPercent100ths:build_test_report_data( - mock_device, 10, ((100 - 19) *100) - ), - } - ) + test.socket.matter:__queue_receive({ + mock_device.id, + WindowCovering.attributes.CurrentPositionTiltPercent100ths:build_test_report_data( + mock_device, 10, 0 + ) + }) + test.socket.matter:__queue_receive({ + mock_device.id, + WindowCovering.attributes.OperationalStatus:build_test_report_data( + mock_device, 10, 0 + ) + }) test.socket.capability:__expect_send( mock_device:generate_test_message( - "main", capabilities.windowShadeLevel.shadeLevel(19) + "main", capabilities.windowShadeTiltLevel.shadeTiltLevel(100) ) ) test.socket.capability:__expect_send( mock_device:generate_test_message( - "main", capabilities.windowShade.windowShade.partially_open() + "main", capabilities.windowShade.windowShade.closed() ) ) + test.wait_for_events() + test.socket.capability:__queue_receive({ + mock_device.id, + {capability = "windowShadeTiltLevel", component = "main", command = "setShadeTiltLevel", args = { 15 }}, + }) + test.socket.matter:__expect_send( + {mock_device.id, WindowCovering.server.commands.GoToTiltPercentage(mock_device, 10, 8500)} + ) + test.socket.capability:__queue_receive({ + mock_device.id, + {capability = "windowShadeTiltLevel", component = "main", command = "setShadeTiltLevel", args = { 0 }}, + }) + test.socket.matter:__expect_send( + {mock_device.id, WindowCovering.server.commands.GoToTiltPercentage(mock_device, 10, 10000)} + ) end, { min_api_version = 17 } ) +-- stepShadeLevel tests + test.register_coroutine_test( - "WindowCovering shade level adjusted by less than or equal to 2%; status reflects Closing followed by Partially Open", function() - test.socket.capability:__set_channel_ordering("relaxed") - test.socket.matter:__queue_receive( + "WindowShade stepShadeLevel cmd handler - step up", function() + test.socket.capability:__queue_receive( { mock_device.id, - WindowCovering.attributes.OperationalStatus:build_test_report_data(mock_device, 10, 0), + {capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { 10 }}, } ) + test.socket.matter:__expect_send( + {mock_device.id, WindowCovering.server.commands.GoToLiftPercentage(mock_device, 10, 9000)} + ) + end, + { + min_api_version = 19 + } +) + +test.register_coroutine_test( + "WindowShade stepShadeLevel cmd handler - step down", function() test.socket.matter:__queue_receive( { mock_device.id, WindowCovering.attributes.CurrentPositionLiftPercent100ths:build_test_report_data( - mock_device, 10, ((100 - 25) *100) + mock_device, 10, 5000 ), } ) test.socket.capability:__expect_send( mock_device:generate_test_message( - "main", capabilities.windowShadeLevel.shadeLevel(25) + "main", capabilities.windowShadeLevel.shadeLevel(50) ) ) + test.wait_for_events() + test.socket.capability:__queue_receive( + { + mock_device.id, + {capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { -20 }}, + } + ) + test.socket.matter:__expect_send( + {mock_device.id, WindowCovering.server.commands.GoToLiftPercentage(mock_device, 10, 7000)} + ) + end, + { + min_api_version = 19 + } +) + +test.register_coroutine_test( + "WindowShade stepShadeLevel cmd handler - continuous step with target tracking", function() + test.socket.matter:__queue_receive( + { + mock_device.id, + WindowCovering.attributes.CurrentPositionLiftPercent100ths:build_test_report_data( + mock_device, 10, 7000 + ), + } + ) test.socket.capability:__expect_send( mock_device:generate_test_message( - "main", capabilities.windowShade.windowShade.partially_open() + "main", capabilities.windowShadeLevel.shadeLevel(30) ) ) test.wait_for_events() test.socket.capability:__queue_receive( { mock_device.id, - {capability = "windowShadeLevel", component = "main", command = "setShadeLevel", args = { 23 }}, + {capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { 10 }}, } ) test.socket.matter:__expect_send( - {mock_device.id, WindowCovering.server.commands.GoToLiftPercentage(mock_device, 10, 7700)} + {mock_device.id, WindowCovering.server.commands.GoToLiftPercentage(mock_device, 10, 6000)} ) test.wait_for_events() + test.socket.capability:__queue_receive( + { + mock_device.id, + {capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { 10 }}, + } + ) + test.socket.matter:__expect_send( + {mock_device.id, WindowCovering.server.commands.GoToLiftPercentage(mock_device, 10, 5000)} + ) + end, + { + min_api_version = 19 + } +) + +test.register_coroutine_test( + "WindowShade stepShadeLevel - target reached clears target marker", function() test.socket.matter:__queue_receive( { mock_device.id, - WindowCovering.attributes.OperationalStatus:build_test_report_data(mock_device, 10, 10), + WindowCovering.attributes.CurrentPositionLiftPercent100ths:build_test_report_data( + mock_device, 10, 5000 + ), } ) test.socket.capability:__expect_send( mock_device:generate_test_message( - "main", capabilities.windowShade.windowShade.closing() + "main", capabilities.windowShadeLevel.shadeLevel(50) ) ) test.wait_for_events() + test.socket.capability:__queue_receive( + { + mock_device.id, + {capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { 10 }}, + } + ) + test.socket.matter:__expect_send( + {mock_device.id, WindowCovering.server.commands.GoToLiftPercentage(mock_device, 10, 4000)} + ) + test.wait_for_events() test.socket.matter:__queue_receive( { mock_device.id, WindowCovering.attributes.CurrentPositionLiftPercent100ths:build_test_report_data( - mock_device, 10, ((100 - 23) *100) + mock_device, 10, 4000 ), } ) test.socket.capability:__expect_send( mock_device:generate_test_message( - "main", capabilities.windowShadeLevel.shadeLevel(23) + "main", capabilities.windowShadeLevel.shadeLevel(60) ) ) test.socket.capability:__expect_send( @@ -1107,123 +1192,69 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 19 } ) test.register_coroutine_test( - "Check that preference updates to reverse polarity after being set to true and that the shade lift operates as expected when opening and closing", function() - test.socket.device_lifecycle():__queue_receive(mock_device:generate_info_changed({ preferences = { reverse = "true" } })) - test.wait_for_events() - local reverse_preference_set = mock_device:get_field("__reverse_polarity") - assert(reverse_preference_set == true, "reverse_preference_set is True") - test.socket.matter:__queue_receive({ - mock_device.id, - WindowCovering.attributes.CurrentPositionLiftPercent100ths:build_test_report_data( - mock_device, 10, 100 * 100 - ) - }) - test.socket.capability:__expect_send( - mock_device:generate_test_message( - "main", capabilities.windowShadeLevel.shadeLevel(0) - ) - ) - test.socket.capability:__expect_send( - mock_device:generate_test_message( - "main", capabilities.windowShade.windowShade.open() - ) - ) - test.socket.matter:__queue_receive({ - mock_device.id, - WindowCovering.attributes.CurrentPositionLiftPercent100ths:build_test_report_data( - mock_device, 10, 0 - ) - }) - test.socket.capability:__expect_send( - mock_device:generate_test_message( - "main", capabilities.windowShadeLevel.shadeLevel(100) - ) + "WindowShade stepShadeLevel - step up to maximum (100)", function() + test.socket.matter:__queue_receive( + { + mock_device.id, + WindowCovering.attributes.CurrentPositionLiftPercent100ths:build_test_report_data( + mock_device, 10, 500 + ), + } ) test.socket.capability:__expect_send( mock_device:generate_test_message( - "main", capabilities.windowShade.windowShade.closed() + "main", capabilities.windowShadeLevel.shadeLevel(95) ) ) - test.socket.capability:__queue_receive({ - mock_device.id, - {capability = "windowShadeLevel", component = "main", command = "setShadeLevel", args = { 85 }}, - }) - test.socket.matter:__expect_send( - {mock_device.id, WindowCovering.server.commands.GoToLiftPercentage(mock_device, 10, 1500)} + test.wait_for_events() + test.socket.capability:__queue_receive( + { + mock_device.id, + {capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { 10 }}, + } ) - test.socket.capability:__queue_receive({ - mock_device.id, - {capability = "windowShadeLevel", component = "main", command = "setShadeLevel", args = { 100 }}, - }) test.socket.matter:__expect_send( {mock_device.id, WindowCovering.server.commands.GoToLiftPercentage(mock_device, 10, 0)} ) end, { - min_api_version = 17 + min_api_version = 19 } ) test.register_coroutine_test( - "Check that preference updates to reverse polarity after being set to true and that the shade tilt operates as expected when opening and closing", function() - test.socket.device_lifecycle():__queue_receive(mock_device:generate_info_changed({ preferences = { reverse = "true" } })) - test.wait_for_events() - local reverse_preference_set = mock_device:get_field("__reverse_polarity") - assert(reverse_preference_set == true, "reverse_preference_set is True") - test.socket.matter:__queue_receive({ - mock_device.id, - WindowCovering.attributes.CurrentPositionTiltPercent100ths:build_test_report_data( - mock_device, 10, 100 * 100 - ) - }) - test.socket.capability:__expect_send( - mock_device:generate_test_message( - "main", capabilities.windowShadeTiltLevel.shadeTiltLevel(0) - ) - ) - test.socket.capability:__expect_send( - mock_device:generate_test_message( - "main", capabilities.windowShade.windowShade.open() - ) - ) - test.socket.matter:__queue_receive({ - mock_device.id, - WindowCovering.attributes.CurrentPositionTiltPercent100ths:build_test_report_data( - mock_device, 10, 0 - ) - }) - test.socket.capability:__expect_send( - mock_device:generate_test_message( - "main", capabilities.windowShadeTiltLevel.shadeTiltLevel(100) - ) + "WindowShade stepShadeLevel - step down to minimum (0)", function() + test.socket.matter:__queue_receive( + { + mock_device.id, + WindowCovering.attributes.CurrentPositionLiftPercent100ths:build_test_report_data( + mock_device, 10, 9500 + ), + } ) test.socket.capability:__expect_send( mock_device:generate_test_message( - "main", capabilities.windowShade.windowShade.closed() + "main", capabilities.windowShadeLevel.shadeLevel(5) ) ) - test.socket.capability:__queue_receive({ - mock_device.id, - {capability = "windowShadeTiltLevel", component = "main", command = "setShadeTiltLevel", args = { 15 }}, - }) - test.socket.matter:__expect_send( - {mock_device.id, WindowCovering.server.commands.GoToTiltPercentage(mock_device, 10, 8500)} + test.wait_for_events() + test.socket.capability:__queue_receive( + { + mock_device.id, + {capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { -10 }}, + } ) - test.socket.capability:__queue_receive({ - mock_device.id, - {capability = "windowShadeTiltLevel", component = "main", command = "setShadeTiltLevel", args = { 0 }}, - }) test.socket.matter:__expect_send( - {mock_device.id, WindowCovering.server.commands.GoToTiltPercentage(mock_device, 10, 10000)} + {mock_device.id, WindowCovering.server.commands.GoToLiftPercentage(mock_device, 10, 10000)} ) end, { - min_api_version = 17 + min_api_version = 19 } ) diff --git a/drivers/SmartThings/philips-hue/src/handlers/attribute_emitters.lua b/drivers/SmartThings/philips-hue/src/handlers/attribute_emitters.lua index f274ef37f0..05c9dbb7e9 100644 --- a/drivers/SmartThings/philips-hue/src/handlers/attribute_emitters.lua +++ b/drivers/SmartThings/philips-hue/src/handlers/attribute_emitters.lua @@ -158,6 +158,19 @@ local function _emit_light_events_inner(light_device, light_repr) end end +-- A sufficiently small color temp command can transform to the same value (in mireks) that a device already has, so the bridge +-- may not respond to said command. To avoid any odd behaviors in this case, we should emit a kelvin value change event immediately +function AttributeEmitters.emit_color_temp_when_mirek_unchanged(device, clamped_kelvin, mirek) + local current_color_temp = device:get_latest_state("main", capabilities.colorTemperature.ID, capabilities.colorTemperature.colorTemperature.NAME) + if current_color_temp then + local current_mirek = math.floor(utils.kelvin_to_mirek(current_color_temp)) + if current_mirek == mirek then + log.debug(string.format("Color temp change from %dK to %dK results in same mirek value (%d), emitting event directly", current_color_temp, clamped_kelvin, mirek)) + device:emit_event(capabilities.colorTemperature.colorTemperature(clamped_kelvin)) + end + end +end + function AttributeEmitters.connectivity_update(child_device, zigbee_status) if child_device == nil or (child_device and child_device.id == nil) then log.warn("Tried to emit attribute events for a device that has been deleted") diff --git a/drivers/SmartThings/philips-hue/src/handlers/commands.lua b/drivers/SmartThings/philips-hue/src/handlers/commands.lua index 2c55f39452..480f003769 100644 --- a/drivers/SmartThings/philips-hue/src/handlers/commands.lua +++ b/drivers/SmartThings/philips-hue/src/handlers/commands.lua @@ -7,6 +7,7 @@ st_utils.stringify_table = st_utils.stringify_table local Consts = require "consts" local Fields = require "fields" local HueColorUtils = require "utils.cie_utils" +local attribute_emitters = require "handlers.attribute_emitters" local utils = require "utils" @@ -154,6 +155,7 @@ local function do_color_temp_action(driver, device, args) local min = device:get_field(Fields.MIN_KELVIN) or Consts.MIN_TEMP_KELVIN_WHITE_AMBIANCE local clamped_kelvin = st_utils.clamp_value(kelvin, min, Consts.MAX_TEMP_KELVIN) local mirek = math.floor(utils.kelvin_to_mirek(clamped_kelvin)) + attribute_emitters.emit_color_temp_when_mirek_unchanged(device, clamped_kelvin, mirek) local resp, err = hue_api:set_light_color_temp(light_id, mirek) log_command_response_errors(resp, err, "color temp action") diff --git a/drivers/SmartThings/philips-hue/src/handlers/grouped_light_commands.lua b/drivers/SmartThings/philips-hue/src/handlers/grouped_light_commands.lua index 1a1099fc5e..266971b99c 100644 --- a/drivers/SmartThings/philips-hue/src/handlers/grouped_light_commands.lua +++ b/drivers/SmartThings/philips-hue/src/handlers/grouped_light_commands.lua @@ -4,6 +4,7 @@ local Consts = require "consts" local Fields = require "fields" local HueColorUtils = require "utils.cie_utils" local grouped_utils = require "utils.grouped_utils" +local attribute_emitters = require "handlers.attribute_emitters" local utils = require "utils" @@ -94,7 +95,7 @@ end ---@param bridge_device HueBridgeDevice ---@param group table ---@param args table ----@param aux table auxilary data needed for the command that the devices all had in common +---@param aux table auxiliary data needed for the command that the devices all had in common local function do_color_action(driver, bridge_device, group, args, aux) local hue, sat = (args.args.color.hue / 100), (args.args.color.saturation / 100) if hue == 1 then -- 0 and 360 degrees are equivalent in HSV, but not in our conversion function @@ -135,7 +136,7 @@ end ---@param bridge_device HueBridgeDevice ---@param group table ---@param args table ----@param aux table auxilary data needed for the command that the devices all had in common +---@param aux table auxiliary data needed for the command that the devices all had in common local function do_setHue_action(driver, bridge_device, group, args, aux) local currentSaturation = aux[Fields.COLOR_SATURATION] or 0 args.args.color = { @@ -149,7 +150,7 @@ end ---@param bridge_device HueBridgeDevice ---@param group table ---@param args table ----@param aux table auxilary data needed for the command that the devices all had in common +---@param aux table auxiliary data needed for the command that the devices all had in common local function do_setSaturation_action(driver, bridge_device, group, args, aux) local currentHue = aux[Fields.COLOR_HUE] or 0 args.args.color = { @@ -163,7 +164,7 @@ end ---@param bridge_device HueBridgeDevice ---@param group table ---@param args table ----@param aux table auxilary data needed for the command that the devices all had in common +---@param aux table auxiliary data needed for the command that the devices all had in common local function do_color_temp_action(driver, bridge_device, group, args, aux) local kelvin = args.args.temperature @@ -185,6 +186,10 @@ local function do_color_temp_action(driver, bridge_device, group, args, aux) local clamped_kelvin = st_utils.clamp_value(kelvin, min, Consts.MAX_TEMP_KELVIN) local mirek = math.floor(utils.kelvin_to_mirek(clamped_kelvin)) + for _, device in ipairs(group.devices) do + attribute_emitters.emit_color_temp_when_mirek_unchanged(device, clamped_kelvin, mirek) + end + local resp, err = hue_api:set_grouped_light_color_temp(grouped_light_id, mirek) if not resp or (resp.errors and #resp.errors == 0) then @@ -203,7 +208,7 @@ end ---@param bridge_device HueBridgeDevice ---@param group table ---@param args table ----@param aux table auxilary data needed for the command that the devices all had in common +---@param aux table auxiliary data needed for the command that the devices all had in common function GroupedLightCommandHandlers.switch_on_handler(driver, bridge_device, group, args, aux) do_switch_action(driver, bridge_device, group, args) end @@ -212,7 +217,7 @@ end ---@param bridge_device HueBridgeDevice ---@param group table ---@param args table ----@param aux table auxilary data needed for the command that the devices all had in common +---@param aux table auxiliary data needed for the command that the devices all had in common function GroupedLightCommandHandlers.switch_off_handler(driver, bridge_device, group, args, aux) do_switch_action(driver, bridge_device, group, args) end @@ -221,7 +226,7 @@ end ---@param bridge_device HueBridgeDevice ---@param group table ---@param args table ----@param aux table auxilary data needed for the command that the devices all had in common +---@param aux table auxiliary data needed for the command that the devices all had in common function GroupedLightCommandHandlers.switch_level_handler(driver, bridge_device, group, args, aux) do_switch_level_action(driver, bridge_device, group, args) end @@ -230,7 +235,7 @@ end ---@param bridge_device HueBridgeDevice ---@param group table ---@param args table ----@param aux table auxilary data needed for the command that the devices all had in common +---@param aux table auxiliary data needed for the command that the devices all had in common function GroupedLightCommandHandlers.set_color_handler(driver, bridge_device, group, args, aux) do_color_action(driver, bridge_device, group, args, aux) end @@ -239,7 +244,7 @@ end ---@param bridge_device HueBridgeDevice ---@param group table ---@param args table ----@param aux table auxilary data needed for the command that the devices all had in common +---@param aux table auxiliary data needed for the command that the devices all had in common function GroupedLightCommandHandlers.set_hue_handler(driver, bridge_device, group, args, aux) do_setHue_action(driver, bridge_device, group, args, aux) end @@ -248,7 +253,7 @@ end ---@param bridge_device HueBridgeDevice ---@param group table ---@param args table ----@param aux table auxilary data needed for the command that the devices all had in common +---@param aux table auxiliary data needed for the command that the devices all had in common function GroupedLightCommandHandlers.set_saturation_handler(driver, bridge_device, group, args, aux) do_setSaturation_action(driver, bridge_device, group, args, aux) end @@ -257,7 +262,7 @@ end ---@param bridge_device HueBridgeDevice ---@param group table ---@param args table ----@param aux table auxilary data needed for the command that the devices all had in common +---@param aux table auxiliary data needed for the command that the devices all had in common function GroupedLightCommandHandlers.set_color_temp_handler(driver, bridge_device, group, args, aux) do_color_temp_action(driver, bridge_device, group, args, aux) end diff --git a/drivers/SmartThings/virtual-switch/src/test/test_virtual_switch.lua b/drivers/SmartThings/virtual-switch/src/test/test_virtual_switch.lua index 5c284b1e6b..1feb54fb0d 100644 --- a/drivers/SmartThings/virtual-switch/src/test/test_virtual_switch.lua +++ b/drivers/SmartThings/virtual-switch/src/test/test_virtual_switch.lua @@ -46,7 +46,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -65,7 +65,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -84,7 +84,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -104,7 +104,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -123,7 +123,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -148,7 +148,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -169,7 +169,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_simple_device:generate_test_message("main", capabilities.switch.switch.on())) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-air-quality-detector/src/test/test_MultiIR_air_quality_detector.lua b/drivers/SmartThings/zigbee-air-quality-detector/src/test/test_MultiIR_air_quality_detector.lua index 606b716dff..b9ae4cab1a 100644 --- a/drivers/SmartThings/zigbee-air-quality-detector/src/test/test_MultiIR_air_quality_detector.lua +++ b/drivers/SmartThings/zigbee-air-quality-detector/src/test/test_MultiIR_air_quality_detector.lua @@ -73,7 +73,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({mock_device.id, read_AQI_messge}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -95,7 +95,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -117,7 +117,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -137,7 +137,7 @@ test.register_coroutine_test( capabilities.carbonDioxideHealthConcern.carbonDioxideHealthConcern({value = "good"}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -157,7 +157,7 @@ test.register_coroutine_test( capabilities.fineDustHealthConcern.fineDustHealthConcern.good())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -177,7 +177,7 @@ test.register_coroutine_test( capabilities.veryFineDustHealthConcern.veryFineDustHealthConcern.good())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -197,7 +197,7 @@ test.register_coroutine_test( capabilities.dustHealthConcern.dustHealthConcern.good())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -215,7 +215,7 @@ test.register_coroutine_test( capabilities.formaldehydeMeasurement.formaldehydeLevel({value = 1000.0, unit = "mg/m^3"}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -235,7 +235,7 @@ test.register_coroutine_test( capabilities.tvocHealthConcern.tvocHealthConcern({value = "unhealthy"}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -253,7 +253,7 @@ test.register_coroutine_test( capabilities.airQualityHealthConcern.airQualityHealthConcern({value = "good"}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -271,7 +271,7 @@ test.register_coroutine_test( capabilities.airQualityHealthConcern.airQualityHealthConcern({value = "moderate"}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -289,7 +289,7 @@ test.register_coroutine_test( capabilities.airQualityHealthConcern.airQualityHealthConcern({value = "slightlyUnhealthy"}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -307,7 +307,7 @@ test.register_coroutine_test( capabilities.airQualityHealthConcern.airQualityHealthConcern({value = "unhealthy"}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -325,7 +325,7 @@ test.register_coroutine_test( capabilities.airQualityHealthConcern.airQualityHealthConcern({value = "veryUnhealthy"}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -343,7 +343,7 @@ test.register_coroutine_test( capabilities.airQualityHealthConcern.airQualityHealthConcern({value = "hazardous"}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -363,7 +363,7 @@ test.register_coroutine_test( capabilities.carbonDioxideHealthConcern.carbonDioxideHealthConcern({value = "moderate"}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -383,7 +383,7 @@ test.register_coroutine_test( capabilities.carbonDioxideHealthConcern.carbonDioxideHealthConcern({value = "unhealthy"}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -403,7 +403,7 @@ test.register_coroutine_test( capabilities.fineDustHealthConcern.fineDustHealthConcern({value = "moderate"}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -423,7 +423,7 @@ test.register_coroutine_test( capabilities.fineDustHealthConcern.fineDustHealthConcern({value = "unhealthy"}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -443,7 +443,7 @@ test.register_coroutine_test( capabilities.veryFineDustHealthConcern.veryFineDustHealthConcern({value = "unhealthy"}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -463,7 +463,7 @@ test.register_coroutine_test( capabilities.dustHealthConcern.dustHealthConcern({value = "unhealthy"}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -483,7 +483,7 @@ test.register_coroutine_test( capabilities.tvocHealthConcern.tvocHealthConcern({value = "good"}))) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-bed/src/test/test_shus_mattress.lua b/drivers/SmartThings/zigbee-bed/src/test/test_shus_mattress.lua index 2b02b5ec73..08eb79e2a9 100644 --- a/drivers/SmartThings/zigbee-bed/src/test/test_shus_mattress.lua +++ b/drivers/SmartThings/zigbee-bed/src/test/test_shus_mattress.lua @@ -86,7 +86,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({mock_device.id, read_0x0011_messge}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -131,7 +131,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({mock_device.id, read_0x0011_messge}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -149,7 +149,7 @@ test.register_coroutine_test( custom_capabilities.left_control.leftback.idle({ visibility = { displayed = false }}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -167,7 +167,7 @@ test.register_coroutine_test( custom_capabilities.left_control.leftback.idle({ visibility = { displayed = false }}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -185,7 +185,7 @@ test.register_coroutine_test( custom_capabilities.left_control.leftwaist.idle({ visibility = { displayed = false }}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -203,7 +203,7 @@ test.register_coroutine_test( custom_capabilities.left_control.leftwaist.idle({ visibility = { displayed = false }}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -221,7 +221,7 @@ test.register_coroutine_test( custom_capabilities.left_control.lefthip.idle({ visibility = { displayed = false }}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -239,7 +239,7 @@ test.register_coroutine_test( custom_capabilities.left_control.lefthip.idle({ visibility = { displayed = false }}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -257,7 +257,7 @@ test.register_coroutine_test( custom_capabilities.right_control.rightback.idle({ visibility = { displayed = false }}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -275,7 +275,7 @@ test.register_coroutine_test( custom_capabilities.right_control.rightback.idle({ visibility = { displayed = false }}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -293,7 +293,7 @@ test.register_coroutine_test( custom_capabilities.right_control.rightwaist.idle({ visibility = { displayed = false }}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -311,7 +311,7 @@ test.register_coroutine_test( custom_capabilities.right_control.rightwaist.idle({ visibility = { displayed = false }}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -329,7 +329,7 @@ test.register_coroutine_test( custom_capabilities.right_control.righthip.idle({ visibility = { displayed = false }}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -347,7 +347,7 @@ test.register_coroutine_test( custom_capabilities.right_control.righthip.idle({ visibility = { displayed = false }}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -365,7 +365,7 @@ test.register_coroutine_test( custom_capabilities.mattressHardness.leftBackHardness(1))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -383,7 +383,7 @@ test.register_coroutine_test( custom_capabilities.mattressHardness.leftWaistHardness(1))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -401,7 +401,7 @@ test.register_coroutine_test( custom_capabilities.mattressHardness.leftHipHardness(1))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -419,7 +419,7 @@ test.register_coroutine_test( custom_capabilities.mattressHardness.rightBackHardness(1))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -437,7 +437,7 @@ test.register_coroutine_test( custom_capabilities.mattressHardness.rightWaistHardness(1))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -455,7 +455,7 @@ test.register_coroutine_test( custom_capabilities.mattressHardness.rightHipHardness(1))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -473,7 +473,7 @@ test.register_coroutine_test( custom_capabilities.yoga.state.both())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -491,7 +491,7 @@ test.register_coroutine_test( custom_capabilities.yoga.state.right())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -509,7 +509,7 @@ test.register_coroutine_test( custom_capabilities.yoga.state.left())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -527,7 +527,7 @@ test.register_coroutine_test( custom_capabilities.yoga.state.stop())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -545,7 +545,7 @@ test.register_coroutine_test( custom_capabilities.ai_mode.left.off())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -563,7 +563,7 @@ test.register_coroutine_test( custom_capabilities.ai_mode.left.on())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -581,7 +581,7 @@ test.register_coroutine_test( custom_capabilities.ai_mode.right.on())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -599,7 +599,7 @@ test.register_coroutine_test( custom_capabilities.ai_mode.right.off())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -617,7 +617,7 @@ test.register_coroutine_test( custom_capabilities.auto_inflation.inflationState.off())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -635,7 +635,7 @@ test.register_coroutine_test( custom_capabilities.auto_inflation.inflationState.on())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -653,7 +653,7 @@ test.register_coroutine_test( custom_capabilities.strong_exp_mode.expState.off())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -671,7 +671,7 @@ test.register_coroutine_test( custom_capabilities.strong_exp_mode.expState.on())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -689,7 +689,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -706,7 +706,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -723,7 +723,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -740,7 +740,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -757,7 +757,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -774,7 +774,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -791,7 +791,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -808,7 +808,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -827,7 +827,7 @@ test.register_coroutine_test( custom_capabilities.left_control.leftback.soft())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -846,7 +846,7 @@ test.register_coroutine_test( custom_capabilities.left_control.leftwaist.soft())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -865,7 +865,7 @@ test.register_coroutine_test( custom_capabilities.left_control.lefthip.soft())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -884,7 +884,7 @@ test.register_coroutine_test( custom_capabilities.left_control.leftback.hard())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -903,7 +903,7 @@ test.register_coroutine_test( custom_capabilities.left_control.leftwaist.hard())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -922,7 +922,7 @@ test.register_coroutine_test( custom_capabilities.left_control.lefthip.hard())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -941,7 +941,7 @@ test.register_coroutine_test( custom_capabilities.right_control.rightback.soft())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -960,7 +960,7 @@ test.register_coroutine_test( custom_capabilities.right_control.rightwaist.soft())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -979,7 +979,7 @@ test.register_coroutine_test( custom_capabilities.right_control.righthip.soft())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -998,7 +998,7 @@ test.register_coroutine_test( custom_capabilities.right_control.rightback.hard())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1017,7 +1017,7 @@ test.register_coroutine_test( custom_capabilities.right_control.rightwaist.hard())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1036,7 +1036,7 @@ test.register_coroutine_test( custom_capabilities.right_control.righthip.hard())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1053,7 +1053,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1070,7 +1070,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1087,7 +1087,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1112,7 +1112,7 @@ test.register_coroutine_test( custom_capabilities.left_control.leftback("idle", { visibility = { displayed = false }}))) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-button/src/test/test_SLED_button.lua b/drivers/SmartThings/zigbee-button/src/test/test_SLED_button.lua index 342a62a5c7..288d531148 100644 --- a/drivers/SmartThings/zigbee-button/src/test/test_SLED_button.lua +++ b/drivers/SmartThings/zigbee-button/src/test/test_SLED_button.lua @@ -50,7 +50,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -74,7 +74,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -89,7 +89,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-button/src/test/test_aduro_button.lua b/drivers/SmartThings/zigbee-button/src/test/test_aduro_button.lua index 808eb0a764..d44d73da7a 100644 --- a/drivers/SmartThings/zigbee-button/src/test/test_aduro_button.lua +++ b/drivers/SmartThings/zigbee-button/src/test/test_aduro_button.lua @@ -93,7 +93,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -131,7 +131,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -179,7 +179,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-button/src/test/test_aqara_button.lua b/drivers/SmartThings/zigbee-button/src/test/test_aqara_button.lua index 49883cd275..da3fe73c48 100644 --- a/drivers/SmartThings/zigbee-button/src/test/test_aqara_button.lua +++ b/drivers/SmartThings/zigbee-button/src/test/test_aqara_button.lua @@ -99,7 +99,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -131,7 +131,7 @@ test.register_coroutine_test( mock_device_e1:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -166,7 +166,7 @@ test.register_coroutine_test( mock_device_h1_double_rocker:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -187,7 +187,7 @@ test.register_coroutine_test( capabilities.button.button.pushed({ state_change = true }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -208,7 +208,7 @@ test.register_coroutine_test( capabilities.button.button.double({ state_change = true }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -229,7 +229,7 @@ test.register_coroutine_test( capabilities.button.button.held({ state_change = true }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -248,7 +248,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) test.register_message_test( @@ -266,7 +266,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) test.register_message_test( @@ -284,7 +284,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -328,7 +328,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -350,7 +350,7 @@ test.register_coroutine_test( capabilities.batteryLevel.quantity(1))) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-button/src/test/test_centralite_button.lua b/drivers/SmartThings/zigbee-button/src/test/test_centralite_button.lua index be95f76cce..c08a42e4c0 100644 --- a/drivers/SmartThings/zigbee-button/src/test/test_centralite_button.lua +++ b/drivers/SmartThings/zigbee-button/src/test/test_centralite_button.lua @@ -95,7 +95,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -152,7 +152,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -191,7 +191,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -205,7 +205,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -253,7 +253,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-button/src/test/test_dimming_remote.lua b/drivers/SmartThings/zigbee-button/src/test/test_dimming_remote.lua index db9bad6ea9..17170106a7 100644 --- a/drivers/SmartThings/zigbee-button/src/test/test_dimming_remote.lua +++ b/drivers/SmartThings/zigbee-button/src/test/test_dimming_remote.lua @@ -55,7 +55,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -86,7 +86,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -117,7 +117,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -159,7 +159,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -173,7 +173,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -275,7 +275,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-button/src/test/test_ewelink_button.lua b/drivers/SmartThings/zigbee-button/src/test/test_ewelink_button.lua index 773021ac20..61e30bfaee 100644 --- a/drivers/SmartThings/zigbee-button/src/test/test_ewelink_button.lua +++ b/drivers/SmartThings/zigbee-button/src/test/test_ewelink_button.lua @@ -64,7 +64,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -79,7 +79,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -95,7 +95,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -111,7 +111,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -151,7 +151,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-button/src/test/test_ezviz_button.lua b/drivers/SmartThings/zigbee-button/src/test/test_ezviz_button.lua index 07652b0e0e..b012f30a8d 100644 --- a/drivers/SmartThings/zigbee-button/src/test/test_ezviz_button.lua +++ b/drivers/SmartThings/zigbee-button/src/test/test_ezviz_button.lua @@ -55,7 +55,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -99,7 +99,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -118,7 +118,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -137,7 +137,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -173,7 +173,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device_ezviz_button.id, ZoneStatusAttribute:read(mock_device_ezviz_button) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -199,7 +199,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-button/src/test/test_frient_button.lua b/drivers/SmartThings/zigbee-button/src/test/test_frient_button.lua index 40d74e503c..6dc9b979c1 100644 --- a/drivers/SmartThings/zigbee-button/src/test/test_frient_button.lua +++ b/drivers/SmartThings/zigbee-button/src/test/test_frient_button.lua @@ -88,7 +88,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -113,7 +113,7 @@ test.register_message_test("Refresh should read all necessary attributes", { }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -149,7 +149,7 @@ test.register_coroutine_test("panicAlarm should be triggered and cleared", funct end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -184,7 +184,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -226,7 +226,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -253,7 +253,7 @@ function() test.socket.zigbee:__expect_send({mock_device.id, buttonDelay_msg}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -286,7 +286,7 @@ test.register_coroutine_test(" Configuration and Switching to button-profile-pan --test.socket.capability:__expect_send({mock_device.id, capabilities.panicAlarm.panicAlarm.clear({state_change = true})}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -302,7 +302,7 @@ test.register_coroutine_test("Switching from button-profile-panic-frient to butt test.socket.zigbee:__expect_send({mock_device_panic.id, cluster_base.write_manufacturer_specific_attribute(mock_device_panic,BasicInput.ID,0x8000,DEVELCO_MANUFACTURER_CODE,data_types.Uint16,0xFFFF)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -324,7 +324,7 @@ test.register_coroutine_test("New preferences after switching the profile should test.socket.zigbee:__expect_send({mock_device_panic.id, cluster_base.write_manufacturer_specific_attribute(mock_device_panic, IASZone.ID,0x8005,DEVELCO_MANUFACTURER_CODE,data_types.Enum8, 1)}) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-button/src/test/test_heiman_button.lua b/drivers/SmartThings/zigbee-button/src/test/test_heiman_button.lua index 7e9448ed7e..7142b8ad8c 100644 --- a/drivers/SmartThings/zigbee-button/src/test/test_heiman_button.lua +++ b/drivers/SmartThings/zigbee-button/src/test/test_heiman_button.lua @@ -92,7 +92,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -127,7 +127,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -174,7 +174,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -198,7 +198,7 @@ test.register_coroutine_test( mock_device_hs6ssb:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -279,7 +279,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -313,7 +313,7 @@ test.register_coroutine_test( mock_device_hs6ssb:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -361,7 +361,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -409,7 +409,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-button/src/test/test_ikea_on_off.lua b/drivers/SmartThings/zigbee-button/src/test/test_ikea_on_off.lua index 4a772c5ab0..d3d1d75c67 100644 --- a/drivers/SmartThings/zigbee-button/src/test/test_ikea_on_off.lua +++ b/drivers/SmartThings/zigbee-button/src/test/test_ikea_on_off.lua @@ -75,7 +75,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -119,7 +119,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -143,7 +143,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_add_hub_to_group(0xB9F2) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -205,7 +205,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -304,7 +304,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-button/src/test/test_ikea_open_close.lua b/drivers/SmartThings/zigbee-button/src/test/test_ikea_open_close.lua index d350567294..56a8d3c382 100644 --- a/drivers/SmartThings/zigbee-button/src/test/test_ikea_open_close.lua +++ b/drivers/SmartThings/zigbee-button/src/test/test_ikea_open_close.lua @@ -55,7 +55,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -100,7 +100,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -124,7 +124,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_add_hub_to_group(0xB9F2) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -149,7 +149,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({mock_device.id, Groups.commands.AddGroup(mock_device, 0x0000) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -247,7 +247,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-button/src/test/test_ikea_remote_control.lua b/drivers/SmartThings/zigbee-button/src/test/test_ikea_remote_control.lua index 1fc0e9d8e6..92360b9b5d 100644 --- a/drivers/SmartThings/zigbee-button/src/test/test_ikea_remote_control.lua +++ b/drivers/SmartThings/zigbee-button/src/test/test_ikea_remote_control.lua @@ -109,7 +109,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -154,7 +154,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -179,7 +179,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_add_hub_to_group(0xB9F2) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -286,7 +286,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -305,7 +305,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-button/src/test/test_iris_button.lua b/drivers/SmartThings/zigbee-button/src/test/test_iris_button.lua index 81e68a52da..14284ca482 100644 --- a/drivers/SmartThings/zigbee-button/src/test/test_iris_button.lua +++ b/drivers/SmartThings/zigbee-button/src/test/test_iris_button.lua @@ -47,7 +47,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -63,7 +63,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -105,7 +105,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -123,7 +123,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -177,7 +177,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -198,7 +198,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -219,7 +219,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -240,7 +240,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -261,7 +261,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-button/src/test/test_linxura_aura_smart_button.lua b/drivers/SmartThings/zigbee-button/src/test/test_linxura_aura_smart_button.lua index a70d3b52a2..b2eecc400c 100644 --- a/drivers/SmartThings/zigbee-button/src/test/test_linxura_aura_smart_button.lua +++ b/drivers/SmartThings/zigbee-button/src/test/test_linxura_aura_smart_button.lua @@ -57,7 +57,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -76,7 +76,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -95,7 +95,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -115,7 +115,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-button/src/test/test_linxura_smart_controller_4x_button.lua b/drivers/SmartThings/zigbee-button/src/test/test_linxura_smart_controller_4x_button.lua index 35ad7aae08..406bcd018f 100644 --- a/drivers/SmartThings/zigbee-button/src/test/test_linxura_smart_controller_4x_button.lua +++ b/drivers/SmartThings/zigbee-button/src/test/test_linxura_smart_controller_4x_button.lua @@ -57,7 +57,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -76,7 +76,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -95,7 +95,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -115,7 +115,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-button/src/test/test_push_only_button.lua b/drivers/SmartThings/zigbee-button/src/test/test_push_only_button.lua index 2f6deceb70..527c15ade7 100644 --- a/drivers/SmartThings/zigbee-button/src/test/test_push_only_button.lua +++ b/drivers/SmartThings/zigbee-button/src/test/test_push_only_button.lua @@ -48,7 +48,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) test.register_message_test( @@ -61,7 +61,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -80,7 +80,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -99,7 +99,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -164,7 +164,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -219,7 +219,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-button/src/test/test_robb_4x_button.lua b/drivers/SmartThings/zigbee-button/src/test/test_robb_4x_button.lua index bbe5cbaf86..0f014d8b41 100644 --- a/drivers/SmartThings/zigbee-button/src/test/test_robb_4x_button.lua +++ b/drivers/SmartThings/zigbee-button/src/test/test_robb_4x_button.lua @@ -81,7 +81,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -124,7 +124,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -169,7 +169,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -212,7 +212,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -326,7 +326,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -368,7 +368,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -386,7 +386,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-button/src/test/test_robb_8x_button.lua b/drivers/SmartThings/zigbee-button/src/test/test_robb_8x_button.lua index 8c291f8483..c073b7e051 100644 --- a/drivers/SmartThings/zigbee-button/src/test/test_robb_8x_button.lua +++ b/drivers/SmartThings/zigbee-button/src/test/test_robb_8x_button.lua @@ -126,7 +126,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -203,7 +203,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -284,7 +284,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -329,7 +329,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -444,7 +444,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -486,7 +486,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -504,7 +504,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-button/src/test/test_samjin_button.lua b/drivers/SmartThings/zigbee-button/src/test/test_samjin_button.lua index 72bcd2009c..be5af30cbc 100644 --- a/drivers/SmartThings/zigbee-button/src/test/test_samjin_button.lua +++ b/drivers/SmartThings/zigbee-button/src/test/test_samjin_button.lua @@ -90,7 +90,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -140,7 +140,7 @@ test.register_coroutine_test( -- }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-button/src/test/test_shinasystem_button.lua b/drivers/SmartThings/zigbee-button/src/test/test_shinasystem_button.lua index d5eed5d55f..2a3f825ac9 100644 --- a/drivers/SmartThings/zigbee-button/src/test/test_shinasystem_button.lua +++ b/drivers/SmartThings/zigbee-button/src/test/test_shinasystem_button.lua @@ -85,7 +85,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -142,7 +142,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -199,7 +199,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -239,7 +239,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -287,7 +287,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-button/src/test/test_somfy_situo_1_button.lua b/drivers/SmartThings/zigbee-button/src/test/test_somfy_situo_1_button.lua index 2793a6de1b..f5f91aec73 100644 --- a/drivers/SmartThings/zigbee-button/src/test/test_somfy_situo_1_button.lua +++ b/drivers/SmartThings/zigbee-button/src/test/test_somfy_situo_1_button.lua @@ -65,7 +65,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -116,7 +116,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -140,7 +140,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_add_hub_to_group(0xB9F2) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -202,7 +202,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -250,7 +250,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-button/src/test/test_somfy_situo_4_button.lua b/drivers/SmartThings/zigbee-button/src/test/test_somfy_situo_4_button.lua index 9e209541ff..bd4d767f2f 100644 --- a/drivers/SmartThings/zigbee-button/src/test/test_somfy_situo_4_button.lua +++ b/drivers/SmartThings/zigbee-button/src/test/test_somfy_situo_4_button.lua @@ -94,7 +94,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -163,7 +163,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -187,7 +187,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_add_hub_to_group(0xB9F2) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -235,7 +235,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-button/src/test/test_sonoff_button.lua b/drivers/SmartThings/zigbee-button/src/test/test_sonoff_button.lua index 22f76bc383..4e02098b0b 100644 --- a/drivers/SmartThings/zigbee-button/src/test/test_sonoff_button.lua +++ b/drivers/SmartThings/zigbee-button/src/test/test_sonoff_button.lua @@ -161,7 +161,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -180,7 +180,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -199,7 +199,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -218,7 +218,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -237,7 +237,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -256,7 +256,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -271,7 +271,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-button/src/test/test_thirdreality_button.lua b/drivers/SmartThings/zigbee-button/src/test/test_thirdreality_button.lua index f4ee2e0aed..7c9472df39 100644 --- a/drivers/SmartThings/zigbee-button/src/test/test_thirdreality_button.lua +++ b/drivers/SmartThings/zigbee-button/src/test/test_thirdreality_button.lua @@ -48,7 +48,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -65,7 +65,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.button.button.pushed({ state_change = true }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -82,7 +82,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.button.button.double({ state_change = true }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -99,7 +99,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.button.button.held({ state_change = true }))) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-button/src/test/test_vimar_button.lua b/drivers/SmartThings/zigbee-button/src/test/test_vimar_button.lua index c76d080a01..f1f4413429 100644 --- a/drivers/SmartThings/zigbee-button/src/test/test_vimar_button.lua +++ b/drivers/SmartThings/zigbee-button/src/test/test_vimar_button.lua @@ -77,7 +77,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -95,7 +95,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -113,7 +113,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -139,7 +139,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -165,7 +165,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -213,7 +213,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-button/src/test/test_wallhero_button.lua b/drivers/SmartThings/zigbee-button/src/test/test_wallhero_button.lua index 93c6d26139..d4fcdd87f1 100644 --- a/drivers/SmartThings/zigbee-button/src/test/test_wallhero_button.lua +++ b/drivers/SmartThings/zigbee-button/src/test/test_wallhero_button.lua @@ -306,7 +306,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -347,7 +347,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-button/src/test/test_zigbee_button.lua b/drivers/SmartThings/zigbee-button/src/test/test_zigbee_button.lua index db4f6b9a43..a854809234 100644 --- a/drivers/SmartThings/zigbee-button/src/test/test_zigbee_button.lua +++ b/drivers/SmartThings/zigbee-button/src/test/test_zigbee_button.lua @@ -39,7 +39,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -58,7 +58,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -77,7 +77,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -91,7 +91,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -110,7 +110,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -129,7 +129,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -148,7 +148,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -167,7 +167,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -187,7 +187,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -213,7 +213,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -296,7 +296,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -373,7 +373,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-button/src/test/test_zigbee_ecosmart_button.lua b/drivers/SmartThings/zigbee-button/src/test/test_zigbee_ecosmart_button.lua index 1b3078f637..cc75674c85 100644 --- a/drivers/SmartThings/zigbee-button/src/test/test_zigbee_ecosmart_button.lua +++ b/drivers/SmartThings/zigbee-button/src/test/test_zigbee_ecosmart_button.lua @@ -50,7 +50,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -98,7 +98,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -123,7 +123,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -141,7 +141,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -167,7 +167,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -212,7 +212,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -261,7 +261,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-button/src/test/test_zunzunbee_8_button.lua b/drivers/SmartThings/zigbee-button/src/test/test_zunzunbee_8_button.lua index 13479d4e8b..5e288c6344 100644 --- a/drivers/SmartThings/zigbee-button/src/test/test_zunzunbee_8_button.lua +++ b/drivers/SmartThings/zigbee-button/src/test/test_zunzunbee_8_button.lua @@ -81,7 +81,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -142,7 +142,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -170,7 +170,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -199,7 +199,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-carbon-monoxide-detector/src/test/test_climax_technology_carbon_monoxide.lua b/drivers/SmartThings/zigbee-carbon-monoxide-detector/src/test/test_climax_technology_carbon_monoxide.lua index b0df2ffaa4..fb92f80e90 100644 --- a/drivers/SmartThings/zigbee-carbon-monoxide-detector/src/test/test_climax_technology_carbon_monoxide.lua +++ b/drivers/SmartThings/zigbee-carbon-monoxide-detector/src/test/test_climax_technology_carbon_monoxide.lua @@ -42,7 +42,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-carbon-monoxide-detector/src/test/test_frient_co_smoke_temperature_battery.lua b/drivers/SmartThings/zigbee-carbon-monoxide-detector/src/test/test_frient_co_smoke_temperature_battery.lua index 16625fdf92..36bad5633a 100644 --- a/drivers/SmartThings/zigbee-carbon-monoxide-detector/src/test/test_frient_co_smoke_temperature_battery.lua +++ b/drivers/SmartThings/zigbee-carbon-monoxide-detector/src/test/test_frient_co_smoke_temperature_battery.lua @@ -447,7 +447,10 @@ test.register_coroutine_test( ) }) end -) +, + { + min_api_version = 17 + }) test.register_coroutine_test( "Alarm off command should send StartWarning stop", @@ -474,7 +477,10 @@ test.register_coroutine_test( ) }) end -) +, + { + min_api_version = 17 + }) test.register_coroutine_test( "Default response to StartWarning should emit alarm events", @@ -500,7 +506,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 17 + }) test.run_registered_tests() diff --git a/drivers/SmartThings/zigbee-carbon-monoxide-detector/src/test/test_zigbee_carbon_monoxide.lua b/drivers/SmartThings/zigbee-carbon-monoxide-detector/src/test/test_zigbee_carbon_monoxide.lua index 1b67dc8ee6..ab593688c3 100644 --- a/drivers/SmartThings/zigbee-carbon-monoxide-detector/src/test/test_zigbee_carbon_monoxide.lua +++ b/drivers/SmartThings/zigbee-carbon-monoxide-detector/src/test/test_zigbee_carbon_monoxide.lua @@ -44,7 +44,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -71,7 +71,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -99,7 +99,7 @@ test.register_message_test( }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -126,7 +126,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -145,7 +145,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -216,7 +216,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-contact/src/test/test_aqara_contact_sensor.lua b/drivers/SmartThings/zigbee-contact/src/test/test_aqara_contact_sensor.lua index 8f6c5ecfdd..014e2b8ed1 100644 --- a/drivers/SmartThings/zigbee-contact/src/test/test_aqara_contact_sensor.lua +++ b/drivers/SmartThings/zigbee-contact/src/test/test_aqara_contact_sensor.lua @@ -66,7 +66,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -90,7 +90,7 @@ test.register_coroutine_test( capabilities.batteryLevel.battery("normal"))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -108,7 +108,7 @@ test.register_coroutine_test( capabilities.batteryLevel.battery("normal"))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -126,7 +126,7 @@ test.register_coroutine_test( capabilities.batteryLevel.battery("critical"))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -144,7 +144,7 @@ test.register_coroutine_test( capabilities.batteryLevel.battery("normal"))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -162,7 +162,7 @@ test.register_coroutine_test( capabilities.batteryLevel.battery("warning"))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -180,7 +180,7 @@ test.register_coroutine_test( capabilities.batteryLevel.battery("critical"))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -198,7 +198,7 @@ test.register_coroutine_test( capabilities.contactSensor.contact.closed())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -216,7 +216,7 @@ test.register_coroutine_test( capabilities.contactSensor.contact.open())) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-contact/src/test/test_aurora_contact_sensor.lua b/drivers/SmartThings/zigbee-contact/src/test/test_aurora_contact_sensor.lua index a2bcfdf612..395b85063f 100644 --- a/drivers/SmartThings/zigbee-contact/src/test/test_aurora_contact_sensor.lua +++ b/drivers/SmartThings/zigbee-contact/src/test/test_aurora_contact_sensor.lua @@ -44,7 +44,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, PowerConfiguration.attributes.BatteryVoltage:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -95,7 +95,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-contact/src/test/test_centralite_multi_sensor.lua b/drivers/SmartThings/zigbee-contact/src/test/test_centralite_multi_sensor.lua index b13d48fc2e..09f0108325 100644 --- a/drivers/SmartThings/zigbee-contact/src/test/test_centralite_multi_sensor.lua +++ b/drivers/SmartThings/zigbee-contact/src/test/test_centralite_multi_sensor.lua @@ -108,7 +108,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_device:generate_test_message("main", capabilities.threeAxis.threeAxis({300, 200, 100})) ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -134,7 +134,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_device:generate_test_message("main", capabilities.accelerationSensor.acceleration.inactive()) ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -170,7 +170,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_device:generate_test_message("main", capabilities.contactSensor.contact.open())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -197,7 +197,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -221,7 +221,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -282,7 +282,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -307,7 +307,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -333,7 +333,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-contact/src/test/test_contact_temperature_sensor.lua b/drivers/SmartThings/zigbee-contact/src/test/test_contact_temperature_sensor.lua index 62e0eee71b..b0ce27f524 100644 --- a/drivers/SmartThings/zigbee-contact/src/test/test_contact_temperature_sensor.lua +++ b/drivers/SmartThings/zigbee-contact/src/test/test_contact_temperature_sensor.lua @@ -46,7 +46,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, TemperatureMeasurement.attributes.MeasuredValue:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -108,7 +108,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -127,7 +127,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -146,7 +146,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-contact/src/test/test_ecolink_contact.lua b/drivers/SmartThings/zigbee-contact/src/test/test_ecolink_contact.lua index e092666737..1341f0a518 100644 --- a/drivers/SmartThings/zigbee-contact/src/test/test_ecolink_contact.lua +++ b/drivers/SmartThings/zigbee-contact/src/test/test_ecolink_contact.lua @@ -47,7 +47,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, TemperatureMeasurement.attributes.MeasuredValue:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -117,7 +117,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -136,7 +136,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -155,7 +155,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-contact/src/test/test_ewelink_heiman_sensor.lua b/drivers/SmartThings/zigbee-contact/src/test/test_ewelink_heiman_sensor.lua index f3b94929b6..05d030b0d3 100644 --- a/drivers/SmartThings/zigbee-contact/src/test/test_ewelink_heiman_sensor.lua +++ b/drivers/SmartThings/zigbee-contact/src/test/test_ewelink_heiman_sensor.lua @@ -45,7 +45,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, PowerConfiguration.attributes.BatteryPercentageRemaining:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -96,7 +96,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-contact/src/test/test_frient_contact_sensor.lua b/drivers/SmartThings/zigbee-contact/src/test/test_frient_contact_sensor.lua index 8be3dd430a..e766f0a4d5 100644 --- a/drivers/SmartThings/zigbee-contact/src/test/test_frient_contact_sensor.lua +++ b/drivers/SmartThings/zigbee-contact/src/test/test_frient_contact_sensor.lua @@ -48,7 +48,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, PowerConfiguration.attributes.BatteryVoltage:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -135,7 +135,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -154,7 +154,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -173,7 +173,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -207,7 +207,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -226,7 +226,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -245,7 +245,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -264,7 +264,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -283,7 +283,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-contact/src/test/test_frient_contact_sensor_2_pro.lua b/drivers/SmartThings/zigbee-contact/src/test/test_frient_contact_sensor_2_pro.lua index f6a2e0ebd9..3911b323c1 100644 --- a/drivers/SmartThings/zigbee-contact/src/test/test_frient_contact_sensor_2_pro.lua +++ b/drivers/SmartThings/zigbee-contact/src/test/test_frient_contact_sensor_2_pro.lua @@ -56,7 +56,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, TemperatureMeasurement.attributes.MeasuredValue:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -178,7 +178,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -205,7 +205,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -224,7 +224,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -243,7 +243,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -322,7 +322,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -341,7 +341,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -360,7 +360,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -379,7 +379,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -398,7 +398,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -426,7 +426,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-contact/src/test/test_frient_contact_sensor_pro.lua b/drivers/SmartThings/zigbee-contact/src/test/test_frient_contact_sensor_pro.lua index 66881f9f0b..e21f06f588 100644 --- a/drivers/SmartThings/zigbee-contact/src/test/test_frient_contact_sensor_pro.lua +++ b/drivers/SmartThings/zigbee-contact/src/test/test_frient_contact_sensor_pro.lua @@ -56,7 +56,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, TemperatureMeasurement.attributes.MeasuredValue:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -178,7 +178,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -205,7 +205,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -224,7 +224,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -243,7 +243,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -322,7 +322,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -346,7 +346,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -370,7 +370,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -394,7 +394,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -418,7 +418,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -446,7 +446,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-contact/src/test/test_frient_vibration_sensor.lua b/drivers/SmartThings/zigbee-contact/src/test/test_frient_vibration_sensor.lua index 7829e32736..d386758433 100644 --- a/drivers/SmartThings/zigbee-contact/src/test/test_frient_vibration_sensor.lua +++ b/drivers/SmartThings/zigbee-contact/src/test/test_frient_vibration_sensor.lua @@ -300,7 +300,7 @@ test.register_coroutine_test( mock_device_contact:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -328,7 +328,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -347,7 +347,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -366,7 +366,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -407,7 +407,7 @@ function() }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -431,7 +431,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -455,7 +455,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -477,7 +477,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -505,7 +505,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -533,7 +533,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-contact/src/test/test_orvibo_contact_sensor.lua b/drivers/SmartThings/zigbee-contact/src/test/test_orvibo_contact_sensor.lua index 6ebb00d45e..9e4bd2aa0a 100644 --- a/drivers/SmartThings/zigbee-contact/src/test/test_orvibo_contact_sensor.lua +++ b/drivers/SmartThings/zigbee-contact/src/test/test_orvibo_contact_sensor.lua @@ -44,7 +44,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, PowerConfiguration.attributes.BatteryPercentageRemaining:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -95,7 +95,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-contact/src/test/test_samjin_multi_sensor.lua b/drivers/SmartThings/zigbee-contact/src/test/test_samjin_multi_sensor.lua index d4082723c7..7d854c2f6e 100644 --- a/drivers/SmartThings/zigbee-contact/src/test/test_samjin_multi_sensor.lua +++ b/drivers/SmartThings/zigbee-contact/src/test/test_samjin_multi_sensor.lua @@ -95,7 +95,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -119,7 +119,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -180,7 +180,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -222,7 +222,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-contact/src/test/test_sengled_contact_sensor.lua b/drivers/SmartThings/zigbee-contact/src/test/test_sengled_contact_sensor.lua index fc48ab8eaa..f3e92f2c9a 100644 --- a/drivers/SmartThings/zigbee-contact/src/test/test_sengled_contact_sensor.lua +++ b/drivers/SmartThings/zigbee-contact/src/test/test_sengled_contact_sensor.lua @@ -44,7 +44,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, PowerConfiguration.attributes.BatteryVoltage:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -95,7 +95,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-contact/src/test/test_smartsense_multi.lua b/drivers/SmartThings/zigbee-contact/src/test/test_smartsense_multi.lua index 4713e6eb41..701aba257b 100644 --- a/drivers/SmartThings/zigbee-contact/src/test/test_smartsense_multi.lua +++ b/drivers/SmartThings/zigbee-contact/src/test/test_smartsense_multi.lua @@ -116,7 +116,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.accelerationSensor.acceleration.active())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -134,7 +134,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.battery.battery(60))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -152,7 +152,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.battery.battery(60))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -170,7 +170,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.battery.battery(60))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -188,7 +188,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.battery.battery(60))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -206,7 +206,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.battery.battery(60))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -224,7 +224,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.battery.battery(60))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -242,7 +242,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.battery.battery(60))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -260,7 +260,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.battery.battery(60))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -278,7 +278,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.battery.battery(97))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -296,7 +296,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.battery.battery(60))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -314,7 +314,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.battery.battery(60))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -332,7 +332,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.battery.battery(0))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -350,7 +350,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.battery.battery(0))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -368,7 +368,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.battery.battery(0))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -383,7 +383,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.threeAxis.threeAxis({1050, 3, 9})) ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -398,7 +398,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.threeAxis.threeAxis({-1050, -3, -9})) ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -413,7 +413,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.threeAxis.threeAxis({10, 1020, 7})) ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -428,7 +428,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.threeAxis.threeAxis({-10, -1020, -7})) ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -443,7 +443,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.threeAxis.threeAxis({116, 4, 1003})) ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -458,7 +458,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.threeAxis.threeAxis({-116, -4, -1003})) ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -491,7 +491,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_device:generate_test_message("main", capabilities.contactSensor.contact.open())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -510,7 +510,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -529,7 +529,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -548,7 +548,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -567,7 +567,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-contact/src/test/test_smartthings_multi_sensor.lua b/drivers/SmartThings/zigbee-contact/src/test/test_smartthings_multi_sensor.lua index da87c0aee2..770b8e6718 100644 --- a/drivers/SmartThings/zigbee-contact/src/test/test_smartthings_multi_sensor.lua +++ b/drivers/SmartThings/zigbee-contact/src/test/test_smartthings_multi_sensor.lua @@ -89,7 +89,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -108,7 +108,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -134,7 +134,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_device:generate_test_message("main", capabilities.accelerationSensor.acceleration.inactive()) ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -151,7 +151,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_device:generate_test_message("main", capabilities.accelerationSensor.acceleration.active()) ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -170,7 +170,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_device:generate_test_message("main", capabilities.threeAxis.threeAxis({300, 100, -200})) ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -206,7 +206,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_device:generate_test_message("main", capabilities.contactSensor.contact.open())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -236,7 +236,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -255,7 +255,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -274,7 +274,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -301,7 +301,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -325,7 +325,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -390,7 +390,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -434,7 +434,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-contact/src/test/test_third_reality_contact.lua b/drivers/SmartThings/zigbee-contact/src/test/test_third_reality_contact.lua index c03ab49dde..0273886a4c 100644 --- a/drivers/SmartThings/zigbee-contact/src/test/test_third_reality_contact.lua +++ b/drivers/SmartThings/zigbee-contact/src/test/test_third_reality_contact.lua @@ -44,7 +44,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, PowerConfiguration.attributes.BatteryPercentageRemaining:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -95,7 +95,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-contact/src/test/test_thirdreality_multi_sensor.lua b/drivers/SmartThings/zigbee-contact/src/test/test_thirdreality_multi_sensor.lua index 92f7274365..924205c3ff 100644 --- a/drivers/SmartThings/zigbee-contact/src/test/test_thirdreality_multi_sensor.lua +++ b/drivers/SmartThings/zigbee-contact/src/test/test_thirdreality_multi_sensor.lua @@ -54,7 +54,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_device:generate_test_message("main", capabilities.accelerationSensor.acceleration.inactive()) ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -71,7 +71,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_device:generate_test_message("main", capabilities.accelerationSensor.acceleration.active()) ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -90,7 +90,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_device:generate_test_message("main", capabilities.threeAxis.threeAxis({200, 100, 300})) ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-contact/src/test/test_zigbee_contact.lua b/drivers/SmartThings/zigbee-contact/src/test/test_zigbee_contact.lua index f27743d4ee..1064145d99 100644 --- a/drivers/SmartThings/zigbee-contact/src/test/test_zigbee_contact.lua +++ b/drivers/SmartThings/zigbee-contact/src/test/test_zigbee_contact.lua @@ -46,7 +46,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -73,7 +73,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -102,7 +102,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -131,7 +131,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -159,7 +159,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -185,7 +185,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -205,7 +205,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -250,7 +250,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, IASZone.attributes.ZoneStatus:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -344,7 +344,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-contact/src/test/test_zigbee_contact_battery.lua b/drivers/SmartThings/zigbee-contact/src/test/test_zigbee_contact_battery.lua index d908aedba6..c7bce911b2 100644 --- a/drivers/SmartThings/zigbee-contact/src/test/test_zigbee_contact_battery.lua +++ b/drivers/SmartThings/zigbee-contact/src/test/test_zigbee_contact_battery.lua @@ -88,7 +88,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -108,7 +108,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -128,7 +128,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-contact/src/test/test_zigbee_contact_tyco.lua b/drivers/SmartThings/zigbee-contact/src/test/test_zigbee_contact_tyco.lua index 6b482996de..625b8f0d6b 100644 --- a/drivers/SmartThings/zigbee-contact/src/test/test_zigbee_contact_tyco.lua +++ b/drivers/SmartThings/zigbee-contact/src/test/test_zigbee_contact_tyco.lua @@ -56,7 +56,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -84,7 +84,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -105,7 +105,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/zigbee-fan/src/test/test_fan_light.lua b/drivers/SmartThings/zigbee-fan/src/test/test_fan_light.lua index b305bb8a9d..fbee4cf910 100644 --- a/drivers/SmartThings/zigbee-fan/src/test/test_fan_light.lua +++ b/drivers/SmartThings/zigbee-fan/src/test/test_fan_light.lua @@ -50,7 +50,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -71,7 +71,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -92,7 +92,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -113,7 +113,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -138,7 +138,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -163,7 +163,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -183,7 +183,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -203,7 +203,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -223,7 +223,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -243,7 +243,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -263,7 +263,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -287,7 +287,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -311,7 +311,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -335,7 +335,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -365,7 +365,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -395,7 +395,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -425,7 +425,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -455,7 +455,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -485,7 +485,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -509,7 +509,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -533,7 +533,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_aqara_sensor.lua b/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_aqara_sensor.lua index 762c1f4431..87f8c0e85c 100644 --- a/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_aqara_sensor.lua +++ b/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_aqara_sensor.lua @@ -96,7 +96,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -119,7 +119,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -142,7 +142,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -165,7 +165,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -196,7 +196,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -219,7 +219,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -241,7 +241,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -263,7 +263,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -285,7 +285,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -307,7 +307,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_centralite_sensor.lua b/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_centralite_sensor.lua index b35c590b91..6fdf421c04 100644 --- a/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_centralite_sensor.lua +++ b/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_centralite_sensor.lua @@ -95,7 +95,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -186,7 +186,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -231,7 +231,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_ewelink_sensor.lua b/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_ewelink_sensor.lua index aefbd3c350..c8d5578e11 100644 --- a/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_ewelink_sensor.lua +++ b/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_ewelink_sensor.lua @@ -66,7 +66,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -114,7 +114,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_frient_air_quality_sensor.lua b/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_frient_air_quality_sensor.lua index 06e836a007..eb022d7ebf 100644 --- a/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_frient_air_quality_sensor.lua +++ b/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_frient_air_quality_sensor.lua @@ -85,7 +85,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -104,7 +104,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -123,7 +123,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -221,7 +221,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -243,7 +243,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -262,7 +262,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -298,7 +298,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -328,7 +328,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -345,7 +345,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_frient_sensor.lua b/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_frient_sensor.lua index 81bc408f32..dfca8c6be1 100644 --- a/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_frient_sensor.lua +++ b/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_frient_sensor.lua @@ -67,7 +67,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -86,7 +86,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -105,7 +105,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -167,7 +167,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -189,7 +189,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -216,7 +216,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -268,7 +268,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_heiman_sensor.lua b/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_heiman_sensor.lua index c75326503d..41a9d5ba22 100644 --- a/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_heiman_sensor.lua +++ b/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_heiman_sensor.lua @@ -66,7 +66,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -125,7 +125,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_humidity_battery_sensor.lua b/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_humidity_battery_sensor.lua index 3d9e24e2eb..d23abc3777 100644 --- a/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_humidity_battery_sensor.lua +++ b/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_humidity_battery_sensor.lua @@ -48,7 +48,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -70,7 +70,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -92,7 +92,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -119,7 +119,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_humidity_plaid_systems.lua b/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_humidity_plaid_systems.lua index c8aa3a6191..69a154e13e 100644 --- a/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_humidity_plaid_systems.lua +++ b/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_humidity_plaid_systems.lua @@ -51,7 +51,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -73,7 +73,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -95,7 +95,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -125,7 +125,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -151,7 +151,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -172,7 +172,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -210,7 +210,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -250,7 +250,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -287,7 +287,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_humidity_temperature.lua b/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_humidity_temperature.lua index e821dd3d56..dc3e6052c5 100644 --- a/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_humidity_temperature.lua +++ b/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_humidity_temperature.lua @@ -48,7 +48,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -78,7 +78,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -100,7 +100,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -137,7 +137,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -171,7 +171,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.relativeHumidityMeasurement.humidity({ value = 79 }))) end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_humidity_temperature_battery.lua b/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_humidity_temperature_battery.lua index b03f27d59d..6ffd1b5f28 100644 --- a/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_humidity_temperature_battery.lua +++ b/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_humidity_temperature_battery.lua @@ -60,7 +60,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -90,7 +90,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -112,7 +112,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -157,7 +157,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -191,7 +191,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.relativeHumidityMeasurement.humidity({ value = 79 }))) end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_humidity_temperature_sensor.lua b/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_humidity_temperature_sensor.lua index f01b9534bb..06a18c6063 100644 --- a/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_humidity_temperature_sensor.lua +++ b/drivers/SmartThings/zigbee-humidity-sensor/src/test/test_humidity_temperature_sensor.lua @@ -55,7 +55,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -85,7 +85,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -107,7 +107,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -144,7 +144,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-illuminance-sensor/src/test/test_illuminance_sensor.lua b/drivers/SmartThings/zigbee-illuminance-sensor/src/test/test_illuminance_sensor.lua index fb97045c03..f8c959141d 100644 --- a/drivers/SmartThings/zigbee-illuminance-sensor/src/test/test_illuminance_sensor.lua +++ b/drivers/SmartThings/zigbee-illuminance-sensor/src/test/test_illuminance_sensor.lua @@ -46,7 +46,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -68,7 +68,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -106,7 +106,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, PowerConfiguration.attributes.BatteryPercentageRemaining:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-illuminance-sensor/src/test/test_illuminance_sensor_aqara.lua b/drivers/SmartThings/zigbee-illuminance-sensor/src/test/test_illuminance_sensor_aqara.lua index 32ee9eae11..8c519b17ca 100644 --- a/drivers/SmartThings/zigbee-illuminance-sensor/src/test/test_illuminance_sensor_aqara.lua +++ b/drivers/SmartThings/zigbee-illuminance-sensor/src/test/test_illuminance_sensor_aqara.lua @@ -59,7 +59,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.battery.battery(100))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -100,7 +100,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -123,7 +123,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -145,7 +145,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -183,7 +183,7 @@ test.register_coroutine_test( MFG_CODE, data_types.Uint16, frequency) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -197,7 +197,7 @@ test.register_coroutine_test( detectionFrequency.detectionFrequency(FREQUENCY_DEFAULT_VALUE, { visibility = { displayed = false } }))) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-lock/src/test/test_bad_battery_reporter.lua b/drivers/SmartThings/zigbee-lock/src/test/test_bad_battery_reporter.lua index 61fb28ce8d..6dfd87d155 100644 --- a/drivers/SmartThings/zigbee-lock/src/test/test_bad_battery_reporter.lua +++ b/drivers/SmartThings/zigbee-lock/src/test/test_bad_battery_reporter.lua @@ -46,7 +46,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -84,7 +84,7 @@ test.register_message_test( }, { test_init = test_init_yrd, - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-lock/src/test/test_c2o_lock.lua b/drivers/SmartThings/zigbee-lock/src/test/test_c2o_lock.lua index 4bde45ec1a..bf358af78c 100644 --- a/drivers/SmartThings/zigbee-lock/src/test/test_c2o_lock.lua +++ b/drivers/SmartThings/zigbee-lock/src/test/test_c2o_lock.lua @@ -41,7 +41,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, DoorLock.attributes.LockState:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -75,7 +75,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -88,7 +88,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, DoorLock.attributes.LockState:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -101,7 +101,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, PowerConfiguration.attributes.BatteryPercentageRemaining:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -114,7 +114,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, PowerConfiguration.attributes.BatteryPercentageRemaining:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -129,7 +129,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, DoorLock.attributes.LockState:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -144,7 +144,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, DoorLock.attributes.LockState:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -154,7 +154,7 @@ test.register_coroutine_test( test.socket.zigbee:__queue_receive({ mock_device.id, DoorLock.attributes.NumberOfPINUsersSupported:build_test_attr_report(mock_device, 8)}) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-lock/src/test/test_generic_fingerprint_profile_update.lua b/drivers/SmartThings/zigbee-lock/src/test/test_generic_fingerprint_profile_update.lua index e6d6a22b78..bd15eb3dd8 100644 --- a/drivers/SmartThings/zigbee-lock/src/test/test_generic_fingerprint_profile_update.lua +++ b/drivers/SmartThings/zigbee-lock/src/test/test_generic_fingerprint_profile_update.lua @@ -46,7 +46,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, DoorLock.attributes.NumberOfPINUsersSupported:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-lock/src/test/test_zigbee_lock_legacy.lua b/drivers/SmartThings/zigbee-lock/src/test/test_zigbee_lock_legacy.lua index c3b316f486..accfb345ac 100644 --- a/drivers/SmartThings/zigbee-lock/src/test/test_zigbee_lock_legacy.lua +++ b/drivers/SmartThings/zigbee-lock/src/test/test_zigbee_lock_legacy.lua @@ -81,7 +81,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -96,7 +96,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({mock_device.id, Alarm.attributes.AlarmCount:read(mock_device)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -116,7 +116,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -136,7 +136,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -163,7 +163,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -196,7 +196,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -215,7 +215,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -234,7 +234,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -253,7 +253,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -273,7 +273,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -284,7 +284,7 @@ test.register_coroutine_test( expect_reload_all_codes_messages() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -303,7 +303,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -345,7 +345,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -395,7 +395,7 @@ test.register_coroutine_test( capabilities.lockCodes.lockCodes(json.encode({["1"] = "test"}), { visibility = { displayed = false } }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -453,7 +453,7 @@ test.register_coroutine_test( capabilities.lockCodes.lockCodes(json.encode({["1"] = "foo"}), { visibility = { displayed = false } }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -471,7 +471,7 @@ test.register_coroutine_test( capabilities.lockCodes.lockCodes(json.encode({["1"] = "foo"}), { visibility = { displayed = false } }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -545,7 +545,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -580,7 +580,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -615,7 +615,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -654,7 +654,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -689,7 +689,7 @@ test.register_coroutine_test( capabilities.lockCodes.lockCodes(json.encode({}), { visibility = { displayed = false } }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -746,7 +746,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -777,7 +777,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -843,7 +843,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -862,7 +862,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -881,7 +881,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -909,7 +909,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -939,7 +939,7 @@ test.register_coroutine_test( capabilities.lockCodes.lockCodes(json.encode({["1"] = "Code 1"}), { visibility = { displayed = false } }))) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-lock/src/test/test_zigbee_lock_v10.lua b/drivers/SmartThings/zigbee-lock/src/test/test_zigbee_lock_v10.lua index 9ce880efe6..4d4a370168 100644 --- a/drivers/SmartThings/zigbee-lock/src/test/test_zigbee_lock_v10.lua +++ b/drivers/SmartThings/zigbee-lock/src/test/test_zigbee_lock_v10.lua @@ -81,7 +81,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -96,7 +96,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({mock_device.id, Alarm.attributes.AlarmCount:read(mock_device)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -116,7 +116,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -136,7 +136,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -163,7 +163,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -196,7 +196,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -215,7 +215,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -234,7 +234,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -253,7 +253,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -273,7 +273,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -284,7 +284,7 @@ test.register_coroutine_test( expect_reload_all_codes_messages() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -303,7 +303,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -345,7 +345,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -395,7 +395,7 @@ test.register_coroutine_test( capabilities.lockCodes.lockCodes(json.encode({["1"] = "test"}), { visibility = { displayed = false } }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -453,7 +453,7 @@ test.register_coroutine_test( capabilities.lockCodes.lockCodes(json.encode({["1"] = "foo"}), { visibility = { displayed = false } }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -471,7 +471,7 @@ test.register_coroutine_test( capabilities.lockCodes.lockCodes(json.encode({["1"] = "foo"}), { visibility = { displayed = false } }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -545,7 +545,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -580,7 +580,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -615,7 +615,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -654,7 +654,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -689,7 +689,7 @@ test.register_coroutine_test( capabilities.lockCodes.lockCodes(json.encode({}), { visibility = { displayed = false } }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -746,7 +746,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -777,7 +777,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -843,7 +843,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-lock/src/test/test_zigbee_yale_fingerprint-lock.lua b/drivers/SmartThings/zigbee-lock/src/test/test_zigbee_yale_fingerprint-lock.lua index b0f4d1ffcf..560e0b3768 100644 --- a/drivers/SmartThings/zigbee-lock/src/test/test_zigbee_yale_fingerprint-lock.lua +++ b/drivers/SmartThings/zigbee-lock/src/test/test_zigbee_yale_fingerprint-lock.lua @@ -48,7 +48,7 @@ test.register_message_test( }, { test_init = test_init, - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-lock/src/test/test_zigbee_yale_legacy.lua b/drivers/SmartThings/zigbee-lock/src/test/test_zigbee_yale_legacy.lua index 95d496e786..82e487439b 100644 --- a/drivers/SmartThings/zigbee-lock/src/test/test_zigbee_yale_legacy.lua +++ b/drivers/SmartThings/zigbee-lock/src/test/test_zigbee_yale_legacy.lua @@ -47,7 +47,7 @@ test.register_coroutine_test( expect_reload_all_codes_messages() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -89,7 +89,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -139,7 +139,7 @@ test.register_coroutine_test( capabilities.lockCodes.lockCodes(json.encode({["1"] = "test"}), { visibility = { displayed = false }}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -189,7 +189,7 @@ test.register_coroutine_test( capabilities.lockCodes.lockCodes(json.encode({["0"] = "test"}), { visibility = { displayed = false }}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -218,7 +218,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -276,7 +276,7 @@ test.register_coroutine_test( capabilities.lockCodes.lockCodes(json.encode({["1"] = "foo"}), { visibility = { displayed = false }}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -321,7 +321,7 @@ test.register_coroutine_test( capabilities.lockCodes.codeChanged("1 failed", { state_change = true }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -339,7 +339,7 @@ test.register_coroutine_test( capabilities.lockCodes.lockCodes(json.encode({["1"] = "foo"}), { visibility = { displayed = false }}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -382,7 +382,7 @@ test.register_coroutine_test( capabilities.lockCodes.codeChanged("1 is not set", { state_change = true }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -412,7 +412,7 @@ test.register_coroutine_test( capabilities.lockCodes.lockCodes(json.encode({["1"] = "initialName"}), { visibility = { displayed = false }}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -442,7 +442,7 @@ test.register_coroutine_test( capabilities.lockCodes.lockCodes(json.encode({}), { visibility = { displayed = false }}))) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_all_capabilities_zigbee_motion.lua b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_all_capabilities_zigbee_motion.lua index 72fbeb168b..07cb3a9d99 100644 --- a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_all_capabilities_zigbee_motion.lua +++ b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_all_capabilities_zigbee_motion.lua @@ -48,7 +48,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -75,7 +75,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -102,7 +102,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -129,7 +129,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -156,7 +156,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -182,7 +182,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -201,7 +201,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -220,7 +220,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -329,7 +329,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -416,7 +416,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -437,7 +437,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -457,7 +457,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_aqara_high_precision.lua b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_aqara_high_precision.lua index 5e961e37ec..3b87239092 100644 --- a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_aqara_high_precision.lua +++ b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_aqara_high_precision.lua @@ -73,7 +73,7 @@ test.register_coroutine_test( capabilities.battery.battery(100))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -96,7 +96,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -120,7 +120,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -145,7 +145,7 @@ test.register_coroutine_test( capabilities.motionSensor.motion.inactive())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -188,7 +188,7 @@ test.register_coroutine_test( detectionFrequency.detectionFrequency(value, {visibility = {displayed = false}}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -205,7 +205,7 @@ test.register_coroutine_test( sensitivityAdjustment.sensitivityAdjustment.High())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -222,7 +222,7 @@ test.register_coroutine_test( sensitivityAdjustment.sensitivityAdjustment.Medium())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -239,7 +239,7 @@ test.register_coroutine_test( sensitivityAdjustment.sensitivityAdjustment.Low())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -277,7 +277,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_aqara_motion_illuminance.lua b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_aqara_motion_illuminance.lua index a75033bef8..979c64d45b 100644 --- a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_aqara_motion_illuminance.lua +++ b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_aqara_motion_illuminance.lua @@ -88,7 +88,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.battery.battery(100))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -111,7 +111,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -139,7 +139,7 @@ test.register_coroutine_test( capabilities.motionSensor.motion.inactive())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -158,7 +158,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -202,7 +202,7 @@ test.register_coroutine_test( capabilities.motionSensor.motion.inactive())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -219,7 +219,7 @@ test.register_coroutine_test( detectionFrequency.detectionFrequency(PREF_FREQUENCY_VALUE_DEFAULT, {visibility = {displayed = false}}))) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_aurora_motion.lua b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_aurora_motion.lua index 4ae03f0354..f209f4f18f 100644 --- a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_aurora_motion.lua +++ b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_aurora_motion.lua @@ -56,7 +56,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -83,7 +83,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -110,7 +110,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -137,7 +137,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -176,7 +176,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -220,7 +220,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_battery_voltage_motion.lua b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_battery_voltage_motion.lua index 1bb1e359bb..99c2da077d 100644 --- a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_battery_voltage_motion.lua +++ b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_battery_voltage_motion.lua @@ -52,7 +52,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_centralite_motion.lua b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_centralite_motion.lua index fd1222b0cc..94c6779b44 100644 --- a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_centralite_motion.lua +++ b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_centralite_motion.lua @@ -71,7 +71,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -97,7 +97,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_compacta_motion.lua b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_compacta_motion.lua index ec85954568..03afa1c6e9 100644 --- a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_compacta_motion.lua +++ b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_compacta_motion.lua @@ -77,7 +77,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -101,7 +101,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_frient_motion_sensor.lua b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_frient_motion_sensor.lua index a7b3828958..42a30de572 100644 --- a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_frient_motion_sensor.lua +++ b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_frient_motion_sensor.lua @@ -71,7 +71,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -84,7 +84,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, OccupancySensing.attributes.Occupancy:read(mock_device):to_endpoint(OCCUPANCY_ENDPOINT)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -214,7 +214,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -233,7 +233,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -252,7 +252,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -284,7 +284,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_frient_motion_sensor2_pet.lua b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_frient_motion_sensor2_pet.lua index 4dc67338d5..b84bfc6b6e 100644 --- a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_frient_motion_sensor2_pet.lua +++ b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_frient_motion_sensor2_pet.lua @@ -79,7 +79,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -98,7 +98,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -125,7 +125,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -147,7 +147,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -201,7 +201,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({mock_device.id, IlluminanceMeasurement.attributes.MeasuredValue:read(mock_device):to_endpoint(ILLUMINANCE_ENDPOINT)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -359,7 +359,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -402,7 +402,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_frient_motion_sensor_pro.lua b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_frient_motion_sensor_pro.lua index fe633e089a..f3e39499e0 100644 --- a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_frient_motion_sensor_pro.lua +++ b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_frient_motion_sensor_pro.lua @@ -82,7 +82,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -101,7 +101,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -121,7 +121,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -141,7 +141,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -168,7 +168,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -190,7 +190,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -206,7 +206,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({mock_device.id, IlluminanceMeasurement.attributes.MeasuredValue:read(mock_device):to_endpoint(ILLUMINANCE_ENDPOINT)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -367,7 +367,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -410,7 +410,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -430,7 +430,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -450,7 +450,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_gator_motion.lua b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_gator_motion.lua index ad129ddc2b..343d4921c1 100644 --- a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_gator_motion.lua +++ b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_gator_motion.lua @@ -46,7 +46,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.motionSensor.motion.inactive())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -65,7 +65,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.presenceSensor.presence.not_present())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -81,7 +81,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.contactSensor.contact.open())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -97,7 +97,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.contactSensor.contact.closed())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -113,7 +113,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.battery.battery(100))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -129,7 +129,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.battery.battery(0))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -145,7 +145,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.battery.battery(10))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -163,7 +163,7 @@ test.register_coroutine_test( test.socket.device_lifecycle:__queue_receive({ mock_device.id, "doConfigure" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -182,7 +182,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.motionSensor.motion.inactive())) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_ikea_motion.lua b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_ikea_motion.lua index f922439c22..bd1f959bc7 100644 --- a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_ikea_motion.lua +++ b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_ikea_motion.lua @@ -60,7 +60,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -102,7 +102,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -125,7 +125,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.motionSensor.motion.inactive())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -149,7 +149,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_add_hub_to_group(0xB9F2) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -211,7 +211,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -237,7 +237,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -265,7 +265,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.motionSensor.motion.inactive())) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_samjin_sensor.lua b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_samjin_sensor.lua index 95c24f5f8e..2e098b3e69 100644 --- a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_samjin_sensor.lua +++ b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_samjin_sensor.lua @@ -95,7 +95,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -120,7 +120,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_sengled_motion.lua b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_sengled_motion.lua index 4ca87d6358..9f4c74dc30 100644 --- a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_sengled_motion.lua +++ b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_sengled_motion.lua @@ -46,7 +46,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, IASZone.attributes.ZoneStatus:configure_reporting(mock_device, 0xFFFF, 0x0000, 0) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -98,7 +98,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_smartsense_motion_sensor.lua b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_smartsense_motion_sensor.lua index b8b8fc4c62..c6e4d022e6 100644 --- a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_smartsense_motion_sensor.lua +++ b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_smartsense_motion_sensor.lua @@ -69,7 +69,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.signalStrength.rssi({ value = -50, unit = "dBm" }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -86,7 +86,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.signalStrength.rssi({ value = -50, unit = "dBm" }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -103,7 +103,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.signalStrength.rssi({ value = -50, unit = "dBm" }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -120,7 +120,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.signalStrength.rssi({ value = -50, unit = "dBm" }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -136,7 +136,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.signalStrength.rssi({ value = -50, unit = "dBm" }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -152,7 +152,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.signalStrength.rssi({ value = -50, unit = "dBm" }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -169,7 +169,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.signalStrength.rssi({ value = -50, unit = "dBm" }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -182,7 +182,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.signalStrength.rssi({value = -100, unit = 'dBm'}))) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_smartthings_motion.lua b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_smartthings_motion.lua index 83c8f3c36d..0f6c4039e2 100644 --- a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_smartthings_motion.lua +++ b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_smartthings_motion.lua @@ -55,7 +55,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_thirdreality_sensor.lua b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_thirdreality_sensor.lua index cae6559187..45328961e9 100644 --- a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_thirdreality_sensor.lua +++ b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_thirdreality_sensor.lua @@ -70,7 +70,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -96,7 +96,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -122,7 +122,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -148,7 +148,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -170,7 +170,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_zigbee_motion_iris.lua b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_zigbee_motion_iris.lua index 7808c5184a..5794245167 100644 --- a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_zigbee_motion_iris.lua +++ b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_zigbee_motion_iris.lua @@ -56,7 +56,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -143,7 +143,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_zigbee_motion_nyce.lua b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_zigbee_motion_nyce.lua index 9dca781210..01e7785287 100644 --- a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_zigbee_motion_nyce.lua +++ b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_zigbee_motion_nyce.lua @@ -46,7 +46,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -65,7 +65,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -94,7 +94,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_zigbee_motion_orvibo.lua b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_zigbee_motion_orvibo.lua index c9172d8b8f..82f1b9509b 100644 --- a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_zigbee_motion_orvibo.lua +++ b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_zigbee_motion_orvibo.lua @@ -46,7 +46,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -65,7 +65,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -84,7 +84,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -103,7 +103,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -130,7 +130,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -157,7 +157,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_zigbee_plugin_motion_sensor.lua b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_zigbee_plugin_motion_sensor.lua index 3bc0f85f0c..e93a03b861 100644 --- a/drivers/SmartThings/zigbee-motion-sensor/src/test/test_zigbee_plugin_motion_sensor.lua +++ b/drivers/SmartThings/zigbee-motion-sensor/src/test/test_zigbee_plugin_motion_sensor.lua @@ -49,7 +49,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -68,7 +68,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -115,7 +115,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -139,7 +139,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-power-meter/src/test/test_frient_power_energy_battery_consumption_report.lua b/drivers/SmartThings/zigbee-power-meter/src/test/test_frient_power_energy_battery_consumption_report.lua index 6a312c1906..d752ccd553 100644 --- a/drivers/SmartThings/zigbee-power-meter/src/test/test_frient_power_energy_battery_consumption_report.lua +++ b/drivers/SmartThings/zigbee-power-meter/src/test/test_frient_power_energy_battery_consumption_report.lua @@ -155,7 +155,10 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end -) +, + { + min_api_version = 15 + }) test.register_message_test( "Refresh should read all necessary attributes", diff --git a/drivers/SmartThings/zigbee-power-meter/src/test/test_frient_power_energy_consumption_report.lua b/drivers/SmartThings/zigbee-power-meter/src/test/test_frient_power_energy_consumption_report.lua index 2679329fd3..ae8ad437d9 100644 --- a/drivers/SmartThings/zigbee-power-meter/src/test/test_frient_power_energy_consumption_report.lua +++ b/drivers/SmartThings/zigbee-power-meter/src/test/test_frient_power_energy_consumption_report.lua @@ -140,7 +140,10 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end -) +, + { + min_api_version = 15 + }) test.register_message_test( "Refresh should read all necessary attributes", diff --git a/drivers/SmartThings/zigbee-power-meter/src/test/test_frient_power_energy_current_voltage.lua b/drivers/SmartThings/zigbee-power-meter/src/test/test_frient_power_energy_current_voltage.lua index 75f9da6961..a6edbf71bd 100644 --- a/drivers/SmartThings/zigbee-power-meter/src/test/test_frient_power_energy_current_voltage.lua +++ b/drivers/SmartThings/zigbee-power-meter/src/test/test_frient_power_energy_current_voltage.lua @@ -356,6 +356,9 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end -) +, + { + min_api_version = 15 + }) test.run_registered_tests() diff --git a/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter.lua b/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter.lua index 571764d8f2..19ad41c700 100644 --- a/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter.lua +++ b/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter.lua @@ -91,7 +91,7 @@ test.register_coroutine_test( test_init = function() -- no op to override auto device add on startup end, - min_api_version = 17 + min_api_version = 14 } ) @@ -118,7 +118,7 @@ test.register_coroutine_test( test_init = function() -- no op to override auto device add on startup end, - min_api_version = 17 + min_api_version = 14 } ) @@ -144,7 +144,7 @@ test.register_coroutine_test( test_init = function() -- no op to override auto device add on startup end, - min_api_version = 17 + min_api_version = 14 } ) @@ -170,7 +170,7 @@ test.register_coroutine_test( test_init = function() -- no op to override auto device add on startup end, - min_api_version = 17 + min_api_version = 14 } ) @@ -195,7 +195,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -219,7 +219,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -291,7 +291,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_1p.lua b/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_1p.lua index f82864cc06..354cffe1e2 100644 --- a/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_1p.lua +++ b/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_1p.lua @@ -76,7 +76,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -96,7 +96,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -116,7 +116,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -136,7 +136,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -156,7 +156,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -240,7 +240,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -259,7 +259,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -305,7 +305,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -324,7 +324,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -347,7 +347,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_1p_ZM.lua b/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_1p_ZM.lua index ef82322125..530281a13b 100644 --- a/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_1p_ZM.lua +++ b/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_1p_ZM.lua @@ -206,6 +206,9 @@ test.register_coroutine_test( }) mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end -) +, + { + min_api_version = 15 + }) test.run_registered_tests() diff --git a/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_2p.lua b/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_2p.lua index 37edda6bd9..5f9d8a3348 100644 --- a/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_2p.lua +++ b/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_2p.lua @@ -73,7 +73,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -93,7 +93,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -113,7 +113,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -133,7 +133,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -153,7 +153,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -173,7 +173,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -193,7 +193,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -301,7 +301,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_2p_ZM.lua b/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_2p_ZM.lua index 5b959e7c61..ffb31f4b64 100644 --- a/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_2p_ZM.lua +++ b/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_2p_ZM.lua @@ -279,6 +279,9 @@ test.register_coroutine_test( }) mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end -) +, + { + min_api_version = 15 + }) test.run_registered_tests() diff --git a/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_3p.lua b/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_3p.lua index ed606d096e..1b227dec62 100644 --- a/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_3p.lua +++ b/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_3p.lua @@ -72,7 +72,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -92,7 +92,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -112,7 +112,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -132,7 +132,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -152,7 +152,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -172,7 +172,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -192,7 +192,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -212,7 +212,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -232,7 +232,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -252,7 +252,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -384,7 +384,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_3p_ZM.lua b/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_3p_ZM.lua index c4d24f35ba..8aba874223 100644 --- a/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_3p_ZM.lua +++ b/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_3p_ZM.lua @@ -353,6 +353,9 @@ test.register_coroutine_test( }) mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end -) +, + { + min_api_version = 15 + }) test.run_registered_tests() diff --git a/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_consumption_report_sihas.lua b/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_consumption_report_sihas.lua index ece6587f2f..b484ac43ee 100644 --- a/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_consumption_report_sihas.lua +++ b/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_consumption_report_sihas.lua @@ -100,7 +100,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -145,7 +145,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -209,7 +209,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -236,7 +236,7 @@ test.register_coroutine_test( test_init = function() -- no op to override auto device add on startup end, - min_api_version = 17 + min_api_version = 14 } ) test.register_coroutine_test( @@ -254,7 +254,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -277,7 +277,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_ezex.lua b/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_ezex.lua index afb5adda69..39a8bc3d43 100644 --- a/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_ezex.lua +++ b/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_ezex.lua @@ -93,7 +93,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -132,7 +132,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -166,7 +166,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -193,7 +193,7 @@ test.register_coroutine_test( test_init = function() -- no op to override auto device add on startup end, - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_frient.lua b/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_frient.lua index f6cf172d7f..2a4b2db86a 100644 --- a/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_frient.lua +++ b/drivers/SmartThings/zigbee-power-meter/src/test/test_zigbee_power_meter_frient.lua @@ -193,7 +193,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/zigbee-presence-sensor/src/test/test_aqara_presence_sensor_fp1.lua b/drivers/SmartThings/zigbee-presence-sensor/src/test/test_aqara_presence_sensor_fp1.lua index 557519996e..b04f283c95 100644 --- a/drivers/SmartThings/zigbee-presence-sensor/src/test/test_aqara_presence_sensor_fp1.lua +++ b/drivers/SmartThings/zigbee-presence-sensor/src/test/test_aqara_presence_sensor_fp1.lua @@ -63,7 +63,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -91,7 +91,7 @@ test.register_coroutine_test( data_types.Uint8, updates.preferences["stse.sensitivity"]) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -119,7 +119,7 @@ test.register_coroutine_test( data_types.Uint8, 0x01) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -147,7 +147,7 @@ test.register_coroutine_test( data_types.Uint8, updates.preferences["stse.approachDistance"]) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -165,7 +165,7 @@ test.register_coroutine_test( PresenceSensor.presence("present"))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -183,7 +183,7 @@ test.register_coroutine_test( PresenceSensor.presence("not present"))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -206,7 +206,7 @@ test.register_coroutine_test( MovementSensor.movement("noMovement"))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -229,7 +229,7 @@ test.register_coroutine_test( MovementSensor.movement("noMovement"))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -252,7 +252,7 @@ test.register_coroutine_test( MovementSensor.movement("noMovement"))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -275,7 +275,7 @@ test.register_coroutine_test( MovementSensor.movement("noMovement"))) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-presence-sensor/src/test/test_st_arrival_sensor_v1.lua b/drivers/SmartThings/zigbee-presence-sensor/src/test/test_st_arrival_sensor_v1.lua index 9124534739..411dddda5a 100644 --- a/drivers/SmartThings/zigbee-presence-sensor/src/test/test_st_arrival_sensor_v1.lua +++ b/drivers/SmartThings/zigbee-presence-sensor/src/test/test_st_arrival_sensor_v1.lua @@ -98,7 +98,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -118,7 +118,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -129,7 +129,7 @@ test.register_coroutine_test( add_device_after_switch_over() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -144,7 +144,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_simple_device:generate_test_message("main", capabilities.presenceSensor.presence("present"))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -160,7 +160,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_simple_device:generate_test_message("main", capabilities.presenceSensor.presence("present"))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -176,7 +176,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_simple_device:generate_test_message("main", capabilities.presenceSensor.presence("present"))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -192,7 +192,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_simple_device:generate_test_message("main", capabilities.presenceSensor.presence("present"))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -207,7 +207,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_simple_device:generate_test_message("main", capabilities.presenceSensor.presence("not present")) ) end, { - test_init = function() end, min_api_version = 17 + test_init = function() end, min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-presence-sensor/src/test/test_zigbee_presence_sensor.lua b/drivers/SmartThings/zigbee-presence-sensor/src/test/test_zigbee_presence_sensor.lua index 53843e0014..a688b8026b 100644 --- a/drivers/SmartThings/zigbee-presence-sensor/src/test/test_zigbee_presence_sensor.lua +++ b/drivers/SmartThings/zigbee-presence-sensor/src/test/test_zigbee_presence_sensor.lua @@ -79,7 +79,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -98,7 +98,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -152,7 +152,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -188,7 +188,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -199,7 +199,7 @@ test.register_coroutine_test( add_device_after_switch_over() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -214,7 +214,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_simple_device:generate_test_message("main", capabilities.presenceSensor.presence("not present")) ) end, { - test_init = function() end, min_api_version = 17 + test_init = function() end, min_api_version = 14 } ) @@ -245,7 +245,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_simple_device:generate_test_message("main", capabilities.presenceSensor.presence("not present")) ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -280,7 +280,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -313,7 +313,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -334,7 +334,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -349,7 +349,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -397,7 +397,7 @@ test.register_coroutine_test( mock_device_str_interval:generate_test_message("main", capabilities.presenceSensor.presence("not present")) ) end, - { test_init = function() end, min_api_version = 17 + { test_init = function() end, min_api_version = 14 } ) @@ -413,7 +413,7 @@ test.register_coroutine_test( mock_device_nil_interval:generate_test_message("main", capabilities.presenceSensor.presence("not present")) ) end, - { test_init = function() end, min_api_version = 17 + { test_init = function() end, min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-range-extender/src/init.lua b/drivers/SmartThings/zigbee-range-extender/src/init.lua index f6ba3c1ffc..f06988f5cf 100644 --- a/drivers/SmartThings/zigbee-range-extender/src/init.lua +++ b/drivers/SmartThings/zigbee-range-extender/src/init.lua @@ -3,6 +3,7 @@ local capabilities = require "st.capabilities" +local log = require "log" local defaults = require "st.zigbee.defaults" local Basic = (require "st.zigbee.zcl.clusters").Basic local ZigbeeDriver = require "st.zigbee" @@ -33,8 +34,13 @@ local zigbee_range_extender_driver = ZigbeeDriver("zigbee-range-extender", zigbe function zigbee_range_extender_driver:device_health_check() local device_list = self.device_api.get_device_list() for _, device_id in ipairs(device_list) do - local device = self:get_device_info(device_id, false) - device:send(Basic.attributes.ZCLVersion:read(device)) + local device, err = self:get_device_info(device_id, false) + if device == nil then + log.warn_with({ hub_logs = true }, + string.format("device_health_check failed to get device info for device_id %s: %s", device_id, err)) + else + device:send(Basic.attributes.ZCLVersion:read(device)) + end end end diff --git a/drivers/SmartThings/zigbee-range-extender/src/test/test_frient_zigbee_range_extender.lua b/drivers/SmartThings/zigbee-range-extender/src/test/test_frient_zigbee_range_extender.lua index 30a6270b8a..5df7aea4a8 100644 --- a/drivers/SmartThings/zigbee-range-extender/src/test/test_frient_zigbee_range_extender.lua +++ b/drivers/SmartThings/zigbee-range-extender/src/test/test_frient_zigbee_range_extender.lua @@ -52,7 +52,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -96,7 +96,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -115,7 +115,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -134,7 +134,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -153,7 +153,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -172,7 +172,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -191,7 +191,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -210,7 +210,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -229,7 +229,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-range-extender/src/test/test_zigbee_extend.lua b/drivers/SmartThings/zigbee-range-extender/src/test/test_zigbee_extend.lua index 59156dd798..4fddd85ec1 100644 --- a/drivers/SmartThings/zigbee-range-extender/src/test/test_zigbee_extend.lua +++ b/drivers/SmartThings/zigbee-range-extender/src/test/test_zigbee_extend.lua @@ -30,7 +30,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-sensor/src/test/test_zigbee_sensor.lua b/drivers/SmartThings/zigbee-sensor/src/test/test_zigbee_sensor.lua index 32d4762d4b..40ea0c0b4e 100644 --- a/drivers/SmartThings/zigbee-sensor/src/test/test_zigbee_sensor.lua +++ b/drivers/SmartThings/zigbee-sensor/src/test/test_zigbee_sensor.lua @@ -121,7 +121,7 @@ test.register_coroutine_test( mock_device_generic_sensor:expect_metadata_update({profile = ZIGBEE_GENERIC_CONTACT_SENSOR_PROFILE}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -133,7 +133,7 @@ test.register_coroutine_test( mock_device_generic_sensor:expect_metadata_update({profile = ZIGBEE_GENERIC_MOTION_SENSOR_PROFILE}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -144,7 +144,7 @@ test.register_coroutine_test( mock_device_motion_illuminance:expect_metadata_update({profile = ZIGBEE_GENERIC_MOTION_ILLUMINANCE_PROFILE}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -155,7 +155,7 @@ test.register_coroutine_test( mock_device_generic_sensor:expect_metadata_update({profile = ZIGBEE_GENERIC_WATERLEAK_SENSOR_PROFILE}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -174,7 +174,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -193,7 +193,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -212,7 +212,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -231,7 +231,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -250,7 +250,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -269,7 +269,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -290,7 +290,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -311,7 +311,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -330,7 +330,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -349,7 +349,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -368,7 +368,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -387,7 +387,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -406,7 +406,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -425,7 +425,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -447,7 +447,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -466,7 +466,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -485,7 +485,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -504,7 +504,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -523,7 +523,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -542,7 +542,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -561,7 +561,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -674,7 +674,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -694,7 +694,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device_motion_sensor.id, ZoneStatusAttribute:read(mock_device_motion_sensor) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -714,7 +714,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device_motion_illuminance.id, ZoneStatusAttribute:read(mock_device_motion_illuminance) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -734,7 +734,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device_waterleak_sensor.id, ZoneStatusAttribute:read(mock_device_waterleak_sensor) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -808,7 +808,7 @@ test.register_coroutine_test( mock_device_contact_sensor:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -874,7 +874,7 @@ test.register_coroutine_test( mock_device_motion_sensor:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -940,7 +940,7 @@ test.register_coroutine_test( mock_device_motion_illuminance:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1007,7 +1007,7 @@ test.register_coroutine_test( mock_device_waterleak_sensor:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-siren/src/test/test_frient_siren.lua b/drivers/SmartThings/zigbee-siren/src/test/test_frient_siren.lua index 4d0486c6fd..3ecee4b16d 100644 --- a/drivers/SmartThings/zigbee-siren/src/test/test_frient_siren.lua +++ b/drivers/SmartThings/zigbee-siren/src/test/test_frient_siren.lua @@ -259,7 +259,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -379,7 +379,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -410,7 +410,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -440,7 +440,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -456,7 +456,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -516,7 +516,7 @@ test.register_coroutine_test( get_siren_OFF_commands() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -602,7 +602,7 @@ test.register_coroutine_test( get_siren_OFF_commands() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -681,7 +681,7 @@ test.register_coroutine_test( get_siren_OFF_commands(expectedWarningDuration) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -708,7 +708,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -734,7 +734,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -779,7 +779,7 @@ test.register_coroutine_test( get_squawk_command_new_fw(SquawkMode.SOUND_FOR_SYSTEM_IS_DISARMED, IaswdLevel.MEDIUM_LEVEL) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -824,7 +824,7 @@ test.register_coroutine_test( get_squawk_command_older_fw(SquawkMode.SOUND_FOR_SYSTEM_IS_DISARMED, IaswdLevel.MEDIUM_LEVEL) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -881,7 +881,7 @@ test.register_coroutine_test( get_squawk_command_new_fw(SquawkMode.SOUND_FOR_SYSTEM_IS_DISARMED, IaswdLevel.MEDIUM_LEVEL) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -915,7 +915,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -962,7 +962,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -981,7 +981,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1000,7 +1000,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1019,7 +1019,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1038,7 +1038,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1057,7 +1057,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1103,7 +1103,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1121,7 +1121,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1182,7 +1182,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-siren/src/test/test_frient_siren_tamper.lua b/drivers/SmartThings/zigbee-siren/src/test/test_frient_siren_tamper.lua index 70854ca7e7..cfa4e8b8a5 100644 --- a/drivers/SmartThings/zigbee-siren/src/test/test_frient_siren_tamper.lua +++ b/drivers/SmartThings/zigbee-siren/src/test/test_frient_siren_tamper.lua @@ -277,7 +277,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -404,7 +404,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -435,7 +435,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -465,7 +465,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -481,7 +481,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -542,7 +542,7 @@ test.register_coroutine_test( get_siren_OFF_commands() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -628,7 +628,7 @@ test.register_coroutine_test( get_siren_OFF_commands() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -707,7 +707,7 @@ test.register_coroutine_test( get_siren_OFF_commands(expectedWarningDuration) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -733,7 +733,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -759,7 +759,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -804,7 +804,7 @@ test.register_coroutine_test( get_squawk_command_new_fw(SquawkMode.SOUND_FOR_SYSTEM_IS_DISARMED, IaswdLevel.MEDIUM_LEVEL) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -849,7 +849,7 @@ test.register_coroutine_test( get_squawk_command_older_fw(SquawkMode.SOUND_FOR_SYSTEM_IS_DISARMED, IaswdLevel.MEDIUM_LEVEL) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -906,7 +906,7 @@ test.register_coroutine_test( get_squawk_command_new_fw(SquawkMode.SOUND_FOR_SYSTEM_IS_DISARMED, IaswdLevel.MEDIUM_LEVEL) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -940,7 +940,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -989,7 +989,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1014,7 +1014,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -1039,7 +1039,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -1058,7 +1058,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1077,7 +1077,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1096,7 +1096,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1134,7 +1134,7 @@ test.register_coroutine_test( { test_init = function() test.mock_device.add_test_device(mock_device_112) end, - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-siren/src/test/test_ozom_siren.lua b/drivers/SmartThings/zigbee-siren/src/test/test_ozom_siren.lua index f7b13d4895..70eccc578f 100644 --- a/drivers/SmartThings/zigbee-siren/src/test/test_ozom_siren.lua +++ b/drivers/SmartThings/zigbee-siren/src/test/test_ozom_siren.lua @@ -62,7 +62,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -99,7 +99,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -125,7 +125,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-smoke-detector/src/test/test_aqara_gas_detector.lua b/drivers/SmartThings/zigbee-smoke-detector/src/test/test_aqara_gas_detector.lua index c15b0e4d62..47e10b7923 100644 --- a/drivers/SmartThings/zigbee-smoke-detector/src/test/test_aqara_gas_detector.lua +++ b/drivers/SmartThings/zigbee-smoke-detector/src/test/test_aqara_gas_detector.lua @@ -65,7 +65,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", lifeTimeReport.lifeTimeState.normal())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -86,7 +86,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -105,7 +105,7 @@ test.register_coroutine_test( capabilities.gasDetector.gas.detected())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -123,7 +123,7 @@ test.register_coroutine_test( capabilities.gasDetector.gas.clear())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -141,7 +141,7 @@ test.register_coroutine_test( capabilities.audioMute.mute.muted())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -159,7 +159,7 @@ test.register_coroutine_test( capabilities.audioMute.mute.unmuted())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -173,7 +173,7 @@ test.register_coroutine_test( PRIVATE_MUTE_ATTRIBUTE_ID, MFG_CODE, data_types.Uint8, 1) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -186,7 +186,7 @@ test.register_coroutine_test( capabilities.audioMute.mute.muted())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -206,7 +206,7 @@ test.register_coroutine_test( selfCheck.selfCheckState.selfCheckCompleted())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -223,7 +223,7 @@ test.register_coroutine_test( PRIVATE_SELF_CHECK_ATTRIBUTE_ID, MFG_CODE, data_types.Boolean, true) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -243,7 +243,7 @@ test.register_coroutine_test( lifeTimeReport.lifeTimeState.endOfLife())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -261,7 +261,7 @@ test.register_coroutine_test( lifeTimeReport.lifeTimeState.normal())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -279,7 +279,7 @@ test.register_coroutine_test( sensitivityAdjustment.sensitivityAdjustment.Low())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -297,7 +297,7 @@ test.register_coroutine_test( selfCheck.selfCheckState.idle())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -315,7 +315,7 @@ test.register_coroutine_test( sensitivityAdjustment.sensitivityAdjustment.High())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -349,7 +349,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -384,7 +384,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-smoke-detector/src/test/test_aqara_smoke_detector.lua b/drivers/SmartThings/zigbee-smoke-detector/src/test/test_aqara_smoke_detector.lua index eaee68d41e..31751312c7 100644 --- a/drivers/SmartThings/zigbee-smoke-detector/src/test/test_aqara_smoke_detector.lua +++ b/drivers/SmartThings/zigbee-smoke-detector/src/test/test_aqara_smoke_detector.lua @@ -51,7 +51,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.battery.battery(100))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -82,7 +82,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -100,7 +100,7 @@ test.register_coroutine_test( capabilities.smokeDetector.smoke.detected())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -118,7 +118,7 @@ test.register_coroutine_test( capabilities.audioMute.mute.muted())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -132,7 +132,7 @@ test.register_coroutine_test( PRIVATE_MUTE_ATTRIBUTE_ID, MFG_CODE, data_types.Uint8, 1) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -150,7 +150,7 @@ test.register_coroutine_test( selfCheck.selfCheckState.selfCheckCompleted())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -165,7 +165,7 @@ test.register_coroutine_test( PRIVATE_SELF_CHECK_ATTRIBUTE_ID, MFG_CODE, data_types.Boolean, true) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -183,7 +183,7 @@ test.register_coroutine_test( capabilities.smokeDetector.smoke.clear())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -201,7 +201,7 @@ test.register_coroutine_test( capabilities.audioMute.mute.unmuted())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -219,7 +219,7 @@ test.register_coroutine_test( selfCheck.selfCheckState.idle())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -238,7 +238,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-smoke-detector/src/test/test_frient_heat_detector.lua b/drivers/SmartThings/zigbee-smoke-detector/src/test/test_frient_heat_detector.lua index 7f1a7e5f3a..6512e3504f 100644 --- a/drivers/SmartThings/zigbee-smoke-detector/src/test/test_frient_heat_detector.lua +++ b/drivers/SmartThings/zigbee-smoke-detector/src/test/test_frient_heat_detector.lua @@ -76,7 +76,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -198,7 +198,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -217,7 +217,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -236,7 +236,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -255,7 +255,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -276,7 +276,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -303,7 +303,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -345,7 +345,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -382,7 +382,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -418,7 +418,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -455,7 +455,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -491,7 +491,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -528,7 +528,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -605,7 +605,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -624,7 +624,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -643,7 +643,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-smoke-detector/src/test/test_frient_smoke_detector.lua b/drivers/SmartThings/zigbee-smoke-detector/src/test/test_frient_smoke_detector.lua index 7596148a66..f9a60d24c4 100644 --- a/drivers/SmartThings/zigbee-smoke-detector/src/test/test_frient_smoke_detector.lua +++ b/drivers/SmartThings/zigbee-smoke-detector/src/test/test_frient_smoke_detector.lua @@ -83,7 +83,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -205,7 +205,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -224,7 +224,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -244,7 +244,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -264,7 +264,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -285,7 +285,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -312,7 +312,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -391,7 +391,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -428,7 +428,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -464,7 +464,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -501,7 +501,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -537,7 +537,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -574,7 +574,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -651,7 +651,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -693,7 +693,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -712,7 +712,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -731,7 +731,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -747,7 +747,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-smoke-detector/src/test/test_zigbee_smoke_detector.lua b/drivers/SmartThings/zigbee-smoke-detector/src/test/test_zigbee_smoke_detector.lua index f0f9b8259e..1afb849207 100644 --- a/drivers/SmartThings/zigbee-smoke-detector/src/test/test_zigbee_smoke_detector.lua +++ b/drivers/SmartThings/zigbee-smoke-detector/src/test/test_zigbee_smoke_detector.lua @@ -45,7 +45,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -72,7 +72,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -99,7 +99,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -126,7 +126,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -145,7 +145,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -245,7 +245,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -284,7 +284,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-sound-sensor/src/test/test_zigbee_sound_sensor.lua b/drivers/SmartThings/zigbee-sound-sensor/src/test/test_zigbee_sound_sensor.lua index 11a251b1d7..90e1369935 100644 --- a/drivers/SmartThings/zigbee-sound-sensor/src/test/test_zigbee_sound_sensor.lua +++ b/drivers/SmartThings/zigbee-sound-sensor/src/test/test_zigbee_sound_sensor.lua @@ -123,7 +123,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -191,7 +191,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -210,7 +210,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -229,7 +229,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -248,7 +248,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -267,7 +267,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -294,7 +294,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -318,7 +318,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/fingerprints.yml b/drivers/SmartThings/zigbee-switch/fingerprints.yml index 08eb875591..bebe5295a2 100644 --- a/drivers/SmartThings/zigbee-switch/fingerprints.yml +++ b/drivers/SmartThings/zigbee-switch/fingerprints.yml @@ -111,6 +111,11 @@ zigbeeManufacturer: manufacturer: LUMI model: lumi.switch.n0acn2 deviceProfileName: aqara-switch-module + - id: "Aqara/lumi.switch.acn047" + deviceLabel: Aqara Dual Relay Module T2 (With Neutral) 1 + manufacturer: Aqara + model: lumi.switch.acn047 + deviceProfileName: aqara-dual-relay-module-unified - id: "LUMI/lumi.light.acn004" deviceLabel: Aqara Smart Dimmer Controller T1 Pro manufacturer: LUMI diff --git a/drivers/SmartThings/zigbee-switch/profiles/aqara-dual-relay-module-unified.yml b/drivers/SmartThings/zigbee-switch/profiles/aqara-dual-relay-module-unified.yml new file mode 100644 index 0000000000..b77d7eac0f --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/profiles/aqara-dual-relay-module-unified.yml @@ -0,0 +1,40 @@ +name: aqara-dual-relay-module-unified +components: + - id: main + capabilities: + - id: switch + version: 1 + - id: button + version: 1 + - id: powerMeter + version: 1 + - id: energyMeter + version: 1 + - id: refresh + version: 1 + categories: + - name: Switch + - id: interlock + capabilities: + - id: mode + version: 1 + categories: + - name: Switch + - id: devicemode + capabilities: + - id: mode + version: 1 + categories: + - name: Switch +preferences: + - preferenceId: stse.powerOffMemory + explicit: true + - preferenceId: stse.pulseIntervalSetting + explicit: true + - preferenceId: stse.switchType + explicit: true + - preferenceId: stse.changeToWirelessSwitch + explicit: true +metadata: + mnmn: SolutionsEngineering + vid: SmartThings-smartthings-Aqara_Dual_Relay_Module_T2 diff --git a/drivers/SmartThings/zigbee-switch/src/aqara/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/aqara/can_handle.lua index e183f78266..c0eb27343e 100644 --- a/drivers/SmartThings/zigbee-switch/src/aqara/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/aqara/can_handle.lua @@ -1,6 +1,8 @@ -- Copyright 2025 SmartThings, Inc. -- Licensed under the Apache License, Version 2.0 +-- Matches any device whose manufacturer/model is listed in aqara/fingerprints.lua, routing it to +-- the aqara sub-driver (and, in turn, its version / multi-switch sub-drivers). return function(opts, driver, device) local FINGERPRINTS = require("aqara.fingerprints") for _, fingerprint in ipairs(FINGERPRINTS) do diff --git a/drivers/SmartThings/zigbee-switch/src/aqara/fingerprints.lua b/drivers/SmartThings/zigbee-switch/src/aqara/fingerprints.lua index 63f94e2be3..3fc2fbc3e3 100644 --- a/drivers/SmartThings/zigbee-switch/src/aqara/fingerprints.lua +++ b/drivers/SmartThings/zigbee-switch/src/aqara/fingerprints.lua @@ -2,21 +2,22 @@ -- Licensed under the Apache License, Version 2.0 return { - { mfr = "LUMI", model = "lumi.plug.maeu01" }, - { mfr = "LUMI", model = "lumi.plug.macn01" }, - { mfr = "LUMI", model = "lumi.switch.n0agl1" }, - { mfr = "LUMI", model = "lumi.switch.l0agl1" }, - { mfr = "LUMI", model = "lumi.switch.n0acn2" }, - { mfr = "LUMI", model = "lumi.switch.n1acn1" }, - { mfr = "LUMI", model = "lumi.switch.n2acn1" }, - { mfr = "LUMI", model = "lumi.switch.n3acn1" }, - { mfr = "LUMI", model = "lumi.switch.b1laus01" }, - { mfr = "LUMI", model = "lumi.switch.b2laus01" }, - { mfr = "LUMI", model = "lumi.switch.n1aeu1" }, - { mfr = "LUMI", model = "lumi.switch.n2aeu1" }, - { mfr = "LUMI", model = "lumi.switch.l1aeu1" }, - { mfr = "LUMI", model = "lumi.switch.l2aeu1" }, - { mfr = "LUMI", model = "lumi.switch.b1nacn01" }, - { mfr = "LUMI", model = "lumi.switch.b2nacn01" }, - { mfr = "LUMI", model = "lumi.switch.b3n01" } - } + { mfr = "LUMI", model = "lumi.plug.maeu01" }, + { mfr = "LUMI", model = "lumi.plug.macn01" }, + { mfr = "LUMI", model = "lumi.switch.n0agl1" }, + { mfr = "LUMI", model = "lumi.switch.l0agl1" }, + { mfr = "LUMI", model = "lumi.switch.n0acn2" }, + { mfr = "LUMI", model = "lumi.switch.n1acn1" }, + { mfr = "LUMI", model = "lumi.switch.n2acn1" }, + { mfr = "LUMI", model = "lumi.switch.n3acn1" }, + { mfr = "LUMI", model = "lumi.switch.b1laus01" }, + { mfr = "LUMI", model = "lumi.switch.b2laus01" }, + { mfr = "LUMI", model = "lumi.switch.n1aeu1" }, + { mfr = "LUMI", model = "lumi.switch.n2aeu1" }, + { mfr = "LUMI", model = "lumi.switch.l1aeu1" }, + { mfr = "LUMI", model = "lumi.switch.l2aeu1" }, + { mfr = "LUMI", model = "lumi.switch.b1nacn01" }, + { mfr = "LUMI", model = "lumi.switch.b2nacn01" }, + { mfr = "LUMI", model = "lumi.switch.b3n01" }, + { mfr = "Aqara", model = "lumi.switch.acn047" } +} diff --git a/drivers/SmartThings/zigbee-switch/src/aqara/init.lua b/drivers/SmartThings/zigbee-switch/src/aqara/init.lua index 0c64b594fe..d3666a3dcb 100644 --- a/drivers/SmartThings/zigbee-switch/src/aqara/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/aqara/init.lua @@ -23,9 +23,31 @@ local CHANGE_TO_WIRELESS_SWITCH_ATTRIBUTE_ID = 0x0200 local RESTORE_TURN_OFF_INDICATOR_LIGHT_ATTRIBUTE_ID = 0x0203 local MAX_POWER_ATTRIBUTE_ID = 0x020B local ELECTRIC_SWITCH_TYPE_ATTRIBUTE_ID = 0x000A - +-- Aqara private cluster (0xFCC0) attributes used by the Dual Relay Module T2 (lumi.switch.acn047) +local DEVICE_MODE_ATTRIBUTE_ID = 0x0289 -- relay working mode (wet/dry contact, pulse), Uint8 0..3 +local INTERLOCK_ATTRIBUTE_ID = 0x02D0 -- interlock between the two relays, Boolean +local POWER_OFF_MEMORY_ATTRIBUTE_ID = 0x0517 -- power-off memory behavior, Uint8 (see powerOffMemory value_map) +local PULSE_INTERVAL_ATTRIBUTE_ID = 0x00EB -- pulse width in ms when running in pulse mode, Uint16 local LAST_REPORT_TIME = "LAST_REPORT_TIME" local PRIVATE_MODE = "PRIVATE_MODE" +-- "interlock" / "devicemode" are extra profile components on aqara-dual-relay-module-unified.yml. +-- The order of the SUPPORTED_* lists matches the raw device values (0-based), see the handlers below. +local COMPONENT_INTERLOCK = "interlock" +local SUPPORTED_INTERLOCK = { "normal", "interlock" } +local COMPONENT_DEVICE_MODE = "devicemode" +-- Relay working modes mapped to their raw device values. dry_contact_open_pulse_mode (raw 2) is +-- intentionally not exposed; the remaining modes keep their original device values (on_off stays 3). +-- This mode is not supported by the Aqara app and cannot be entered by the device, so it is omitted. +local DEVICE_MODE_TO_VALUE = { + wet_contact_mode = 0, + dry_contact_closed_pulse_mode = 1, + dry_contact_on_off_mode = 3, +} +local DEVICE_MODE_FROM_VALUE = { + [0] = "wet_contact_mode", + [1] = "dry_contact_closed_pulse_mode", + [3] = "dry_contact_on_off_mode", +} local preference_map = { ["stse.restorePowerState"] = { @@ -39,7 +61,7 @@ local preference_map = { attribute_id = CHANGE_TO_WIRELESS_SWITCH_ATTRIBUTE_ID, mfg_code = MFG_CODE, data_type = data_types.Uint8, - value_map = { [true] = 0x00,[false] = 0x01 }, + value_map = { [true] = 0x00, [false] = 0x01 }, }, ["stse.maxPower"] = { cluster_id = PRIVATE_CLUSTER_ID, @@ -112,26 +134,71 @@ local preference_map = { data_type = data_types.Uint8, value_map = { rocker = 0x01, rebound = 0x02 }, }, + -- External switch wiring type (same attribute as stse.electricSwitchType, with an extra "nc" + -- option): rocker = maintained, rebound/button = momentary, nc = external switch ignored (normally closed). + ["stse.switchType"] = { + cluster_id = PRIVATE_CLUSTER_ID, + attribute_id = ELECTRIC_SWITCH_TYPE_ATTRIBUTE_ID, + mfg_code = MFG_CODE, + data_type = data_types.Uint8, + value_map = { rocker = 0x01, rebound = 0x02, nc = 0x00 }, + }, ["stse.turnOffIndicatorLight"] = { cluster_id = PRIVATE_CLUSTER_ID, attribute_id = RESTORE_TURN_OFF_INDICATOR_LIGHT_ATTRIBUTE_ID, mfg_code = MFG_CODE, data_type = data_types.Boolean, }, + ["stse.powerOffMemory"] = { + cluster_id = PRIVATE_CLUSTER_ID, + attribute_id = POWER_OFF_MEMORY_ATTRIBUTE_ID, + mfg_code = MFG_CODE, + data_type = data_types.Uint8, + value_map = { restore = 0x01, on = 0x00, off = 0x02, reverse = 0x03 }, + }, + ["stse.pulseIntervalSetting"] = { + cluster_id = PRIVATE_CLUSTER_ID, + attribute_id = PULSE_INTERVAL_ATTRIBUTE_ID, + mfg_code = MFG_CODE, + data_type = data_types.Uint16, + coerce_number = true, + } } - +-- Handles reports of the private-mode attribute. Caches the current private-mode state and, when the +-- device is not yet in private mode, forces it into private mode and configures energy reporting. +-- acn047 is excluded from being forced into private mode (it stays on standard clusters). local function private_mode_handler(driver, device, value, zb_rx) device:set_field(PRIVATE_MODE, value.value, { persist = true }) if value.value ~= 1 then - device:send(cluster_base.write_manufacturer_specific_attribute(device, - PRIVATE_CLUSTER_ID, PRIVATE_ATTRIBUTE_ID, MFG_CODE, data_types.Uint8, 0x01)) -- private + if device:get_model() ~= "lumi.switch.acn047" then + device:send(cluster_base.write_manufacturer_specific_attribute(device, PRIVATE_CLUSTER_ID, PRIVATE_ATTRIBUTE_ID, MFG_CODE, data_types.Uint8, 0x01)) -- private + end device:send(SimpleMetering.attributes.CurrentSummationDelivered:configure_reporting(device, 900, 3600, 1)) -- minimal interval : 15min device:set_field(constants.ELECTRICAL_MEASUREMENT_DIVISOR_KEY, 10, { persist = true }) device:set_field(constants.SIMPLE_METERING_DIVISOR_KEY, 1000, { persist = true }) end end +-- Reflect the device's interlock state onto the "interlock" component. +-- value.value is a Boolean; +1 converts the 0/1 state into a Lua (1-based) list index. +local function interlock_switch_handler(driver, device, value, zb_rx) + local component = device.profile.components[COMPONENT_INTERLOCK] + if component == nil then return end + local cur_state = 0 + if value.value then cur_state = 1 end + device:emit_component_event(component, capabilities.mode.mode(SUPPORTED_INTERLOCK[cur_state + 1])) +end +-- Reflect the relay working mode onto the "devicemode" component. +-- value.value is the raw device value; only emit for modes we expose (open_pulse is ignored). +local function device_mode_handler(driver, device, value, zb_rx) + local component = device.profile.components[COMPONENT_DEVICE_MODE] + if component == nil then return end + local mode = DEVICE_MODE_FROM_VALUE[value.value] + if mode ~= nil then + device:emit_component_event(component, capabilities.mode.mode(mode)) + end +end local function wireless_switch_handler(driver, device, value, zb_rx) if value.value == 1 then @@ -151,7 +218,7 @@ local function energy_meter_power_consumption_report(driver, device, value, zb_r if raw_value < offset then --- somehow our value has gone below the offset, so we'll reset the offset, since the device seems to have offset = 0 - device:set_field(constants.ENERGY_METER_OFFSET, offset, {persist = true}) + device:set_field(constants.ENERGY_METER_OFFSET, offset, { persist = true }) end device:emit_event(capabilities.energyMeter.energy({ value = raw_value - offset, unit = "Wh" })) @@ -166,8 +233,7 @@ local function energy_meter_power_consumption_report(driver, device, value, zb_r -- power consumption report local delta_energy = 0.0 - local current_power_consumption = device:get_latest_state("main", capabilities.powerConsumptionReport.ID, - capabilities.powerConsumptionReport.powerConsumption.NAME) + local current_power_consumption = device:get_latest_state("main", capabilities.powerConsumptionReport.ID, capabilities.powerConsumptionReport.powerConsumption.NAME) if current_power_consumption ~= nil then delta_energy = math.max(raw_value - current_power_consumption.energy, 0.0) end @@ -184,14 +250,40 @@ local function power_meter_handler(driver, device, value, zb_rx) device:emit_event(capabilities.powerMeter.power({ value = raw_value, unit = "W" })) end +-- setMode command handler shared by the "interlock" and "devicemode" components. +-- The target component is used to decide which private-cluster attribute to write. +local function mode_handler(driver, device, command) + if command.component == COMPONENT_INTERLOCK then + -- interlock attribute is a Boolean: true = relays interlocked, false = independent + local interlock_mode = false + if command.args.mode == SUPPORTED_INTERLOCK[2] then interlock_mode = true end + device:send(cluster_base.write_manufacturer_specific_attribute(device, PRIVATE_CLUSTER_ID, INTERLOCK_ATTRIBUTE_ID, MFG_CODE, data_types.Boolean, interlock_mode)) + elseif command.component == COMPONENT_DEVICE_MODE then + -- map the selected mode string to its raw device value + local device_mode = DEVICE_MODE_TO_VALUE[command.args.mode] + if device_mode ~= nil then + device:send(cluster_base.write_manufacturer_specific_attribute(device, PRIVATE_CLUSTER_ID, DEVICE_MODE_ATTRIBUTE_ID, MFG_CODE, data_types.Uint8, device_mode)) + end + end +end +-- Read back switch state, power/energy (standard clusters) and, when present, the interlock and +-- device-mode private attributes. local function do_refresh(self, device) device:send(OnOff.attributes.OnOff:read(device)) if (device:supports_capability_by_id(capabilities.powerMeter.ID)) then device:send(ElectricalMeasurement.attributes.ActivePower:read(device)) device:send(SimpleMetering.attributes.CurrentSummationDelivered:read(device)) end + if device.profile.components[COMPONENT_INTERLOCK] then + device:send(cluster_base.read_manufacturer_specific_attribute(device, PRIVATE_CLUSTER_ID, INTERLOCK_ATTRIBUTE_ID, MFG_CODE)) + end + if device.profile.components[COMPONENT_DEVICE_MODE] then + device:send(cluster_base.read_manufacturer_specific_attribute(device, PRIVATE_CLUSTER_ID, DEVICE_MODE_ATTRIBUTE_ID, MFG_CODE)) + end end +-- On preference change, write any preference whose value changed to its mapped private-cluster +-- attribute (see preference_map). value_map translates enum strings; value_type coerces numbers. local function device_info_changed(driver, device, event, args) local preferences = device.preferences local old_preferences = args.old_st_store.preferences @@ -203,28 +295,36 @@ local function device_info_changed(driver, device, event, args) if attr.value_map ~= nil then value = attr.value_map[value] end - device:send(cluster_base.write_manufacturer_specific_attribute(device, attr.cluster_id, attr.attribute_id, - attr.mfg_code, attr.data_type, value)) + -- numeric preferences (e.g. pulseInterval) are coerced to a Lua number before being written + if attr.coerce_number ~= nil and attr.coerce_number then + value = tonumber(value) + end + device:send(cluster_base.write_manufacturer_specific_attribute(device, attr.cluster_id, attr.attribute_id, attr.mfg_code, attr.data_type, value)) end end end end +-- Standard configuration: bind/report standard clusters, read the private-mode attribute, clear any +-- groups (required by these devices) and refresh current state. local function do_configure(self, device) device:configure() - device:send(cluster_base.read_manufacturer_specific_attribute(device, - PRIVATE_CLUSTER_ID, PRIVATE_ATTRIBUTE_ID, MFG_CODE)) + device:send(cluster_base.read_manufacturer_specific_attribute(device, PRIVATE_CLUSTER_ID, PRIVATE_ATTRIBUTE_ID, MFG_CODE)) device:send(Groups.server.commands.RemoveAllGroups(device)) -- required do_refresh(self, device) end +-- On add, advertise supported button values and restore the last known power/energy (so the values +-- are not blanked to 0 on re-add). local function device_added(driver, device) if (device:supports_capability_by_id(capabilities.button.ID)) then device:emit_event(capabilities.button.supportedButtonValues({ "pushed" }, { visibility = { displayed = false } })) end if (device:supports_capability_by_id(capabilities.powerMeter.ID)) then - device:emit_event(capabilities.powerMeter.power({ value = 0.0, unit = "W" })) - device:emit_event(capabilities.energyMeter.energy({ value = 0.0, unit = "Wh" })) + local lastPower = device:get_latest_state("main", capabilities.powerMeter.ID, capabilities.powerMeter.power.NAME) or 0.0 + local lastEnergy = device:get_latest_state("main", capabilities.energyMeter.ID, capabilities.energyMeter.energy.NAME) or 0.0 + device:emit_event(capabilities.powerMeter.power({ value = lastPower, unit = "W" })) + device:emit_event(capabilities.energyMeter.energy({ value = lastEnergy, unit = "Wh" })) end end @@ -236,6 +336,9 @@ local aqara_switch_handler = { infoChanged = device_info_changed }, capability_handlers = { + [capabilities.mode.ID] = { + [capabilities.mode.commands.setMode.NAME] = mode_handler + }, [capabilities.refresh.ID] = { [capabilities.refresh.commands.refresh.NAME] = do_refresh } @@ -252,7 +355,9 @@ local aqara_switch_handler = { [WIRELESS_SWITCH_ATTRIBUTE_ID] = wireless_switch_handler }, [PRIVATE_CLUSTER_ID] = { - [PRIVATE_ATTRIBUTE_ID] = private_mode_handler + [PRIVATE_ATTRIBUTE_ID] = private_mode_handler, + [INTERLOCK_ATTRIBUTE_ID] = interlock_switch_handler, + [DEVICE_MODE_ATTRIBUTE_ID] = device_mode_handler } } }, diff --git a/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/can_handle.lua index 1524296cff..16d61cfbbf 100644 --- a/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/can_handle.lua @@ -1,6 +1,8 @@ -- Copyright 2025 SmartThings, Inc. -- Licensed under the Apache License, Version 2.0 +-- Matches multi-endpoint Aqara switches/modules listed in aqara/multi-switch/fingerprints.lua +-- (devices that create child devices for their extra switch endpoints). return function(opts, driver, device) local FINGERPRINTS = require("aqara.multi-switch.fingerprints") for _, fingerprint in ipairs(FINGERPRINTS) do diff --git a/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/fingerprints.lua b/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/fingerprints.lua index 71ed1b26b3..22887a7e88 100644 --- a/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/fingerprints.lua +++ b/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/fingerprints.lua @@ -2,13 +2,14 @@ -- Licensed under the Apache License, Version 2.0 return { - { mfr = "LUMI", model = "lumi.switch.n1acn1", children = 1, child_profile = "" }, - { mfr = "LUMI", model = "lumi.switch.n2acn1", children = 2, child_profile = "aqara-switch-child" }, - { mfr = "LUMI", model = "lumi.switch.n3acn1", children = 3, child_profile = "aqara-switch-child" }, - { mfr = "LUMI", model = "lumi.switch.b1laus01", children = 1, child_profile = "" }, - { mfr = "LUMI", model = "lumi.switch.b2laus01", children = 2, child_profile = "aqara-switch-child" }, - { mfr = "LUMI", model = "lumi.switch.l2aeu1", children = 2, child_profile = "aqara-switch-child" }, - { mfr = "LUMI", model = "lumi.switch.n2aeu1", children = 2, child_profile = "aqara-switch-child" }, - { mfr = "LUMI", model = "lumi.switch.b2nacn01", children = 2, child_profile = "aqara-switch-child" }, - { mfr = "LUMI", model = "lumi.switch.b3n01", children = 3, child_profile = "aqara-switch-child" } + { mfr = "LUMI", model = "lumi.switch.n1acn1", children = 1, child_profile = "" }, + { mfr = "LUMI", model = "lumi.switch.n2acn1", children = 2, child_profile = "aqara-switch-child" }, + { mfr = "LUMI", model = "lumi.switch.n3acn1", children = 3, child_profile = "aqara-switch-child" }, + { mfr = "LUMI", model = "lumi.switch.b1laus01", children = 1, child_profile = "" }, + { mfr = "LUMI", model = "lumi.switch.b2laus01", children = 2, child_profile = "aqara-switch-child" }, + { mfr = "LUMI", model = "lumi.switch.l2aeu1", children = 2, child_profile = "aqara-switch-child" }, + { mfr = "LUMI", model = "lumi.switch.n2aeu1", children = 2, child_profile = "aqara-switch-child" }, + { mfr = "LUMI", model = "lumi.switch.b2nacn01", children = 2, child_profile = "aqara-switch-child" }, + { mfr = "LUMI", model = "lumi.switch.b3n01", children = 3, child_profile = "aqara-switch-child" }, + { mfr = "Aqara", model = "lumi.switch.acn047", children = 2, child_profile = "aqara-switch-child" } } diff --git a/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/init.lua b/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/init.lua index 4b2146f03c..07022c0b67 100644 --- a/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/init.lua @@ -11,8 +11,13 @@ local switch_utils = require "switch_utils" local PRIVATE_CLUSTER_ID = 0xFCC0 local PRIVATE_ATTRIBUTE_ID = 0x0009 local MFG_CODE = 0x115F +local COMPONENT_INTERLOCK = "interlock" +local SUPPORTED_INTERLOCK = { "normal", "interlock" } +local COMPONENT_DEVICE_MODE = "devicemode" +local SUPPORTED_DEVICE_MODE = { "wet_contact_mode", "dry_contact_closed_pulse_mode", "dry_contact_on_off_mode" } local FINGERPRINTS = require("aqara.multi-switch.fingerprints") +-- Number of switch endpoints (parent + children) for this model, from the fingerprint table. local function get_children_amount(device) for _, fingerprint in ipairs(FINGERPRINTS) do if device:get_model() == fingerprint.model then @@ -21,6 +26,7 @@ local function get_children_amount(device) end end +-- Profile name to assign to the created child devices for this model. local function get_child_profile_name(device) for _, fingerprint in ipairs(FINGERPRINTS) do if device:get_model() == fingerprint.model then @@ -37,6 +43,7 @@ local function find_child(parent, ep_id) return parent:get_child_by_parent_assigned_key(string.format("%02X", ep_id)) end +-- Create one EDGE_CHILD device per extra switch endpoint and initialize parent-only state. local function device_added(driver, device) -- Only create children for the actual Zigbee device and not the children if device.network_type == device_lib.NETWORK_TYPE_ZIGBEE then @@ -60,22 +67,36 @@ local function device_added(driver, device) end -- for wireless button - device:emit_event(capabilities.button.numberOfButtons({ value = children_amount }, - { visibility = { displayed = false } })) - device:emit_event(capabilities.powerMeter.power({ value = 0.0, unit = "W" })) - device:emit_event(capabilities.energyMeter.energy({ value = 0.0, unit = "Wh" })) + device:emit_event(capabilities.button.numberOfButtons({ value = children_amount }, { visibility = { displayed = false } })) - device:send(cluster_base.write_manufacturer_specific_attribute(device, - PRIVATE_CLUSTER_ID, PRIVATE_ATTRIBUTE_ID, MFG_CODE, data_types.Uint8, 0x01)) -- private + -- report the static supported modes for the interlock / devicemode components (when present) + if device.profile.components[COMPONENT_INTERLOCK] then + device:emit_component_event(device.profile.components[COMPONENT_INTERLOCK], capabilities.mode.supportedModes(SUPPORTED_INTERLOCK, { visibility = { displayed = false } })) + end + if device.profile.components[COMPONENT_DEVICE_MODE] then + device:emit_component_event(device.profile.components[COMPONENT_DEVICE_MODE], capabilities.mode.supportedModes(SUPPORTED_DEVICE_MODE, { visibility = { displayed = false } })) + end + + -- acn047 (Dual Relay Module T2) must not be forced into Aqara private mode; all other + -- multi-switch models are switched into private mode here. + if device:get_model() ~= "lumi.switch.acn047" then + device:send(cluster_base.write_manufacturer_specific_attribute(device, PRIVATE_CLUSTER_ID, PRIVATE_ATTRIBUTE_ID, MFG_CODE, data_types.Uint8, 0x01)) -- private + end elseif device.network_type == "DEVICE_EDGE_CHILD" then - device:emit_event(capabilities.button.numberOfButtons({ value = 1 }, - { visibility = { displayed = false } })) + device:emit_event(capabilities.button.numberOfButtons({ value = 1 }, { visibility = { displayed = false } })) + end + device:emit_event(capabilities.button.supportedButtonValues({ "pushed" }, { visibility = { displayed = false } })) + switch_utils.emit_event_if_latest_state_missing(device, "main", capabilities.button, capabilities.button.button.NAME, capabilities.button.button.pushed({ state_change = false })) + -- restore the last known power/energy (instead of resetting to 0) so values survive re-adds + if (device:supports_capability_by_id(capabilities.powerMeter.ID)) then + local lastPower = device:get_latest_state("main", capabilities.powerMeter.ID, capabilities.powerMeter.power.NAME) or 0.0 + local lastEnergy = device:get_latest_state("main", capabilities.energyMeter.ID, capabilities.energyMeter.energy.NAME) or 0.0 + device:emit_event(capabilities.powerMeter.power({ value = lastPower, unit = "W" })) + device:emit_event(capabilities.energyMeter.energy({ value = lastEnergy, unit = "Wh" })) end - device:emit_event(capabilities.button.supportedButtonValues({ "pushed" }, - { visibility = { displayed = false } })) - switch_utils.emit_event_if_latest_state_missing(device, "main", capabilities.button, capabilities.button.button.NAME, capabilities.button.button.pushed({state_change = false})) end +-- Register the endpoint->child routing function so reports from child endpoints reach the children. local function device_init(self, device) -- for multiple switch if device.network_type == device_lib.NETWORK_TYPE_ZIGBEE then diff --git a/drivers/SmartThings/zigbee-switch/src/inovelli/init.lua b/drivers/SmartThings/zigbee-switch/src/inovelli/init.lua index a83a343663..97cd33e821 100644 --- a/drivers/SmartThings/zigbee-switch/src/inovelli/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/inovelli/init.lua @@ -258,11 +258,11 @@ local function huePercentToValue(value) else return utils.round(value / 100 * 255) end end -local function getNotificationValue(device, value) +local function getNotificationValue(device, parent, value) local notificationValue = 0 local level = device:get_latest_state("main", capabilities.switchLevel.ID, capabilities.switchLevel.level.NAME) or 100 local color = utils.round(device:get_latest_state("main", capabilities.colorControl.ID, capabilities.colorControl.hue.NAME) or 100) - local effect = device:get_parent_device().preferences.notificationType or 1 + local effect = (parent and parent.preferences.notificationType) or 1 notificationValue = notificationValue + (effect*16777216) notificationValue = notificationValue + (huePercentToValue(value or color)*65536) notificationValue = notificationValue + (level*256) @@ -276,13 +276,16 @@ local function on_handler(driver, device, command) else device:emit_event(capabilities.switch.switch("on")) local dev = device:get_parent_device() + if dev == nil then + return + end local send_configuration = function() dev:send(cluster_base.build_manufacturer_specific_command( dev, PRIVATE_CLUSTER_ID, PRIVATE_CMD_NOTIF_ID, MFG_CODE, - utils.serialize_int(getNotificationValue(device),4,false,false))) + utils.serialize_int(getNotificationValue(device, dev),4,false,false))) end device.thread:call_with_delay(1,send_configuration) end @@ -294,6 +297,9 @@ local function on_handler(driver, device, command) else device:emit_event(capabilities.switch.switch("off")) local dev = device:get_parent_device() + if dev == nil then + return + end local send_configuration = function() dev:send(cluster_base.build_manufacturer_specific_command( dev, @@ -313,13 +319,16 @@ local function switch_level_handler(driver, device, command) device:emit_event(capabilities.switchLevel.level(command.args.level)) device:emit_event(capabilities.switch.switch(command.args.level ~= 0 and "on" or "off")) local dev = device:get_parent_device() + if dev == nil then + return + end local send_configuration = function() dev:send(cluster_base.build_manufacturer_specific_command( dev, PRIVATE_CLUSTER_ID, PRIVATE_CMD_NOTIF_ID, MFG_CODE, - utils.serialize_int(getNotificationValue(device),4,false,false))) + utils.serialize_int(getNotificationValue(device, dev),4,false,false))) end device.thread:call_with_delay(1,send_configuration) end @@ -330,13 +339,16 @@ local function set_color_temperature(driver, device, command) device:emit_event(capabilities.colorTemperature.colorTemperature(command.args.temperature)) device:emit_event(capabilities.switch.switch("on")) local dev = device:get_parent_device() + if dev == nil then + return + end local send_configuration = function() dev:send(cluster_base.build_manufacturer_specific_command( dev, PRIVATE_CLUSTER_ID, PRIVATE_CMD_NOTIF_ID, MFG_CODE, - utils.serialize_int(getNotificationValue(device, 100),4,false,false))) + utils.serialize_int(getNotificationValue(device, dev, 100),4,false,false))) end device.thread:call_with_delay(1,send_configuration) end @@ -346,13 +358,16 @@ local function set_color_temperature(driver, device, command) device:emit_event(capabilities.colorControl.saturation(command.args.color.saturation)) device:emit_event(capabilities.switch.switch("on")) local dev = device:get_parent_device() + if dev == nil then + return + end local send_configuration = function() dev:send(cluster_base.build_manufacturer_specific_command( dev, PRIVATE_CLUSTER_ID, PRIVATE_CMD_NOTIF_ID, MFG_CODE, - utils.serialize_int(getNotificationValue(device),4,false,false))) + utils.serialize_int(getNotificationValue(device, dev),4,false,false))) end device.thread:call_with_delay(1,send_configuration) end diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_all_capability_zigbee_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_all_capability_zigbee_bulb.lua index 8826ca535d..1332185693 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_all_capability_zigbee_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_all_capability_zigbee_bulb.lua @@ -103,7 +103,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -131,7 +131,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -159,7 +159,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -188,7 +188,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -216,7 +216,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -236,7 +236,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -593,7 +593,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17, + min_api_version = 15, max_api_version = 19 } ) @@ -790,7 +790,7 @@ test.register_coroutine_test( test_init = function() -- no op to override auto device add on startup end, - min_api_version = 17 + min_api_version = 14 } ) @@ -818,7 +818,7 @@ test.register_coroutine_test( test_init = function() -- no op to override auto device add on startup end, - min_api_version = 17 + min_api_version = 14 } ) @@ -845,7 +845,7 @@ test.register_coroutine_test( test_init = function() -- no op to override auto device add on startup end, - min_api_version = 17 + min_api_version = 14 } ) @@ -872,7 +872,7 @@ test.register_coroutine_test( test_init = function() -- no op to override auto device add on startup end, - min_api_version = 17 + min_api_version = 14 } ) @@ -909,7 +909,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({mock_device.id, ColorControl.attributes.CurrentSaturation:read(mock_device)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -928,7 +928,7 @@ test.register_coroutine_test( mock_device:expect_native_attr_handler_registration("colorTemperature", "colorTemperature") end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -962,7 +962,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.energyMeter.energy({ value = 14.0, unit = "kWh" }))) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_dual_relay_module.lua b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_dual_relay_module.lua new file mode 100644 index 0000000000..3dd95f7bb1 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_dual_relay_module.lua @@ -0,0 +1,268 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + +local test = require "integration_test" +local t_utils = require "integration_test.utils" +local clusters = require "st.zigbee.zcl.clusters" +local cluster_base = require "st.zigbee.cluster_base" +local data_types = require "st.zigbee.data_types" +local capabilities = require "st.capabilities" +local zigbee_test_utils = require "integration_test.zigbee_test_utils" + +local OnOff = clusters.OnOff +local ElectricalMeasurement = clusters.ElectricalMeasurement +local SimpleMetering = clusters.SimpleMetering + +local PRIVATE_CLUSTER_ID = 0xFCC0 +local MFG_CODE = 0x115F +local INTERLOCK_ATTRIBUTE_ID = 0x02D0 +local DEVICE_MODE_ATTRIBUTE_ID = 0x0289 +local POWER_OFF_MEMORY_ATTRIBUTE_ID = 0x0517 +local PULSE_INTERVAL_ATTRIBUTE_ID = 0x00EB +local ELECTRIC_SWITCH_TYPE_ATTRIBUTE_ID = 0x000A +local CHANGE_TO_WIRELESS_SWITCH_ATTRIBUTE_ID = 0x0200 + +local PRIVATE_MODE = "PRIVATE_MODE" + +local SUPPORTED_INTERLOCK = { "normal", "interlock" } +local SUPPORTED_DEVICE_MODE = { "wet_contact_mode", "dry_contact_closed_pulse_mode", "dry_contact_on_off_mode" } + +-- acn047 (Dual Relay Module T2) runs on standard clusters (never Aqara private mode) +local mock_device = test.mock_device.build_test_zigbee_device( + { + profile = t_utils.get_profile_definition("aqara-dual-relay-module-unified.yml"), + fingerprinted_endpoint_id = 0x01, + zigbee_endpoints = { + [1] = { + id = 1, + manufacturer = "Aqara", + model = "lumi.switch.acn047", + server_clusters = { OnOff.ID, ElectricalMeasurement.ID, SimpleMetering.ID } + } + } + } +) + +-- acn047 reports children = 2, so a single child device (relay 2) exists on the second endpoint +local mock_child = test.mock_device.build_test_child_device({ + profile = t_utils.get_profile_definition("aqara-switch-child.yml"), + device_network_id = string.format("%04X:%02X", mock_device:get_short_address(), 2), + parent_device_id = mock_device.id, + parent_assigned_child_key = string.format("%02X", 2) +}) + +zigbee_test_utils.prepare_zigbee_env_info() + +local function test_init() + test.mock_device.add_test_device(mock_device) + test.mock_device.add_test_device(mock_child) +end + +test.set_test_init_function(test_init) + +test.register_coroutine_test( + "added: child is reused, button info reported, power/energy restored (0.0 on first add) and no private write", + function() + test.socket.zigbee:__set_channel_ordering("relaxed") + test.socket.device_lifecycle:__queue_receive({ mock_device.id, "added" }) + test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.button.numberOfButtons({ value = 2 }, + { visibility = { displayed = false } }))) + test.socket.capability:__expect_send(mock_device:generate_test_message("interlock", + capabilities.mode.supportedModes(SUPPORTED_INTERLOCK, { visibility = { displayed = false } }))) + test.socket.capability:__expect_send(mock_device:generate_test_message("devicemode", + capabilities.mode.supportedModes(SUPPORTED_DEVICE_MODE, { visibility = { displayed = false } }))) + test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.button.supportedButtonValues({ "pushed" }, + { visibility = { displayed = false } }))) + test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.button.button.pushed({ state_change = false }))) + test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.powerMeter.power({ value = 0.0, unit = "W" }))) + test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.energyMeter.energy({ value = 0.0, unit = "Wh" }))) + end, + { + min_api_version = 17 + } +) + +test.register_coroutine_test( + "refresh reads OnOff, power/energy (standard clusters) and the interlock/devicemode attributes", + function() + test.socket.zigbee:__set_channel_ordering("relaxed") + test.socket.capability:__queue_receive({ mock_device.id, + { capability = "refresh", component = "main", command = "refresh", args = {} } }) + test.socket.zigbee:__expect_send({ mock_device.id, OnOff.attributes.OnOff:read(mock_device) }) + test.socket.zigbee:__expect_send({ mock_device.id, ElectricalMeasurement.attributes.ActivePower:read(mock_device) }) + test.socket.zigbee:__expect_send({ mock_device.id, SimpleMetering.attributes.CurrentSummationDelivered:read(mock_device) }) + test.socket.zigbee:__expect_send({ mock_device.id, + cluster_base.read_manufacturer_specific_attribute(mock_device, PRIVATE_CLUSTER_ID, INTERLOCK_ATTRIBUTE_ID, MFG_CODE) }) + test.socket.zigbee:__expect_send({ mock_device.id, + cluster_base.read_manufacturer_specific_attribute(mock_device, PRIVATE_CLUSTER_ID, DEVICE_MODE_ATTRIBUTE_ID, MFG_CODE) }) + end, + { + min_api_version = 17 + } +) + +test.register_coroutine_test( + "switch on command : parent device", + function() + test.socket.capability:__queue_receive({ mock_device.id, + { capability = "switch", component = "main", command = "on", args = {} } }) + test.socket.zigbee:__expect_send({ mock_device.id, OnOff.server.commands.On(mock_device) }) + end, + { + min_api_version = 17 + } +) + +test.register_coroutine_test( + "switch off command : child device (endpoint 2)", + function() + test.socket.capability:__queue_receive({ mock_child.id, + { capability = "switch", component = "main", command = "off", args = {} } }) + mock_child:expect_native_cmd_handler_registration("switch", "off") + test.socket.zigbee:__expect_send({ mock_device.id, OnOff.server.commands.Off(mock_device):to_endpoint(0x02) }) + end, + { + min_api_version = 17 + } +) + +test.register_coroutine_test( + "power meter report (standard ElectricalMeasurement cluster)", + function() + mock_device:set_field(PRIVATE_MODE, 0, { persist = true }) + test.socket.zigbee:__queue_receive({ + mock_device.id, + ElectricalMeasurement.attributes.ActivePower:build_test_attr_report(mock_device, 100) + }) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.powerMeter.power({ value = 10.0, unit = "W" })) + ) + end, + { + min_api_version = 17 + } +) + +test.register_coroutine_test( + "interlock attribute report updates the interlock component", + function() + test.socket.zigbee:__queue_receive({ + mock_device.id, + zigbee_test_utils.build_attribute_report(mock_device, PRIVATE_CLUSTER_ID, { + { INTERLOCK_ATTRIBUTE_ID, data_types.Boolean.ID, true } + }, MFG_CODE) + }) + test.socket.capability:__expect_send(mock_device:generate_test_message("interlock", + capabilities.mode.mode("interlock"))) + end, + { + min_api_version = 17 + } +) + +test.register_coroutine_test( + "device mode attribute report updates the devicemode component", + function() + test.socket.zigbee:__queue_receive({ + mock_device.id, + zigbee_test_utils.build_attribute_report(mock_device, PRIVATE_CLUSTER_ID, { + { DEVICE_MODE_ATTRIBUTE_ID, data_types.Uint8.ID, 1 } + }, MFG_CODE) + }) + test.socket.capability:__expect_send(mock_device:generate_test_message("devicemode", + capabilities.mode.mode("dry_contact_closed_pulse_mode"))) + end, + { + min_api_version = 17 + } +) + +test.register_coroutine_test( + "setMode on the interlock component writes the interlock attribute", + function() + test.socket.capability:__queue_receive({ mock_device.id, + { capability = "mode", component = "interlock", command = "setMode", args = { "interlock" } } }) + test.socket.zigbee:__expect_send({ mock_device.id, + cluster_base.write_manufacturer_specific_attribute(mock_device, PRIVATE_CLUSTER_ID, INTERLOCK_ATTRIBUTE_ID, + MFG_CODE, data_types.Boolean, true) }) + end, + { + min_api_version = 17 + } +) + +test.register_coroutine_test( + "setMode on the devicemode component (on/off) writes device value 3", + function() + test.socket.capability:__queue_receive({ mock_device.id, + { capability = "mode", component = "devicemode", command = "setMode", args = { "dry_contact_on_off_mode" } } }) + test.socket.zigbee:__expect_send({ mock_device.id, + cluster_base.write_manufacturer_specific_attribute(mock_device, PRIVATE_CLUSTER_ID, DEVICE_MODE_ATTRIBUTE_ID, + MFG_CODE, data_types.Uint8, 3) }) + end, + { + min_api_version = 17 + } +) + +test.register_coroutine_test( + "preference powerOffMemory is written on infochanged", + function() + test.socket.device_lifecycle:__queue_receive(mock_device:generate_info_changed({ + preferences = { ["stse.powerOffMemory"] = "on" } + })) + test.socket.zigbee:__expect_send({ mock_device.id, + cluster_base.write_manufacturer_specific_attribute(mock_device, PRIVATE_CLUSTER_ID, + POWER_OFF_MEMORY_ATTRIBUTE_ID, MFG_CODE, data_types.Uint8, 0) }) + end, + { + min_api_version = 17 + } +) + +test.register_coroutine_test( + "preference pulseInterval is written on infochanged", + function() + test.socket.device_lifecycle:__queue_receive(mock_device:generate_info_changed({ + preferences = { ["stse.pulseIntervalSetting"] = 500 } + })) + test.socket.zigbee:__expect_send({ mock_device.id, + cluster_base.write_manufacturer_specific_attribute(mock_device, PRIVATE_CLUSTER_ID, + PULSE_INTERVAL_ATTRIBUTE_ID, MFG_CODE, data_types.Uint16, 500) }) + end, + { + min_api_version = 17 + } +) + +test.register_coroutine_test( + "preference switchType (nc) is written on infochanged", + function() + test.socket.device_lifecycle:__queue_receive(mock_device:generate_info_changed({ + preferences = { ["stse.switchType"] = "nc" } + })) + test.socket.zigbee:__expect_send({ mock_device.id, + cluster_base.write_manufacturer_specific_attribute(mock_device, PRIVATE_CLUSTER_ID, + ELECTRIC_SWITCH_TYPE_ATTRIBUTE_ID, MFG_CODE, data_types.Uint8, 0) }) + end, + { + min_api_version = 17 + } +) + +test.register_coroutine_test( + "preference changeToWirelessSwitch is written on infochanged", + function() + test.socket.device_lifecycle:__queue_receive(mock_device:generate_info_changed({ + preferences = { ["stse.changeToWirelessSwitch"] = true } + })) + test.socket.zigbee:__expect_send({ mock_device.id, + cluster_base.write_manufacturer_specific_attribute(mock_device, PRIVATE_CLUSTER_ID, + CHANGE_TO_WIRELESS_SWITCH_ATTRIBUTE_ID, MFG_CODE, data_types.Uint8, 0) }) + end, + { + min_api_version = 17 + } +) + +test.run_registered_tests() diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_led_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_led_bulb.lua index cc3e86d218..f1dc9e1ea4 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_led_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_led_bulb.lua @@ -54,7 +54,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.colorTemperature.colorTemperatureRange({ minimum = 2700, maximum = 6000 }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -109,7 +109,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17, + min_api_version = 14, max_api_version = 19 } ) @@ -204,7 +204,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -219,7 +219,7 @@ test.register_coroutine_test( RESTORE_POWER_STATE_ATTRIBUTE_ID, MFG_CODE, data_types.Boolean, true) }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_light.lua b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_light.lua index a80bf1dcfc..16ceec4e24 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_light.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_light.lua @@ -56,7 +56,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.colorTemperature.colorTemperatureRange({ minimum = 2700, maximum = 6000 }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -183,7 +183,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17, + min_api_version = 14, max_api_version = 19 } ) @@ -211,7 +211,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -226,7 +226,7 @@ test.register_coroutine_test( RESTORE_POWER_STATE_ATTRIBUTE_ID, MFG_CODE, data_types.Boolean, true) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -241,7 +241,7 @@ test.register_coroutine_test( TURN_OFF_INDICATOR_ATTRIBUTE_ID, MFG_CODE, data_types.Boolean, true) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -254,7 +254,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.OnTransitionTime:write(mock_device, 10) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -267,7 +267,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.OffTransitionTime:write(mock_device, 10) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -302,7 +302,7 @@ test.register_coroutine_test( test_init = function() test.mock_device.add_test_device(mock_device_cwacn1) end, - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_smart_plug.lua b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_smart_plug.lua index 6e8ddba455..cffacc4451 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_smart_plug.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_smart_plug.lua @@ -78,7 +78,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -120,7 +120,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -139,7 +139,7 @@ test.register_coroutine_test( AnalogInput.attributes.PresentValue:read(mock_device):to_endpoint(ENERGY_METER_ENDPOINT) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -156,7 +156,7 @@ test.register_coroutine_test( AnalogInput.attributes.PresentValue:read(mock_device):to_endpoint(POWER_METER_ENDPOINT) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -173,7 +173,7 @@ test.register_coroutine_test( AnalogInput.attributes.PresentValue:read(mock_device):to_endpoint(POWER_METER_ENDPOINT) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -187,7 +187,7 @@ test.register_coroutine_test( OnOff.server.commands.On(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -201,7 +201,7 @@ test.register_coroutine_test( OnOff.server.commands.Off(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -223,7 +223,7 @@ test.register_coroutine_test( AnalogInput.attributes.PresentValue:read(mock_device):to_endpoint(ENERGY_METER_ENDPOINT) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -258,7 +258,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -273,7 +273,7 @@ test.register_coroutine_test( RESTORE_POWER_STATE_ATTRIBUTE_ID, MFG_CODE, data_types.Boolean, true) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -288,7 +288,7 @@ test.register_coroutine_test( MFG_CODE, data_types.SinglePrecisionFloat, SinglePrecisionFloat(0, 6, 0.5625)) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -317,7 +317,7 @@ test.register_coroutine_test( SimpleMetering.attributes.CurrentSummationDelivered:read(mock_standard) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -343,7 +343,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -368,7 +368,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_smart_plug_t1.lua b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_smart_plug_t1.lua index 9476f41345..21c697ed1c 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_smart_plug_t1.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_smart_plug_t1.lua @@ -79,7 +79,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -121,7 +121,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -140,7 +140,7 @@ test.register_coroutine_test( AnalogInput.attributes.PresentValue:read(mock_device):to_endpoint(ENERGY_METER_ENDPOINT) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -157,7 +157,7 @@ test.register_coroutine_test( AnalogInput.attributes.PresentValue:read(mock_device):to_endpoint(POWER_METER_ENDPOINT) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -174,7 +174,7 @@ test.register_coroutine_test( AnalogInput.attributes.PresentValue:read(mock_device):to_endpoint(POWER_METER_ENDPOINT) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -188,7 +188,7 @@ test.register_coroutine_test( OnOff.server.commands.On(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -202,7 +202,7 @@ test.register_coroutine_test( OnOff.server.commands.Off(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -224,7 +224,7 @@ test.register_coroutine_test( AnalogInput.attributes.PresentValue:read(mock_device):to_endpoint(ENERGY_METER_ENDPOINT) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -259,7 +259,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -274,7 +274,7 @@ test.register_coroutine_test( RESTORE_POWER_STATE_ATTRIBUTE_ID, MFG_CODE, data_types.Boolean, true) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -289,7 +289,7 @@ test.register_coroutine_test( MFG_CODE, data_types.SinglePrecisionFloat, SinglePrecisionFloat(0, 6, 0.5625)) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -304,7 +304,7 @@ test.register_coroutine_test( RESTORE_TURN_OFF_INDICATOR_LIGHT_ATTRIBUTE_ID, MFG_CODE, data_types.Boolean, true) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -333,7 +333,7 @@ test.register_coroutine_test( SimpleMetering.attributes.CurrentSummationDelivered:read(mock_standard) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -359,7 +359,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -384,7 +384,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_module.lua b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_module.lua index 4779073041..93e21c4844 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_module.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_module.lua @@ -56,7 +56,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -73,7 +73,7 @@ test.register_coroutine_test( AnalogInput.attributes.PresentValue:read(mock_device):to_endpoint(POWER_METER_ENDPOINT) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -90,7 +90,7 @@ test.register_coroutine_test( AnalogInput.attributes.PresentValue:read(mock_device):to_endpoint(POWER_METER_ENDPOINT) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -104,7 +104,7 @@ test.register_coroutine_test( OnOff.server.commands.On(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -118,7 +118,7 @@ test.register_coroutine_test( OnOff.server.commands.Off(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -140,7 +140,7 @@ test.register_coroutine_test( AnalogInput.attributes.PresentValue:read(mock_device):to_endpoint(ENERGY_METER_ENDPOINT) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -167,7 +167,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -182,7 +182,7 @@ test.register_coroutine_test( RESTORE_POWER_STATE_ATTRIBUTE_ID, MFG_CODE, data_types.Boolean, true) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -197,7 +197,7 @@ test.register_coroutine_test( ELECTRIC_SWITCH_TYPE_ATTRIBUTE_ID, MFG_CODE, data_types.Uint8, 1) }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_module_no_power.lua b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_module_no_power.lua index 8d3135b463..14a816183d 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_module_no_power.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_module_no_power.lua @@ -48,7 +48,7 @@ test.register_coroutine_test( test.socket.device_lifecycle:__queue_receive({ mock_device.id, "added" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -62,7 +62,7 @@ test.register_coroutine_test( OnOff.attributes.OnOff:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -75,7 +75,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.switch.switch.on())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -88,7 +88,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.switch.switch.off())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -102,7 +102,7 @@ test.register_coroutine_test( OnOff.server.commands.On(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -116,7 +116,7 @@ test.register_coroutine_test( OnOff.server.commands.Off(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -131,7 +131,7 @@ test.register_coroutine_test( RESTORE_POWER_STATE_ATTRIBUTE_ID, MFG_CODE, data_types.Boolean, true) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -146,7 +146,7 @@ test.register_coroutine_test( ELECTRIC_SWITCH_TYPE_ATTRIBUTE_ID, MFG_CODE, data_types.Uint8, 1) }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_no_power.lua b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_no_power.lua index 4e7ffaa38a..74e6eaaa6a 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_no_power.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_no_power.lua @@ -75,82 +75,99 @@ end test.set_test_init_function(test_init) test.register_coroutine_test( - "Lifecycle - added test", + "Lifecycle - added test : parent device", function() - -- The initial switch event should be send during the device's first time onboarding + -- The initial switch event should be send during the device's first time onboarding. + -- This profile has no powerMeter/energyMeter, so no meter initialization event may be sent: + -- any extra capability event would fail the strict channel assertions below. test.socket.zigbee:__set_channel_ordering("relaxed") test.socket.device_lifecycle:__queue_receive({ mock_device.id, "added" }) - test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.button.numberOfButtons({ value = 2 }, - { visibility = { displayed = false } }))) + test.socket.capability:__expect_send(mock_device:generate_test_message("main", + capabilities.button.numberOfButtons({ value = 2 }, + { visibility = { displayed = false } }))) test.socket.zigbee:__expect_send({ mock_device.id, cluster_base.write_manufacturer_specific_attribute(mock_device, PRIVATE_CLUSTER_ID, PRIVATE_ATTRIBUTE_ID, MFG_CODE, data_types.Uint8, 1) }) - test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.button.supportedButtonValues({ "pushed" }, - { visibility = { displayed = false } }))) - test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.button.button.pushed({ state_change = false }))) + test.socket.capability:__expect_send(mock_device:generate_test_message("main", + capabilities.button.supportedButtonValues({ "pushed" }, + { visibility = { displayed = false } }))) + test.socket.capability:__expect_send(mock_device:generate_test_message("main", + capabilities.button.button.pushed({ state_change = false }))) -- Avoid sending the initial switch event after driver switch-over, as the switch-over event itself re-triggers the added lifecycle. test.socket.device_lifecycle:__queue_receive({ mock_device.id, "added" }) - test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.button.numberOfButtons({ value = 2 }, - { visibility = { displayed = false } }))) + test.socket.capability:__expect_send(mock_device:generate_test_message("main", + capabilities.button.numberOfButtons({ value = 2 }, + { visibility = { displayed = false } }))) test.socket.zigbee:__expect_send({ mock_device.id, cluster_base.write_manufacturer_specific_attribute(mock_device, PRIVATE_CLUSTER_ID, PRIVATE_ATTRIBUTE_ID, MFG_CODE, data_types.Uint8, 1) }) - test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.button.supportedButtonValues({ "pushed" }, - { visibility = { displayed = false } }))) + test.socket.capability:__expect_send(mock_device:generate_test_message("main", + capabilities.button.supportedButtonValues({ "pushed" }, + { visibility = { displayed = false } }))) end, { - min_api_version = 17 + min_api_version = 14 } ) test.register_coroutine_test( - "Lifecycle - added test", + "Lifecycle - added test : child device", function() - -- The initial switch event should be send during the device's first time onboarding + -- The initial switch event should be send during the device's first time onboarding. + -- The child profile has no powerMeter/energyMeter either, so no meter initialization event is sent. test.socket.zigbee:__set_channel_ordering("relaxed") test.socket.device_lifecycle:__queue_receive({ mock_child.id, "added" }) - test.socket.capability:__expect_send(mock_child:generate_test_message("main", capabilities.button.numberOfButtons({ value = 1 }, - { visibility = { displayed = false } }))) - test.socket.capability:__expect_send(mock_child:generate_test_message("main", capabilities.button.supportedButtonValues({ "pushed" }, - { visibility = { displayed = false } }))) - test.socket.capability:__expect_send(mock_child:generate_test_message("main", capabilities.button.button.pushed({ state_change = false }))) + test.socket.capability:__expect_send(mock_child:generate_test_message("main", + capabilities.button.numberOfButtons({ value = 1 }, + { visibility = { displayed = false } }))) + test.socket.capability:__expect_send(mock_child:generate_test_message("main", + capabilities.button.supportedButtonValues({ "pushed" }, + { visibility = { displayed = false } }))) + test.socket.capability:__expect_send(mock_child:generate_test_message("main", + capabilities.button.button.pushed({ state_change = false }))) -- Avoid sending the initial switch event after driver switch-over, as the switch-over event itself re-triggers the added lifecycle. test.socket.zigbee:__set_channel_ordering("relaxed") test.socket.device_lifecycle:__queue_receive({ mock_child.id, "added" }) - test.socket.capability:__expect_send(mock_child:generate_test_message("main", capabilities.button.numberOfButtons({ value = 1 }, - { visibility = { displayed = false } }))) - test.socket.capability:__expect_send(mock_child:generate_test_message("main", capabilities.button.supportedButtonValues({ "pushed" }, - { visibility = { displayed = false } }))) + test.socket.capability:__expect_send(mock_child:generate_test_message("main", + capabilities.button.numberOfButtons({ value = 1 }, + { visibility = { displayed = false } }))) + test.socket.capability:__expect_send(mock_child:generate_test_message("main", + capabilities.button.supportedButtonValues({ "pushed" }, + { visibility = { displayed = false } }))) end, { - min_api_version = 17 + min_api_version = 14 } ) test.register_coroutine_test( - "Lifecycle - added test", + "Lifecycle - added test : child device creation", function() -- The initial switch event should be send during the device's first time onboarding test.socket.zigbee:__set_channel_ordering("relaxed") test.socket.device_lifecycle:__queue_receive({ mock_base_device.id, "added" }) - mock_base_device:expect_device_create({ - type = "EDGE_CHILD", - label = "Aqara Smart Wall Switch H1 EU (No Neutral, Double Rocker) 2", - profile = "aqara-switch-child", - parent_device_id = mock_base_device.id, - parent_assigned_child_key = "02" - }) - test.socket.capability:__expect_send(mock_base_device:generate_test_message("main", capabilities.button.numberOfButtons({ value = 2 }, - { visibility = { displayed = false } }))) + mock_base_device:expect_device_create({ + type = "EDGE_CHILD", + label = "Aqara Smart Wall Switch H1 EU (No Neutral, Double Rocker) 2", + profile = "aqara-switch-child", + parent_device_id = mock_base_device.id, + parent_assigned_child_key = "02" + }) + test.socket.capability:__expect_send(mock_base_device:generate_test_message("main", + capabilities.button.numberOfButtons({ value = 2 }, + { visibility = { displayed = false } }))) test.socket.zigbee:__expect_send({ mock_base_device.id, - cluster_base.write_manufacturer_specific_attribute(mock_base_device, PRIVATE_CLUSTER_ID, PRIVATE_ATTRIBUTE_ID, MFG_CODE, + cluster_base.write_manufacturer_specific_attribute(mock_base_device, PRIVATE_CLUSTER_ID, PRIVATE_ATTRIBUTE_ID, + MFG_CODE, data_types.Uint8, 1) }) - test.socket.capability:__expect_send(mock_base_device:generate_test_message("main", capabilities.button.supportedButtonValues({ "pushed" }, - { visibility = { displayed = false } }))) - test.socket.capability:__expect_send(mock_base_device:generate_test_message("main", capabilities.button.button.pushed({ state_change = false }))) + test.socket.capability:__expect_send(mock_base_device:generate_test_message("main", + capabilities.button.supportedButtonValues({ "pushed" }, + { visibility = { displayed = false } }))) + test.socket.capability:__expect_send(mock_base_device:generate_test_message("main", + capabilities.button.button.pushed({ state_change = false }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -164,7 +181,7 @@ test.register_coroutine_test( OnOff.attributes.OnOff:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -177,7 +194,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.switch.switch.on())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -190,7 +207,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_child:generate_test_message("main", capabilities.switch.switch.on())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -203,7 +220,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.switch.switch.off())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -216,7 +233,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_child:generate_test_message("main", capabilities.switch.switch.off())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -230,7 +247,7 @@ test.register_coroutine_test( OnOff.server.commands.On(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -244,7 +261,7 @@ test.register_coroutine_test( OnOff.server.commands.On(mock_device):to_endpoint(0x02) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -258,7 +275,7 @@ test.register_coroutine_test( OnOff.server.commands.Off(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -272,7 +289,7 @@ test.register_coroutine_test( OnOff.server.commands.Off(mock_device):to_endpoint(0x02) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -289,7 +306,7 @@ test.register_coroutine_test( capabilities.button.button.pushed({ state_change = true }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -306,7 +323,7 @@ test.register_coroutine_test( capabilities.button.button.pushed({ state_change = true }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -323,7 +340,7 @@ test.register_coroutine_test( RESTORE_POWER_STATE_ATTRIBUTE_ID, MFG_CODE, data_types.Boolean, true) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -338,7 +355,7 @@ test.register_coroutine_test( CHANGE_TO_WIRELESS_SWITCH_ATTRIBUTE_ID, MFG_CODE, data_types.Uint8, 0) }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_power.lua b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_power.lua index b6eb4a320e..9c1f27b33c 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_power.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_power.lua @@ -69,21 +69,71 @@ end test.set_test_init_function(test_init) test.register_coroutine_test( - "Lifecycle - added test", + "Lifecycle - added test : parent device", function() test.socket.zigbee:__set_channel_ordering("relaxed") test.socket.device_lifecycle:__queue_receive({ mock_device.id, "added" }) test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.button.numberOfButtons({ value = 3 }, { visibility = { displayed = false } }))) + test.socket.zigbee:__expect_send({ mock_device.id, + cluster_base.write_manufacturer_specific_attribute(mock_device, PRIVATE_CLUSTER_ID, PRIVATE_ATTRIBUTE_ID, MFG_CODE, + data_types.Uint8, 1) }) + test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.button.supportedButtonValues({ "pushed" }, + { visibility = { displayed = false } }))) + test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.button.button.pushed({ state_change = false }))) + -- On the first onboarding there is no previous power/energy state, so both meters are initialized to 0 test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.powerMeter.power({ value = 0.0, unit = "W" }))) test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.energyMeter.energy({ value = 0.0, unit = "Wh" }))) + end, + { + min_api_version = 14 + } +) + +test.register_coroutine_test( + "Lifecycle - added test : power/energy already reported should be restored instead of reset to 0", + function() + mock_device:set_field(PRIVATE_MODE, 1, { persist = true }) + mock_device:set_field(LAST_REPORT_TIME, os.time() - 60 * 20) + test.socket.zigbee:__set_channel_ordering("relaxed") + + -- report power and energy first so the device has a last known meter state + test.socket.zigbee:__queue_receive({ + mock_device.id, + AnalogInput.attributes.PresentValue:build_test_attr_report(mock_device, + SinglePrecisionFloat(0, 9, 0.953125)):from_endpoint(POWER_METER_ENDPOINT) + }) + test.socket.capability:__expect_send(mock_device:generate_test_message("main", + capabilities.powerMeter.power({ value = 1000.0, unit = "W" }))) + test.socket.zigbee:__expect_send({ mock_device.id, + AnalogInput.attributes.PresentValue:read(mock_device):to_endpoint(ENERGY_METER_ENDPOINT) }) + test.wait_for_events() + + test.socket.zigbee:__queue_receive({ + mock_device.id, + AnalogInput.attributes.PresentValue:build_test_attr_report(mock_device, + SinglePrecisionFloat(0, 9, 0.953125)):from_endpoint(ENERGY_METER_ENDPOINT) + }) + test.socket.capability:__expect_send(mock_device:generate_test_message("main", + capabilities.energyMeter.energy({ value = 1000000.0, unit = "Wh" }))) + test.socket.capability:__expect_send(mock_device:generate_test_message("main", + capabilities.powerConsumptionReport.powerConsumption({ deltaEnergy = 0.0, energy = 1000000.0 }))) + test.wait_for_events() + + -- re-adding the device must restore the reported values rather than blank them out + test.socket.device_lifecycle:__queue_receive({ mock_device.id, "added" }) + test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.button.numberOfButtons({ value = 3 }, + { visibility = { displayed = false } }))) test.socket.zigbee:__expect_send({ mock_device.id, cluster_base.write_manufacturer_specific_attribute(mock_device, PRIVATE_CLUSTER_ID, PRIVATE_ATTRIBUTE_ID, MFG_CODE, data_types.Uint8, 1) }) test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.button.supportedButtonValues({ "pushed" }, { visibility = { displayed = false } }))) test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.button.button.pushed({ state_change = false }))) - + test.socket.capability:__expect_send(mock_device:generate_test_message("main", + capabilities.powerMeter.power({ value = 1000.0, unit = "W" }))) + test.socket.capability:__expect_send(mock_device:generate_test_message("main", + capabilities.energyMeter.energy({ value = 1000000.0, unit = "Wh" }))) end, { min_api_version = 17 @@ -91,7 +141,7 @@ test.register_coroutine_test( ) test.register_coroutine_test( - "Lifecycle - added test", + "Lifecycle - added test : child device", function() test.socket.zigbee:__set_channel_ordering("relaxed") test.socket.device_lifecycle:__queue_receive({ mock_child.id, "added" }) @@ -100,9 +150,10 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_child:generate_test_message("main", capabilities.button.supportedButtonValues({ "pushed" }, { visibility = { displayed = false } }))) test.socket.capability:__expect_send(mock_child:generate_test_message("main", capabilities.button.button.pushed({ state_change = false }))) + -- the child profile has no powerMeter/energyMeter, so no meter initialization event is sent end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -121,7 +172,7 @@ test.register_coroutine_test( AnalogInput.attributes.PresentValue:read(mock_device):to_endpoint(ENERGY_METER_ENDPOINT) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -138,7 +189,7 @@ test.register_coroutine_test( AnalogInput.attributes.PresentValue:read(mock_device):to_endpoint(POWER_METER_ENDPOINT) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -155,7 +206,7 @@ test.register_coroutine_test( AnalogInput.attributes.PresentValue:read(mock_device):to_endpoint(POWER_METER_ENDPOINT) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -172,7 +223,7 @@ test.register_coroutine_test( AnalogInput.attributes.PresentValue:read(mock_device):to_endpoint(POWER_METER_ENDPOINT) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -189,7 +240,7 @@ test.register_coroutine_test( AnalogInput.attributes.PresentValue:read(mock_device):to_endpoint(POWER_METER_ENDPOINT) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -203,7 +254,7 @@ test.register_coroutine_test( OnOff.server.commands.On(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -217,7 +268,7 @@ test.register_coroutine_test( OnOff.server.commands.On(mock_device):to_endpoint(0x02) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -231,7 +282,7 @@ test.register_coroutine_test( OnOff.server.commands.Off(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -245,7 +296,7 @@ test.register_coroutine_test( OnOff.server.commands.Off(mock_device):to_endpoint(0x02) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -262,7 +313,7 @@ test.register_coroutine_test( capabilities.button.button.pushed({ state_change = true }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -279,7 +330,7 @@ test.register_coroutine_test( capabilities.button.button.pushed({ state_change = true }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -301,7 +352,7 @@ test.register_coroutine_test( AnalogInput.attributes.PresentValue:read(mock_device):to_endpoint(ENERGY_METER_ENDPOINT) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -328,7 +379,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -343,7 +394,7 @@ test.register_coroutine_test( RESTORE_POWER_STATE_ATTRIBUTE_ID, MFG_CODE, data_types.Boolean, true) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -358,7 +409,7 @@ test.register_coroutine_test( CHANGE_TO_WIRELESS_SWITCH_ATTRIBUTE_ID, MFG_CODE, data_types.Uint8, 0) }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_wall_switch.lua b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_wall_switch.lua index a0a7e9b924..7efbeefe78 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_wall_switch.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_wall_switch.lua @@ -60,7 +60,7 @@ test.register_coroutine_test( mock_device:expect_native_attr_handler_registration("switch", "switch") end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -73,7 +73,7 @@ test.register_coroutine_test( mock_device:expect_native_attr_handler_registration("switch", "switch") end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -86,7 +86,7 @@ test.register_coroutine_test( mock_device:expect_native_attr_handler_registration("switch", "switch") end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -99,7 +99,7 @@ test.register_coroutine_test( mock_device:expect_native_attr_handler_registration("switch", "switch") end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -113,7 +113,7 @@ test.register_coroutine_test( OnOff.server.commands.On(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -127,7 +127,7 @@ test.register_coroutine_test( OnOff.server.commands.On(mock_device):to_endpoint(0x02) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -141,7 +141,7 @@ test.register_coroutine_test( OnOff.server.commands.Off(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -155,7 +155,7 @@ test.register_coroutine_test( OnOff.server.commands.Off(mock_device):to_endpoint(0x02) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -172,7 +172,7 @@ test.register_coroutine_test( capabilities.button.button.pushed({ state_change = true }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -189,7 +189,7 @@ test.register_coroutine_test( capabilities.button.button.pushed({ state_change = true }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -204,7 +204,7 @@ test.register_coroutine_test( CHANGE_TO_WIRELESS_SWITCH_ATTRIBUTE_ID, MFG_CODE, data_types.Uint8, 0) }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_aurora_relay.lua b/drivers/SmartThings/zigbee-switch/src/test/test_aurora_relay.lua index 3adf489318..4b16a32bb5 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_aurora_relay.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_aurora_relay.lua @@ -42,7 +42,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, SimpleMetering.attributes.InstantaneousDemand:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -69,7 +69,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -96,7 +96,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -123,7 +123,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_bad_data_type.lua b/drivers/SmartThings/zigbee-switch/src/test/test_bad_data_type.lua index 36ac4d5fa0..296ab9a904 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_bad_data_type.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_bad_data_type.lua @@ -43,7 +43,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_bad_device_kind.lua b/drivers/SmartThings/zigbee-switch/src/test/test_bad_device_kind.lua index 189f64715a..569c5c6b98 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_bad_device_kind.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_bad_device_kind.lua @@ -33,7 +33,7 @@ test.register_coroutine_test("zwave_device_handled", function() test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -45,7 +45,7 @@ test.register_message_test( message = { mock_device.id, { capability = "switch", component = "main", command = "on", args = { } } } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_cree_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_cree_bulb.lua index 66af249b0c..b8cfb47e41 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_cree_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_cree_bulb.lua @@ -66,7 +66,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -77,7 +77,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main",capabilities.switchLevel.level(100))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -90,7 +90,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.CurrentLevel:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -104,7 +104,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.CurrentLevel:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_duragreen_color_temp_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_duragreen_color_temp_bulb.lua index d1bebb68d5..5651b0086b 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_duragreen_color_temp_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_duragreen_color_temp_bulb.lua @@ -143,7 +143,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17, + min_api_version = 14, max_api_version = 19 } ) @@ -238,7 +238,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17, + min_api_version = 14, max_api_version = 19 } ) @@ -269,7 +269,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({mock_device.id, ColorControl.attributes.ColorTemperatureMireds:read(mock_device)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -291,7 +291,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_enbrighten_metering_dimmer.lua b/drivers/SmartThings/zigbee-switch/src/test/test_enbrighten_metering_dimmer.lua index f28bb56e37..86d654a053 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_enbrighten_metering_dimmer.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_enbrighten_metering_dimmer.lua @@ -130,7 +130,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -157,7 +157,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -184,7 +184,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -214,7 +214,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -244,7 +244,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -263,7 +263,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -282,7 +282,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_frient_IO_module.lua b/drivers/SmartThings/zigbee-switch/src/test/test_frient_IO_module.lua index b410872075..f1e568bc7f 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_frient_IO_module.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_frient_IO_module.lua @@ -522,7 +522,7 @@ test.register_coroutine_test( assert(parent_native, "expected parent device to register native switch handler for input 3") end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -556,7 +556,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -616,7 +616,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -640,7 +640,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -691,7 +691,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_frient_switch.lua b/drivers/SmartThings/zigbee-switch/src/test/test_frient_switch.lua index 2a86e1ed19..90cd1524bd 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_frient_switch.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_frient_switch.lua @@ -81,7 +81,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -118,7 +118,7 @@ test.register_message_test("Current divisor, multiplier, summation should be han }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -153,7 +153,7 @@ test.register_coroutine_test("Refresh command should read all necessary attribut ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -180,7 +180,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -207,7 +207,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -239,7 +239,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -264,7 +264,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -277,7 +277,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.powerSource.powerSource.mains())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -341,7 +341,7 @@ test.register_coroutine_test("doConfigure should send bind request, read attribu mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -357,7 +357,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.powerSource.powerSource.unknown())) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_ge_link_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_ge_link_bulb.lua index d35bbf4f35..94104f74b7 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_ge_link_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_ge_link_bulb.lua @@ -47,7 +47,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.CurrentLevel:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -64,7 +64,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.OnOffTransitionTime:write(mock_device, 50) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -79,7 +79,7 @@ test.register_coroutine_test( test.socket.device_lifecycle:__queue_receive(mock_device:generate_info_changed(updates)) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -112,7 +112,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.CurrentLevel:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -149,7 +149,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -169,7 +169,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.OnOffTransitionTime:write(mock_device, 0) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -189,7 +189,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.OnOffTransitionTime:write(mock_device, 50) }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_hanssem_switch.lua b/drivers/SmartThings/zigbee-switch/src/test/test_hanssem_switch.lua index 7982403b8c..13184c37d3 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_hanssem_switch.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_hanssem_switch.lua @@ -128,7 +128,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -161,7 +161,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -194,7 +194,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -227,7 +227,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -260,7 +260,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -293,7 +293,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -326,7 +326,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -359,7 +359,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -392,7 +392,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -425,7 +425,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -458,7 +458,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -491,7 +491,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -523,7 +523,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -550,7 +550,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -577,7 +577,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -604,7 +604,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -631,7 +631,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -658,7 +658,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -685,7 +685,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -712,7 +712,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -739,7 +739,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -766,7 +766,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -793,7 +793,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -820,7 +820,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -870,7 +870,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm30_sn.lua b/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm30_sn.lua index b2b7019dd0..3dcee92797 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm30_sn.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm30_sn.lua @@ -105,7 +105,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -144,7 +144,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -168,7 +168,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -192,7 +192,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -219,7 +219,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -289,7 +289,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -321,7 +321,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -359,7 +359,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -382,7 +382,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -405,7 +405,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -427,7 +427,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -448,7 +448,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -497,7 +497,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -556,7 +556,7 @@ test.register_coroutine_test( mock_inovelli_vzm30_sn:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm30_sn_child.lua b/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm30_sn_child.lua index 3c839f571f..8be1b0ee0a 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm30_sn_child.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm30_sn_child.lua @@ -91,7 +91,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -146,7 +146,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -180,7 +180,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -239,7 +239,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -302,7 +302,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -365,7 +365,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm30_sn_preferences.lua b/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm30_sn_preferences.lua index 6c6d633d70..fa6bf5202f 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm30_sn_preferences.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm30_sn_preferences.lua @@ -63,7 +63,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -88,7 +88,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -112,7 +112,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -136,7 +136,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -160,7 +160,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -184,7 +184,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -208,7 +208,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -227,7 +227,7 @@ test.register_coroutine_test( test.socket.device_lifecycle:__queue_receive(mock_inovelli_vzm30_sn:generate_info_changed({preferences = {notificationChild = true}})) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm31_sn.lua b/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm31_sn.lua index 6c0da0b158..1549b80a41 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm31_sn.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm31_sn.lua @@ -73,7 +73,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -97,7 +97,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -121,7 +121,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -148,7 +148,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -218,7 +218,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -250,7 +250,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -288,7 +288,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -310,7 +310,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -332,7 +332,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -381,7 +381,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -433,7 +433,7 @@ test.register_coroutine_test( mock_inovelli_vzm31_sn:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm31_sn_child.lua b/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm31_sn_child.lua index fd7f718ff9..a3b1717c04 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm31_sn_child.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm31_sn_child.lua @@ -80,7 +80,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -135,7 +135,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -169,7 +169,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -228,7 +228,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -291,7 +291,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -354,7 +354,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm31_sn_preferences.lua b/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm31_sn_preferences.lua index 3823d4e010..56f526c2cd 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm31_sn_preferences.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm31_sn_preferences.lua @@ -52,7 +52,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -77,7 +77,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -101,7 +101,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -125,7 +125,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -149,7 +149,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -173,7 +173,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -197,7 +197,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -216,7 +216,7 @@ test.register_coroutine_test( test.socket.device_lifecycle:__queue_receive(mock_inovelli_vzm31_sn:generate_info_changed({preferences = {notificationChild = true}})) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm32_sn.lua b/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm32_sn.lua index ee21044bea..80f7a765a7 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm32_sn.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm32_sn.lua @@ -84,7 +84,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -118,7 +118,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -142,7 +142,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -166,7 +166,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -193,7 +193,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -263,7 +263,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -295,7 +295,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -333,7 +333,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -356,7 +356,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -379,7 +379,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -402,7 +402,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -425,7 +425,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -445,7 +445,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -494,7 +494,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -549,7 +549,7 @@ test.register_coroutine_test( mock_inovelli_vzm32_sn:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm32_sn_child.lua b/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm32_sn_child.lua index 7173463e16..544ee73aea 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm32_sn_child.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm32_sn_child.lua @@ -80,7 +80,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -135,7 +135,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -169,7 +169,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -228,7 +228,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -291,7 +291,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -354,7 +354,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm32_sn_preferences.lua b/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm32_sn_preferences.lua index 9939926ff3..a630e54efe 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm32_sn_preferences.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm32_sn_preferences.lua @@ -52,7 +52,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -77,7 +77,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -101,7 +101,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -125,7 +125,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -144,7 +144,7 @@ test.register_coroutine_test( test.socket.device_lifecycle:__queue_receive(mock_inovelli_vzm32_sn:generate_info_changed({preferences = {notificationChild = true}})) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -174,7 +174,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_jasco_switch.lua b/drivers/SmartThings/zigbee-switch/src/test/test_jasco_switch.lua index 6d1b78e806..14df41e010 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_jasco_switch.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_jasco_switch.lua @@ -56,7 +56,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -83,7 +83,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -102,7 +102,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -126,7 +126,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -155,7 +155,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_laisiao_bath_heather.lua b/drivers/SmartThings/zigbee-switch/src/test/test_laisiao_bath_heather.lua index 5c7df6e762..5a2e92e8a3 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_laisiao_bath_heather.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_laisiao_bath_heather.lua @@ -50,7 +50,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -70,7 +70,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -90,7 +90,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -110,7 +110,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -130,7 +130,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -150,7 +150,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -170,7 +170,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -190,7 +190,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -212,7 +212,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -232,7 +232,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -252,7 +252,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -272,7 +272,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -292,7 +292,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -312,7 +312,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -332,7 +332,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -352,7 +352,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -365,7 +365,7 @@ test.register_coroutine_test( OnOff.server.commands.On(mock_device):to_endpoint(0x02) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -378,7 +378,7 @@ test.register_coroutine_test( OnOff.server.commands.On(mock_device):to_endpoint(0x03) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -391,7 +391,7 @@ test.register_coroutine_test( OnOff.server.commands.On(mock_device):to_endpoint(0x04) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -404,7 +404,7 @@ test.register_coroutine_test( OnOff.server.commands.On(mock_device):to_endpoint(0x05) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -417,7 +417,7 @@ test.register_coroutine_test( OnOff.server.commands.On(mock_device):to_endpoint(0x06) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -430,7 +430,7 @@ test.register_coroutine_test( OnOff.server.commands.On(mock_device):to_endpoint(0x07) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -443,7 +443,7 @@ test.register_coroutine_test( OnOff.server.commands.On(mock_device):to_endpoint(0x08) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -456,7 +456,7 @@ test.register_coroutine_test( OnOff.server.commands.Off(mock_device):to_endpoint(0x01) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -469,7 +469,7 @@ test.register_coroutine_test( OnOff.server.commands.Off(mock_device):to_endpoint(0x02) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -482,7 +482,7 @@ test.register_coroutine_test( OnOff.server.commands.Off(mock_device):to_endpoint(0x03) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -495,7 +495,7 @@ test.register_coroutine_test( OnOff.server.commands.Off(mock_device):to_endpoint(0x04) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -508,7 +508,7 @@ test.register_coroutine_test( OnOff.server.commands.Off(mock_device):to_endpoint(0x05) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -521,7 +521,7 @@ test.register_coroutine_test( OnOff.server.commands.Off(mock_device):to_endpoint(0x06) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -534,7 +534,7 @@ test.register_coroutine_test( OnOff.server.commands.Off(mock_device):to_endpoint(0x07) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -547,7 +547,7 @@ test.register_coroutine_test( OnOff.server.commands.Off(mock_device):to_endpoint(0x08) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -567,7 +567,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_ledvance_metering_plug.lua b/drivers/SmartThings/zigbee-switch/src/test/test_ledvance_metering_plug.lua index ebdcae468e..0968fa7c5e 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_ledvance_metering_plug.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_ledvance_metering_plug.lua @@ -55,7 +55,7 @@ test.register_coroutine_test( assert(mock_device:get_field(zigbee_constants.SIMPLE_METERING_DIVISOR_KEY) == 100) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -70,7 +70,7 @@ test.register_coroutine_test( assert(mock_device:get_field(zigbee_constants.SIMPLE_METERING_DIVISOR_KEY) == 1000) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -85,7 +85,7 @@ test.register_coroutine_test( assert(mock_device_eu_em_t:get_field(zigbee_constants.SIMPLE_METERING_DIVISOR_KEY) == 100) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -100,7 +100,7 @@ test.register_coroutine_test( assert(mock_device_eu_em_t:get_field(zigbee_constants.SIMPLE_METERING_DIVISOR_KEY) == 1000) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_multi_switch.lua b/drivers/SmartThings/zigbee-switch/src/test/test_multi_switch.lua index b6b5adade5..9e1ccb8d5e 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_multi_switch.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_multi_switch.lua @@ -39,7 +39,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -59,7 +59,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) test.register_message_test( @@ -78,7 +78,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -98,7 +98,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -117,7 +117,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_multi_switch_no_master.lua b/drivers/SmartThings/zigbee-switch/src/test/test_multi_switch_no_master.lua index 2ec4c6eb86..1d5d8b712a 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_multi_switch_no_master.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_multi_switch_no_master.lua @@ -105,7 +105,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -138,7 +138,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -171,7 +171,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -204,7 +204,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -237,7 +237,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -270,7 +270,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -297,7 +297,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -324,7 +324,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -351,7 +351,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -378,7 +378,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -405,7 +405,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -432,7 +432,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -511,7 +511,7 @@ test.register_coroutine_test( mock_base_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -553,7 +553,7 @@ test.register_coroutine_test( test_init = function() test.mock_device.add_test_device(mock_non_mns_device) end, - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_multi_switch_power.lua b/drivers/SmartThings/zigbee-switch/src/test/test_multi_switch_power.lua index 788c5477c5..5df2466cb2 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_multi_switch_power.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_multi_switch_power.lua @@ -117,7 +117,7 @@ test.register_coroutine_test( test_init = function() -- no op to avoid auto device add and immediate init event on driver startup end, - min_api_version = 17 + min_api_version = 14 } ) @@ -141,7 +141,7 @@ test.register_coroutine_test( test_init = function() -- no op to avoid auto device add and immediate init event on driver startup end, - min_api_version = 17 + min_api_version = 14 } ) @@ -172,7 +172,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -203,7 +203,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -231,7 +231,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -259,7 +259,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -287,7 +287,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -315,7 +315,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -345,7 +345,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -375,7 +375,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -402,7 +402,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -429,7 +429,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -456,7 +456,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -483,7 +483,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -509,7 +509,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -528,7 +528,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_on_off_zigbee_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_on_off_zigbee_bulb.lua index 7a1af4a260..062bd8fc6c 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_on_off_zigbee_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_on_off_zigbee_bulb.lua @@ -47,7 +47,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -75,7 +75,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -103,7 +103,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -132,7 +132,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -175,7 +175,7 @@ test.register_coroutine_test( mock_simple_device:expect_metadata_update({provisioning_state = "PROVISIONED"}) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_osram_iqbr30_light.lua b/drivers/SmartThings/zigbee-switch/src/test/test_osram_iqbr30_light.lua index 8727de3c35..4d846e8380 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_osram_iqbr30_light.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_osram_iqbr30_light.lua @@ -65,7 +65,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -76,7 +76,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main",capabilities.switchLevel.level(100))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -107,7 +107,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -138,7 +138,7 @@ test.register_message_test( }, { inner_block_ordering = "RELAXED", - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_osram_light.lua b/drivers/SmartThings/zigbee-switch/src/test/test_osram_light.lua index 29a53accff..a09436c9ce 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_osram_light.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_osram_light.lua @@ -65,7 +65,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -76,7 +76,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main",capabilities.switchLevel.level(100))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -107,7 +107,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_rgb_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_rgb_bulb.lua index 06c20b34e5..bac6c6715c 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_rgb_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_rgb_bulb.lua @@ -67,7 +67,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -114,7 +114,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -141,7 +141,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({mock_device.id, ColorControl.attributes.CurrentHue:read(mock_device)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -168,7 +168,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({mock_device.id, ColorControl.attributes.CurrentSaturation:read(mock_device)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -200,7 +200,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({mock_device.id, ColorControl.attributes.CurrentSaturation:read(mock_device)}) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_rgbw_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_rgbw_bulb.lua index 4a83d8b920..604780cd9c 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_rgbw_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_rgbw_bulb.lua @@ -165,7 +165,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17, + min_api_version = 14, max_api_version = 19 } ) @@ -221,7 +221,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -248,7 +248,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({mock_device.id, ColorControl.attributes.CurrentHue:read(mock_device)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -275,7 +275,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({mock_device.id, ColorControl.attributes.CurrentSaturation:read(mock_device)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -304,7 +304,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({mock_device.id, ColorControl.attributes.CurrentSaturation:read(mock_device)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -330,7 +330,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({mock_device.id, ColorControl.attributes.ColorTemperatureMireds:read(mock_device)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -346,7 +346,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_robb_smarrt_2-wire_dimmer.lua b/drivers/SmartThings/zigbee-switch/src/test/test_robb_smarrt_2-wire_dimmer.lua index cfbfa42b50..462a607694 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_robb_smarrt_2-wire_dimmer.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_robb_smarrt_2-wire_dimmer.lua @@ -56,7 +56,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -83,7 +83,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -111,7 +111,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -131,7 +131,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -152,7 +152,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_robb_smarrt_knob_dimmer.lua b/drivers/SmartThings/zigbee-switch/src/test/test_robb_smarrt_knob_dimmer.lua index 1bfa694b5b..cf64a89595 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_robb_smarrt_knob_dimmer.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_robb_smarrt_knob_dimmer.lua @@ -56,7 +56,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -83,7 +83,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -111,7 +111,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -132,7 +132,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_sengled_color_temp_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_sengled_color_temp_bulb.lua index 80241b4ca9..7d633129ec 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_sengled_color_temp_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_sengled_color_temp_bulb.lua @@ -143,7 +143,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17, + min_api_version = 14, max_api_version = 19 } ) @@ -238,7 +238,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17, + min_api_version = 14, max_api_version = 19 } ) @@ -269,7 +269,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({mock_device.id, ColorControl.attributes.ColorTemperatureMireds:read(mock_device)}) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_sengled_dimmer_bulb_with_motion_sensor.lua b/drivers/SmartThings/zigbee-switch/src/test/test_sengled_dimmer_bulb_with_motion_sensor.lua index aa4e56653c..6ba6eef2b2 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_sengled_dimmer_bulb_with_motion_sensor.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_sengled_dimmer_bulb_with_motion_sensor.lua @@ -69,7 +69,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -83,7 +83,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, IASZone.attributes.ZoneStatus:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -97,7 +97,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, IASZone.attributes.ZoneStatus:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -119,7 +119,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, IASZone.attributes.ZoneStatus:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -141,7 +141,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, IASZone.attributes.ZoneStatus:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -163,7 +163,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, IASZone.attributes.ZoneStatus:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -190,7 +190,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -217,7 +217,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_sinope_dimmer.lua b/drivers/SmartThings/zigbee-switch/src/test/test_sinope_dimmer.lua index 4de1a70303..a16d47a4b0 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_sinope_dimmer.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_sinope_dimmer.lua @@ -73,7 +73,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -109,7 +109,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -148,7 +148,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -184,7 +184,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -214,7 +214,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -240,7 +240,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -280,7 +280,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -316,7 +316,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -360,7 +360,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_sinope_switch.lua b/drivers/SmartThings/zigbee-switch/src/test/test_sinope_switch.lua index 9d9b33df99..28bd04a664 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_sinope_switch.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_sinope_switch.lua @@ -57,7 +57,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -84,7 +84,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -111,7 +111,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_switch_power.lua b/drivers/SmartThings/zigbee-switch/src/test/test_switch_power.lua index 4ff3fb2afa..2a26c95e3c 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_switch_power.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_switch_power.lua @@ -125,7 +125,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -180,7 +180,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -242,7 +242,7 @@ test.register_coroutine_test( mock_aurora_relay_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -312,7 +312,7 @@ test.register_coroutine_test( mock_vimar_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_tuya_multi.lua b/drivers/SmartThings/zigbee-switch/src/test/test_tuya_multi.lua index ac3a78a982..7754d6281e 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_tuya_multi.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_tuya_multi.lua @@ -78,7 +78,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_tuya_multi_switch.lua b/drivers/SmartThings/zigbee-switch/src/test/test_tuya_multi_switch.lua index b6b5adade5..9e1ccb8d5e 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_tuya_multi_switch.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_tuya_multi_switch.lua @@ -39,7 +39,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -59,7 +59,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) test.register_message_test( @@ -78,7 +78,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -98,7 +98,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -117,7 +117,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_wallhero_switch.lua b/drivers/SmartThings/zigbee-switch/src/test/test_wallhero_switch.lua index 8bbe6bad68..f28334b661 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_wallhero_switch.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_wallhero_switch.lua @@ -182,7 +182,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -215,7 +215,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -248,7 +248,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -281,7 +281,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -314,7 +314,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -347,7 +347,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -380,7 +380,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -413,7 +413,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -428,7 +428,7 @@ test.register_coroutine_test( 0x6000, 0x1235, data_types.Uint8, 0x01) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -443,7 +443,7 @@ test.register_coroutine_test( 0x6000, 0x1235, data_types.Uint8, 0x00) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -475,7 +475,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -502,7 +502,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -529,7 +529,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -556,7 +556,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -584,7 +584,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -611,7 +611,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -638,7 +638,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -665,7 +665,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -682,7 +682,7 @@ test.register_coroutine_test( ))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -698,7 +698,7 @@ test.register_coroutine_test( ))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -714,7 +714,7 @@ test.register_coroutine_test( ))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -730,7 +730,7 @@ test.register_coroutine_test( ))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -794,7 +794,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -808,7 +808,7 @@ test.register_coroutine_test( capabilities.button.supportedButtonValues({ "pushed" }, { visibility = { displayed = false } }))) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_white_color_temp_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_white_color_temp_bulb.lua index 8a0db9d65c..1524a8aa85 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_white_color_temp_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_white_color_temp_bulb.lua @@ -144,7 +144,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17, + min_api_version = 14, max_api_version = 19 } ) @@ -239,7 +239,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17, + min_api_version = 14, max_api_version = 19 } ) @@ -270,7 +270,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({mock_device.id, ColorControl.attributes.ColorTemperatureMireds:read(mock_device)}) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_yanmi_switch.lua b/drivers/SmartThings/zigbee-switch/src/test/test_yanmi_switch.lua index 5f29f49c2b..889f4f15d6 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_yanmi_switch.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_yanmi_switch.lua @@ -101,7 +101,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -134,7 +134,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -167,7 +167,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -201,7 +201,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -234,7 +234,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -267,7 +267,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -300,7 +300,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -327,7 +327,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -354,7 +354,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -384,7 +384,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -411,7 +411,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -438,7 +438,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_zigbee_ezex_switch.lua b/drivers/SmartThings/zigbee-switch/src/test/test_zigbee_ezex_switch.lua index d2b73dd4b1..cfcab8e20e 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_zigbee_ezex_switch.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_zigbee_ezex_switch.lua @@ -54,7 +54,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -81,7 +81,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -100,7 +100,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -127,7 +127,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -146,7 +146,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_zigbee_metering_plug_power_consumption_report.lua b/drivers/SmartThings/zigbee-switch/src/test/test_zigbee_metering_plug_power_consumption_report.lua index e265fa13dc..1b4d46446b 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_zigbee_metering_plug_power_consumption_report.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_zigbee_metering_plug_power_consumption_report.lua @@ -66,7 +66,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -85,7 +85,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -153,7 +153,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_zigbee_metering_plug_rexense.lua b/drivers/SmartThings/zigbee-switch/src/test/test_zigbee_metering_plug_rexense.lua index a616744baf..ff732a9589 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_zigbee_metering_plug_rexense.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_zigbee_metering_plug_rexense.lua @@ -49,7 +49,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -73,7 +73,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_zll_color_temp_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_zll_color_temp_bulb.lua index f6842b077f..20f6d458a2 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_zll_color_temp_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_zll_color_temp_bulb.lua @@ -66,7 +66,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTemperatureMireds:read(mock_device) }) end, { - min_api_version = 17, + min_api_version = 14, max_api_version = 19 } ) @@ -115,7 +115,7 @@ test.register_coroutine_test( test.mock_device.add_test_device(mock_device) test.timer.__create_and_queue_test_time_advance_timer(30, "interval", "polling") end, - min_api_version = 17, + min_api_version = 14, max_api_version = 19 } ) @@ -156,7 +156,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTemperatureMireds:read(mock_device) }) end, { - min_api_version = 17, + min_api_version = 14, max_api_version = 19 } ) @@ -197,7 +197,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTemperatureMireds:read(mock_device) }) end, { - min_api_version = 17, + min_api_version = 14, max_api_version = 19 } ) @@ -238,7 +238,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTemperatureMireds:read(mock_device) }) end, { - min_api_version = 17, + min_api_version = 14, max_api_version = 19 } ) @@ -281,7 +281,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTemperatureMireds:read(mock_device) }) end, { - min_api_version = 17, + min_api_version = 14, max_api_version = 19 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_zll_dimmer.lua b/drivers/SmartThings/zigbee-switch/src/test/test_zll_dimmer.lua index 2e688c0a86..7738dc659b 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_zll_dimmer.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_zll_dimmer.lua @@ -67,7 +67,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -78,7 +78,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main",capabilities.switchLevel.level(100))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -91,7 +91,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.CurrentLevel:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -157,7 +157,7 @@ test.register_coroutine_test( test.mock_device.add_test_device(mock_device) test.timer.__create_and_queue_test_time_advance_timer(5*60, "interval", "polling") end, - min_api_version = 17 + min_api_version = 14 } ) @@ -171,7 +171,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.CurrentLevel:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_zll_dimmer_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_zll_dimmer_bulb.lua index ec10a66a62..195e0eb469 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_zll_dimmer_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_zll_dimmer_bulb.lua @@ -67,7 +67,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -80,7 +80,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.CurrentLevel:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -93,7 +93,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.CurrentLevel:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -115,7 +115,7 @@ test.register_coroutine_test( test.mock_device.add_test_device(mock_device) test.timer.__create_and_queue_test_time_advance_timer(30, "interval", "polling") end, - min_api_version = 17 + min_api_version = 14 } ) @@ -136,7 +136,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.CurrentLevel:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -157,7 +157,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.CurrentLevel:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -178,7 +178,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.CurrentLevel:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_zll_rgb_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_zll_rgb_bulb.lua index bbbda5660d..2eeffc86aa 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_zll_rgb_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_zll_rgb_bulb.lua @@ -85,7 +85,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -100,7 +100,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.CurrentY:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -115,7 +115,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.CurrentY:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -139,7 +139,7 @@ test.register_coroutine_test( test.mock_device.add_test_device(mock_device) test.timer.__create_and_queue_test_time_advance_timer(30, "interval", "polling") end, - min_api_version = 17 + min_api_version = 14 } ) @@ -162,7 +162,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.CurrentY:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -185,7 +185,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.CurrentY:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -208,7 +208,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.CurrentY:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -286,7 +286,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.CurrentY:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -365,7 +365,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.CurrentY:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -406,7 +406,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.CurrentY:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -447,7 +447,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.CurrentY:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -474,7 +474,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.CurrentY:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -489,7 +489,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.colorControl.saturation(65))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -504,7 +504,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.colorControl.saturation(65))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -519,7 +519,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.colorControl.saturation(65))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -534,7 +534,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.colorControl.saturation(65))) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_zll_rgbw_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_zll_rgbw_bulb.lua index 4e2ad43b06..0a5d739a48 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_zll_rgbw_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_zll_rgbw_bulb.lua @@ -195,7 +195,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.CurrentSaturation:read(mock_device) }) end, { - min_api_version = 17, + min_api_version = 14, max_api_version = 19 } ) @@ -248,7 +248,7 @@ test.register_coroutine_test( test.mock_device.add_test_device(mock_device) test.timer.__create_and_queue_test_time_advance_timer(5*60, "interval", "polling") end, - min_api_version = 17, + min_api_version = 14, max_api_version = 19 } ) @@ -301,7 +301,7 @@ test.register_coroutine_test( end, { - min_api_version = 17, + min_api_version = 14, max_api_version = 19 } ) @@ -354,7 +354,7 @@ test.register_coroutine_test( end, { - min_api_version = 17, + min_api_version = 14, max_api_version = 19 } ) @@ -407,7 +407,7 @@ test.register_coroutine_test( end, { - min_api_version = 17, + min_api_version = 14, max_api_version = 19 } ) @@ -462,7 +462,7 @@ test.register_coroutine_test( end, { - min_api_version = 17, + min_api_version = 14, max_api_version = 19 } ) @@ -491,7 +491,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.CurrentHue:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -519,7 +519,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.CurrentSaturation:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -549,7 +549,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.CurrentSaturation:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-thermostat/src/test/test_aqara_thermostat.lua b/drivers/SmartThings/zigbee-thermostat/src/test/test_aqara_thermostat.lua index 8b84e987a0..d6ae23b544 100644 --- a/drivers/SmartThings/zigbee-thermostat/src/test/test_aqara_thermostat.lua +++ b/drivers/SmartThings/zigbee-thermostat/src/test/test_aqara_thermostat.lua @@ -77,7 +77,7 @@ test.register_coroutine_test( PRIVATE_THERM0STAT_VALVE_DETECTION_SWITCH_ID, MFG_CODE, data_types.Uint8, 0x01) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -92,7 +92,7 @@ test.register_coroutine_test( PRIVATE_ANTIFREEZE_MODE_TEMPERATURE_SETTING_ID, MFG_CODE, data_types.Uint32, 500) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -120,7 +120,7 @@ test.register_coroutine_test( capabilities.hardwareFault.hardwareFault.clear())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -158,7 +158,7 @@ test.register_coroutine_test( valveCalibration.calibrationState.calibrationFailure())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -190,7 +190,7 @@ test.register_coroutine_test( invisibleCapabilities.invisibleCapabilities({"thermostatHeatingSetpoint"}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -258,7 +258,7 @@ test.register_coroutine_test( invisibleCapabilities.invisibleCapabilities({"thermostatHeatingSetpoint"}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -286,7 +286,7 @@ test.register_coroutine_test( capabilities.lock.lock.locked())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -305,7 +305,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -366,7 +366,7 @@ test.register_coroutine_test( PRIVATE_VALVE_SWITCH_ATTRIBUTE_ID, MFG_CODE, data_types.Uint8, 0x01) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -380,7 +380,7 @@ test.register_coroutine_test( PRIVATE_VALVE_CALIBRATION_ID, MFG_CODE, data_types.Uint8, 0x01) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -395,7 +395,7 @@ test.register_coroutine_test( PRIVATE_CHILD_LOCK_ID, MFG_CODE, data_types.Uint8, 0x01) }) end, { - min_api_version = 17 + min_api_version = 14 } ) --]] @@ -470,7 +470,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-thermostat/src/test/test_centralite_thermostat.lua b/drivers/SmartThings/zigbee-thermostat/src/test/test_centralite_thermostat.lua index b1942290db..fdf30687aa 100644 --- a/drivers/SmartThings/zigbee-thermostat/src/test/test_centralite_thermostat.lua +++ b/drivers/SmartThings/zigbee-thermostat/src/test/test_centralite_thermostat.lua @@ -48,7 +48,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -68,7 +68,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -88,7 +88,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -119,7 +119,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -150,7 +150,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-thermostat/src/test/test_danfoss_thermostat.lua b/drivers/SmartThings/zigbee-thermostat/src/test/test_danfoss_thermostat.lua index 43fe7c3c82..33bda1be3e 100644 --- a/drivers/SmartThings/zigbee-thermostat/src/test/test_danfoss_thermostat.lua +++ b/drivers/SmartThings/zigbee-thermostat/src/test/test_danfoss_thermostat.lua @@ -44,7 +44,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -55,7 +55,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device_danfoss:generate_test_message("main", capabilities.temperatureMeasurement.temperature({ value = 21.0, unit = "C"}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -66,7 +66,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device_danfoss:generate_test_message("main", capabilities.thermostatHeatingSetpoint.heatingSetpoint({ value = 21.0, unit = "C"}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -76,7 +76,7 @@ test.register_coroutine_test( test.socket.zigbee:__queue_receive({ mock_device_danfoss.id, Thermostat.attributes.OccupiedCoolingSetpoint:build_test_attr_report(mock_device_danfoss, 2100) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -102,7 +102,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -121,7 +121,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-thermostat/src/test/test_fidure_thermostat.lua b/drivers/SmartThings/zigbee-thermostat/src/test/test_fidure_thermostat.lua index 469f36dec9..25ffd9a224 100644 --- a/drivers/SmartThings/zigbee-thermostat/src/test/test_fidure_thermostat.lua +++ b/drivers/SmartThings/zigbee-thermostat/src/test/test_fidure_thermostat.lua @@ -63,7 +63,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -78,7 +78,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-thermostat/src/test/test_leviton_rc.lua b/drivers/SmartThings/zigbee-thermostat/src/test/test_leviton_rc.lua index 8fc6b2944f..7101150397 100644 --- a/drivers/SmartThings/zigbee-thermostat/src/test/test_leviton_rc.lua +++ b/drivers/SmartThings/zigbee-thermostat/src/test/test_leviton_rc.lua @@ -53,7 +53,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -70,7 +70,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send( { mock_device.id, Thermostat.attributes.LocalTemperature:read(mock_device):to_endpoint(ENDPOINT) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -81,7 +81,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.temperatureMeasurement.temperature({value = 21.0, unit = "C"}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -92,7 +92,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.thermostatMode.thermostatMode.off())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -115,7 +115,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.thermostatFanMode.thermostatFanMode.auto())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -130,7 +130,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.thermostatCoolingSetpoint.coolingSetpoint({value = 21.0, unit = "C"}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -145,7 +145,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.thermostatHeatingSetpoint.heatingSetpoint({value = 21.0, unit = "C"}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -159,7 +159,7 @@ test.register_coroutine_test( test.socket.zigbee:__queue_receive({ mock_device.id, Thermostat.attributes.OccupiedHeatingSetpoint:build_test_attr_report(mock_device, 2100) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -173,7 +173,7 @@ test.register_coroutine_test( test.socket.zigbee:__queue_receive({ mock_device.id, Thermostat.attributes.OccupiedCoolingSetpoint:build_test_attr_report(mock_device, 2100) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -185,7 +185,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send( { mock_device.id, Thermostat.attributes.OccupiedHeatingSetpoint:write(mock_device, 2100):to_endpoint(ENDPOINT) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -197,7 +197,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send( { mock_device.id, Thermostat.attributes.OccupiedCoolingSetpoint:write(mock_device, 2100):to_endpoint(ENDPOINT) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -208,7 +208,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send( { mock_device.id, Thermostat.attributes.SystemMode:write(mock_device, 3):to_endpoint(ENDPOINT) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -219,7 +219,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send( { mock_device.id, FanControl.attributes.FanMode:write(mock_device, 5):to_endpoint(ENDPOINT) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -253,7 +253,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send( { mock_device.id, Thermostat.attributes.LocalTemperature:read(mock_device):to_endpoint(ENDPOINT) }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-thermostat/src/test/test_popp_thermostat.lua b/drivers/SmartThings/zigbee-thermostat/src/test/test_popp_thermostat.lua index d1ae50109d..b351d725bd 100644 --- a/drivers/SmartThings/zigbee-thermostat/src/test/test_popp_thermostat.lua +++ b/drivers/SmartThings/zigbee-thermostat/src/test/test_popp_thermostat.lua @@ -69,7 +69,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -100,7 +100,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -122,7 +122,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -144,7 +144,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -168,7 +168,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -190,7 +190,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -254,7 +254,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -291,7 +291,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -319,7 +319,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -356,7 +356,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -393,7 +393,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -410,7 +410,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.thermostatMode.thermostatMode.eco())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -462,7 +462,7 @@ test.register_coroutine_test( )}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -479,7 +479,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.temperatureAlarm.temperatureAlarm.cleared())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -496,7 +496,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.switch.switch.off())) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-thermostat/src/test/test_resideo_dt300st_m000.lua b/drivers/SmartThings/zigbee-thermostat/src/test/test_resideo_dt300st_m000.lua index 71264c3a99..5a0f8591ed 100644 --- a/drivers/SmartThings/zigbee-thermostat/src/test/test_resideo_dt300st_m000.lua +++ b/drivers/SmartThings/zigbee-thermostat/src/test/test_resideo_dt300st_m000.lua @@ -102,7 +102,7 @@ test.register_coroutine_test("Configure should configure all necessary attribute }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -125,7 +125,7 @@ test.register_coroutine_test("Refresh should read all necessary attributes", fun end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -139,7 +139,7 @@ test.register_coroutine_test("Temperature reporting should create the appropriat }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -156,7 +156,7 @@ test.register_coroutine_test("Thermostat mode reporting should create the approp .thermostatMode.heat())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -172,7 +172,7 @@ test.register_coroutine_test("ControlSequenceOfOperation reporting should create }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -187,7 +187,7 @@ test.register_coroutine_test("OccupiedHeatingSetpoint reporting shoulb create th }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -202,7 +202,7 @@ test.register_coroutine_test("Setting the heating setpoint should generate the a Thermostat.attributes.OccupiedHeatingSetpoint:write(mock_device, 2100)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -218,7 +218,7 @@ test.register_coroutine_test("Setting the thermostat mode to away should generat Thermostat.attributes.SystemMode.OFF)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -234,7 +234,7 @@ test.register_coroutine_test("Setting the thermostat mode to heat should generat Thermostat.attributes.SystemMode.HEAT)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -257,7 +257,7 @@ test.register_coroutine_test("Refresh should read all necessary attributes with end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -271,7 +271,7 @@ test.register_coroutine_test("Temperature reporting should create the appropriat }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -288,7 +288,7 @@ test.register_coroutine_test("Thermostat mode reporting should create the approp .thermostatMode.heat())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -304,7 +304,7 @@ test.register_coroutine_test("ControlSequenceOfOperation reporting should create }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -319,7 +319,7 @@ test.register_coroutine_test("OccupiedHeatingSetpoint reporting shoulb create th }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -334,7 +334,7 @@ test.register_coroutine_test("Setting the heating setpoint should generate the a Thermostat.attributes.OccupiedHeatingSetpoint:write(mock_first_child, 2100)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -350,7 +350,7 @@ test.register_coroutine_test("Setting the thermostat mode to away should generat Thermostat.attributes.SystemMode.OFF)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -366,7 +366,7 @@ test.register_coroutine_test("Setting the thermostat mode to heat should generat Thermostat.attributes.SystemMode.HEAT)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -389,7 +389,7 @@ test.register_coroutine_test("Refresh should read all necessary attributes with end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -403,7 +403,7 @@ test.register_coroutine_test("Temperature reporting should create the appropriat }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -420,7 +420,7 @@ test.register_coroutine_test("Thermostat mode reporting should create the approp .thermostatMode.heat())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -436,7 +436,7 @@ test.register_coroutine_test("ControlSequenceOfOperation reporting should create }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -451,7 +451,7 @@ test.register_coroutine_test("OccupiedHeatingSetpoint reporting shoulb create th }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -466,7 +466,7 @@ test.register_coroutine_test("Setting the heating setpoint should generate the a Thermostat.attributes.OccupiedHeatingSetpoint:write(mock_second_child, 2100)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -482,7 +482,7 @@ test.register_coroutine_test("Setting the thermostat mode to away should generat Thermostat.attributes.SystemMode.OFF)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -498,7 +498,7 @@ test.register_coroutine_test("Setting the thermostat mode to heat should generat Thermostat.attributes.SystemMode.HEAT)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -521,7 +521,7 @@ test.register_coroutine_test("Refresh should read all necessary attributes with end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -535,7 +535,7 @@ test.register_coroutine_test("Temperature reporting should create the appropriat }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -552,7 +552,7 @@ test.register_coroutine_test("Thermostat mode reporting should create the approp .thermostatMode.heat())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -568,7 +568,7 @@ test.register_coroutine_test("ControlSequenceOfOperation reporting should create }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -583,7 +583,7 @@ test.register_coroutine_test("OccupiedHeatingSetpoint reporting shoulb create th }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -598,7 +598,7 @@ test.register_coroutine_test("Setting the heating setpoint should generate the a Thermostat.attributes.OccupiedHeatingSetpoint:write(mock_third_child, 2100)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -614,7 +614,7 @@ test.register_coroutine_test("Setting the thermostat mode to away should generat Thermostat.attributes.SystemMode.OFF)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -630,7 +630,7 @@ test.register_coroutine_test("Setting the thermostat mode to heat should generat Thermostat.attributes.SystemMode.HEAT)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -653,7 +653,7 @@ test.register_coroutine_test("Refresh should read all necessary attributes with end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -667,7 +667,7 @@ test.register_coroutine_test("Temperature reporting should create the appropriat }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -684,7 +684,7 @@ test.register_coroutine_test("Thermostat mode reporting should create the approp .thermostatMode.heat())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -700,7 +700,7 @@ test.register_coroutine_test("ControlSequenceOfOperation reporting should create }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -715,7 +715,7 @@ test.register_coroutine_test("OccupiedHeatingSetpoint reporting shoulb create th }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -730,7 +730,7 @@ test.register_coroutine_test("Setting the heating setpoint should generate the a Thermostat.attributes.OccupiedHeatingSetpoint:write(mock_forth_child, 2100)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -746,7 +746,7 @@ test.register_coroutine_test("Setting the thermostat mode to away should generat Thermostat.attributes.SystemMode.OFF)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -762,7 +762,7 @@ test.register_coroutine_test("Setting the thermostat mode to heat should generat Thermostat.attributes.SystemMode.HEAT)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -785,7 +785,7 @@ test.register_coroutine_test("Refresh should read all necessary attributes with end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -799,7 +799,7 @@ test.register_coroutine_test("Temperature reporting should create the appropriat }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -816,7 +816,7 @@ test.register_coroutine_test("Thermostat mode reporting should create the approp .thermostatMode.heat())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -832,7 +832,7 @@ test.register_coroutine_test("ControlSequenceOfOperation reporting should create }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -847,7 +847,7 @@ test.register_coroutine_test("OccupiedHeatingSetpoint reporting shoulb create th }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -862,7 +862,7 @@ test.register_coroutine_test("Setting the heating setpoint should generate the a Thermostat.attributes.OccupiedHeatingSetpoint:write(mock_fifth_child, 2100)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -878,7 +878,7 @@ test.register_coroutine_test("Setting the thermostat mode to away should generat Thermostat.attributes.SystemMode.OFF)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -894,7 +894,7 @@ test.register_coroutine_test("Setting the thermostat mode to heat should generat Thermostat.attributes.SystemMode.HEAT)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -913,7 +913,7 @@ test.register_coroutine_test("ThermostatRunningState reporting shoulb create the capabilities.thermostatOperatingState.thermostatOperatingState({value="fan only"}))) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-thermostat/src/test/test_sinope_th1300_thermostat.lua b/drivers/SmartThings/zigbee-thermostat/src/test/test_sinope_th1300_thermostat.lua index 271c070df3..8fc50e9706 100644 --- a/drivers/SmartThings/zigbee-thermostat/src/test/test_sinope_th1300_thermostat.lua +++ b/drivers/SmartThings/zigbee-thermostat/src/test/test_sinope_th1300_thermostat.lua @@ -47,7 +47,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -66,7 +66,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -102,7 +102,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -198,7 +198,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-thermostat/src/test/test_sinope_th1400_thermostat.lua b/drivers/SmartThings/zigbee-thermostat/src/test/test_sinope_th1400_thermostat.lua index 55ba5be56c..5d7a679e92 100644 --- a/drivers/SmartThings/zigbee-thermostat/src/test/test_sinope_th1400_thermostat.lua +++ b/drivers/SmartThings/zigbee-thermostat/src/test/test_sinope_th1400_thermostat.lua @@ -47,7 +47,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -66,7 +66,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -102,7 +102,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -208,7 +208,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-thermostat/src/test/test_sinope_thermostat.lua b/drivers/SmartThings/zigbee-thermostat/src/test/test_sinope_thermostat.lua index 2506ca0f2f..a85e50971f 100644 --- a/drivers/SmartThings/zigbee-thermostat/src/test/test_sinope_thermostat.lua +++ b/drivers/SmartThings/zigbee-thermostat/src/test/test_sinope_thermostat.lua @@ -47,7 +47,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -66,7 +66,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -102,7 +102,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -182,7 +182,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -212,7 +212,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-thermostat/src/test/test_stelpro_ki_zigbee_thermostat.lua b/drivers/SmartThings/zigbee-thermostat/src/test/test_stelpro_ki_zigbee_thermostat.lua index 470bb1378d..da890c2b11 100644 --- a/drivers/SmartThings/zigbee-thermostat/src/test/test_stelpro_ki_zigbee_thermostat.lua +++ b/drivers/SmartThings/zigbee-thermostat/src/test/test_stelpro_ki_zigbee_thermostat.lua @@ -59,7 +59,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -78,7 +78,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -102,7 +102,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -126,7 +126,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -150,7 +150,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -169,7 +169,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -188,7 +188,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -210,7 +210,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -242,7 +242,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", ThermostatOperatingState.thermostatOperatingState("idle"))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -265,7 +265,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", ThermostatMode.thermostatMode.heat())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -298,7 +298,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -331,7 +331,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -423,7 +423,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -508,7 +508,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -531,7 +531,7 @@ test.register_coroutine_test("Setting the heating setpoint should generate the a }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -563,7 +563,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) test.register_coroutine_test( @@ -588,7 +588,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -615,7 +615,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-thermostat/src/test/test_stelpro_thermostat.lua b/drivers/SmartThings/zigbee-thermostat/src/test/test_stelpro_thermostat.lua index 208949090c..bc0b3933c0 100644 --- a/drivers/SmartThings/zigbee-thermostat/src/test/test_stelpro_thermostat.lua +++ b/drivers/SmartThings/zigbee-thermostat/src/test/test_stelpro_thermostat.lua @@ -51,7 +51,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -75,7 +75,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -99,7 +99,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -133,7 +133,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -167,7 +167,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -190,7 +190,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -213,7 +213,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -237,7 +237,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -256,7 +256,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -275,7 +275,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -294,7 +294,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -313,7 +313,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -355,7 +355,7 @@ test.register_coroutine_test( test.socket.zigbee:__set_channel_ordering("relaxed") end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -400,7 +400,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -440,7 +440,7 @@ test.register_coroutine_test( test.socket.zigbee:__set_channel_ordering("relaxed") end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -485,7 +485,7 @@ test.register_coroutine_test( mock_device_maestro:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -500,7 +500,7 @@ test.register_coroutine_test( test.socket.device_lifecycle:__queue_receive(mock_device:generate_info_changed({preferences = { lock = 1 } })) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -513,7 +513,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -551,7 +551,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-thermostat/src/test/test_vimar_thermostat.lua b/drivers/SmartThings/zigbee-thermostat/src/test/test_vimar_thermostat.lua index afbe34524b..9ba03896e8 100644 --- a/drivers/SmartThings/zigbee-thermostat/src/test/test_vimar_thermostat.lua +++ b/drivers/SmartThings/zigbee-thermostat/src/test/test_vimar_thermostat.lua @@ -87,7 +87,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -118,7 +118,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -149,7 +149,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -188,7 +188,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -227,7 +227,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -269,7 +269,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -311,7 +311,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -375,7 +375,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -415,7 +415,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -454,7 +454,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -496,7 +496,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -538,7 +538,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -602,7 +602,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -637,7 +637,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -671,7 +671,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -730,7 +730,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -790,7 +790,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -820,7 +820,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -850,7 +850,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-thermostat/src/test/test_zenwithin_thermostat.lua b/drivers/SmartThings/zigbee-thermostat/src/test/test_zenwithin_thermostat.lua index 947923e33f..ddd240a0e0 100644 --- a/drivers/SmartThings/zigbee-thermostat/src/test/test_zenwithin_thermostat.lua +++ b/drivers/SmartThings/zigbee-thermostat/src/test/test_zenwithin_thermostat.lua @@ -49,7 +49,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -69,7 +69,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) test.register_message_test( @@ -88,7 +88,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -108,7 +108,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -149,7 +149,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -211,7 +211,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -291,7 +291,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -426,7 +426,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -461,7 +461,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -476,7 +476,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -519,7 +519,372 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 + } +) + +test.register_coroutine_test( + "MinHeatSetpointLimit report stores device field", + function () + test.socket.zigbee:__queue_receive({ + mock_device.id, + Thermostat.attributes.MinHeatSetpointLimit:build_test_attr_report(mock_device, 500) + }) + test.wait_for_events() + assert(mock_device:get_field("minHeatSetpoint") == 500, "minHeatSetpoint field not stored correctly") + end, + { + min_api_version = 14 + } +) + +test.register_coroutine_test( + "MaxHeatSetpointLimit report stores device field", + function () + test.socket.zigbee:__queue_receive({ + mock_device.id, + Thermostat.attributes.MaxHeatSetpointLimit:build_test_attr_report(mock_device, 3500) + }) + test.wait_for_events() + assert(mock_device:get_field("maxHeatSetpoint") == 3500, "maxHeatSetpoint field not stored correctly") + end, + { + min_api_version = 14 + } +) + +test.register_coroutine_test( + "MinCoolSetpointLimit report stores device field", + function () + test.socket.zigbee:__queue_receive({ + mock_device.id, + Thermostat.attributes.MinCoolSetpointLimit:build_test_attr_report(mock_device, 1600) + }) + test.wait_for_events() + assert(mock_device:get_field("minCoolSetpoint") == 1600, "minCoolSetpoint field not stored correctly") + end, + { + min_api_version = 14 + } +) + +test.register_coroutine_test( + "MaxCoolSetpointLimit report stores device field", + function () + test.socket.zigbee:__queue_receive({ + mock_device.id, + Thermostat.attributes.MaxCoolSetpointLimit:build_test_attr_report(mock_device, 3200) + }) + test.wait_for_events() + assert(mock_device:get_field("maxCoolSetpoint") == 3200, "maxCoolSetpoint field not stored correctly") + end, + { + min_api_version = 14 + } +) + +test.register_coroutine_test( + "Heating setpoint is clamped to MinHeatSetpointLimit", + function() + -- Receive MinHeatSetpointLimit = 18.0 C (1800 centidegrees) + test.socket.zigbee:__queue_receive({ + mock_device.id, + Thermostat.attributes.MinHeatSetpointLimit:build_test_attr_report(mock_device, 1800) + }) + test.wait_for_events() + + -- Put device in heat mode so the setpoint is applied immediately + test.socket.zigbee:__queue_receive({ + mock_device.id, + Thermostat.attributes.SystemMode:build_test_attr_report(mock_device, 0x04) -- HEAT + }) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.thermostatMode.thermostatMode.heat()) + ) + test.wait_for_events() + + -- Try to set heating setpoint below the stored min (16 C < 18 C); expect it clamped to 18 C + test.timer.__create_and_queue_test_time_advance_timer(2, "oneshot") + test.socket.capability:__queue_receive({ + mock_device.id, + { capability = "thermostatHeatingSetpoint", component = "main", command = "setHeatingSetpoint", args = { 16 } } + }) + test.socket.zigbee:__expect_send({ + mock_device.id, + Thermostat.attributes.OccupiedHeatingSetpoint:write(mock_device, 1800) -- clamped to 18.0 C + }) + test.mock_time.advance_time(2) + test.wait_for_events() + end, + { + min_api_version = 14 + } +) + +test.register_coroutine_test( + "Heating setpoint is clamped to MaxHeatSetpointLimit", + function() + -- Receive MaxHeatSetpointLimit = 30.0 C (3000 centidegrees) + test.socket.zigbee:__queue_receive({ + mock_device.id, + Thermostat.attributes.MaxHeatSetpointLimit:build_test_attr_report(mock_device, 3000) + }) + test.wait_for_events() + + -- Put device in heat mode + test.socket.zigbee:__queue_receive({ + mock_device.id, + Thermostat.attributes.SystemMode:build_test_attr_report(mock_device, 0x04) -- HEAT + }) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.thermostatMode.thermostatMode.heat()) + ) + test.wait_for_events() + + -- Try to set heating setpoint above the stored max (35 C > 30 C); expect it clamped to 30 C + test.timer.__create_and_queue_test_time_advance_timer(2, "oneshot") + test.socket.capability:__queue_receive({ + mock_device.id, + { capability = "thermostatHeatingSetpoint", component = "main", command = "setHeatingSetpoint", args = { 35 } } + }) + test.socket.zigbee:__expect_send({ + mock_device.id, + Thermostat.attributes.OccupiedHeatingSetpoint:write(mock_device, 3000) -- clamped to 30.0 C + }) + test.mock_time.advance_time(2) + test.wait_for_events() + end, + { + min_api_version = 14 + } +) + +test.register_coroutine_test( + "Cooling setpoint is clamped to MinCoolSetpointLimit", + function() + -- Receive MinCoolSetpointLimit = 18.0 C (1800 centidegrees) + test.socket.zigbee:__queue_receive({ + mock_device.id, + Thermostat.attributes.MinCoolSetpointLimit:build_test_attr_report(mock_device, 1800) + }) + test.wait_for_events() + + -- Put device in cool mode so the setpoint is applied immediately + test.socket.zigbee:__queue_receive({ + mock_device.id, + Thermostat.attributes.SystemMode:build_test_attr_report(mock_device, 0x03) -- COOL + }) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.thermostatMode.thermostatMode.cool()) + ) + test.wait_for_events() + + -- Try to set cooling setpoint below the stored min (16 C < 18 C); expect it clamped to 18 C + test.socket.capability:__queue_receive({ + mock_device.id, + { capability = "thermostatCoolingSetpoint", component = "main", command = "setCoolingSetpoint", args = { 16 } } + }) + test.socket.zigbee:__expect_send({ + mock_device.id, + Thermostat.attributes.OccupiedCoolingSetpoint:write(mock_device, 1800) -- clamped to 18.0 C + }) + test.wait_for_events() + end, + { + min_api_version = 14 + } +) + +test.register_coroutine_test( + "Cooling setpoint is clamped to MaxCoolSetpointLimit", + function() + -- Receive MaxCoolSetpointLimit = 30.0 C (3000 centidegrees) + test.socket.zigbee:__queue_receive({ + mock_device.id, + Thermostat.attributes.MaxCoolSetpointLimit:build_test_attr_report(mock_device, 3000) + }) + test.wait_for_events() + + -- Put device in cool mode + test.socket.zigbee:__queue_receive({ + mock_device.id, + Thermostat.attributes.SystemMode:build_test_attr_report(mock_device, 0x03) -- COOL + }) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.thermostatMode.thermostatMode.cool()) + ) + test.wait_for_events() + + -- Try to set cooling setpoint above the stored max (35 C > 30 C); expect it clamped to 30 C + test.socket.capability:__queue_receive({ + mock_device.id, + { capability = "thermostatCoolingSetpoint", component = "main", command = "setCoolingSetpoint", args = { 35 } } + }) + test.socket.zigbee:__expect_send({ + mock_device.id, + Thermostat.attributes.OccupiedCoolingSetpoint:write(mock_device, 3000) -- clamped to 30.0 C + }) + test.wait_for_events() + end, + { + min_api_version = 14 + } +) + +-- Integration test: full set_cooling_setpoint clamping path +-- +-- Exercises every branch in set_cooling_setpoint that involves get_field / default: +-- +-- Phase 1 – no limit fields present yet → clamp uses DEFAULT_MIN (4.0) / DEFAULT_MAX (37.5) +-- A value already inside the defaults passes through unchanged. +-- A value above DEFAULT_MAX is clamped down to 37.5 C. +-- +-- Phase 2 – device reports MinCoolSetpointLimit (20.0 C) and MaxCoolSetpointLimit (28.0 C) +-- stored via setpoint_limit_handler → get_field now returns real device limits. +-- A value inside those limits passes through unchanged. +-- A value below MinCoolSetpointLimit is clamped up to 20.0 C. +-- A value above MaxCoolSetpointLimit is clamped down to 28.0 C. +-- +-- Phase 3 – device switches to heat mode. +-- setCoolingSetpoint is rejected: driver defers with 10s backstop, +-- then re-emits the last known cooling setpoint without writing to the device. +test.register_coroutine_test( + "set_cooling_setpoint: default clamp, then device-reported limit clamp, then heat-mode rejection", + function() + -- ── Phase 1: no limit fields – defaults apply ───────────────────────────── + + -- Put device in cool mode so setpoints are applied immediately throughout phase 1 & 2 + test.socket.zigbee:__queue_receive({ + mock_device.id, + Thermostat.attributes.SystemMode:build_test_attr_report(mock_device, 0x03) -- COOL + }) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.thermostatMode.thermostatMode.cool()) + ) + test.wait_for_events() + + -- 1a. Value within defaults (25 C): written as-is + test.socket.capability:__queue_receive({ + mock_device.id, + { capability = "thermostatCoolingSetpoint", component = "main", command = "setCoolingSetpoint", args = { 25 } } + }) + test.socket.zigbee:__expect_send({ + mock_device.id, + Thermostat.attributes.OccupiedCoolingSetpoint:write(mock_device, 2500) + }) + test.wait_for_events() + + -- Establish the device's reported current cooling setpoint state (needed later for re-emit) + test.socket.zigbee:__queue_receive({ + mock_device.id, + Thermostat.attributes.OccupiedCoolingSetpoint:build_test_attr_report(mock_device, 2500) + }) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.thermostatCoolingSetpoint.coolingSetpoint({ value = 25.0, unit = "C" })) + ) + test.wait_for_events() + + -- 1b. Value above DEFAULT_MAX (38 C > 37.5 C): clamped to 37.5 C → written as 3750 + test.socket.capability:__queue_receive({ + mock_device.id, + { capability = "thermostatCoolingSetpoint", component = "main", command = "setCoolingSetpoint", args = { 38 } } + }) + test.socket.zigbee:__expect_send({ + mock_device.id, + Thermostat.attributes.OccupiedCoolingSetpoint:write(mock_device, 3750) + }) + test.wait_for_events() + + -- ── Phase 2: device reports real limits; get_field overrides defaults ────── + + -- Device sends MinCoolSetpointLimit = 20.0 C and MaxCoolSetpointLimit = 28.0 C + test.socket.zigbee:__queue_receive({ + mock_device.id, + Thermostat.attributes.MinCoolSetpointLimit:build_test_attr_report(mock_device, 2000) + }) + test.wait_for_events() + + test.socket.zigbee:__queue_receive({ + mock_device.id, + Thermostat.attributes.MaxCoolSetpointLimit:build_test_attr_report(mock_device, 2800) + }) + test.wait_for_events() + + -- 2a. Value inside device limits (24 C): written as-is + test.socket.capability:__queue_receive({ + mock_device.id, + { capability = "thermostatCoolingSetpoint", component = "main", command = "setCoolingSetpoint", args = { 24 } } + }) + test.socket.zigbee:__expect_send({ + mock_device.id, + Thermostat.attributes.OccupiedCoolingSetpoint:write(mock_device, 2400) + }) + test.wait_for_events() + + -- 2b. Value below device MinCoolSetpointLimit (18 C < 20 C): clamped to 20.0 C + -- (18 is above DEFAULT_MIN of 4.0, proving the device field is used, not the default) + test.socket.capability:__queue_receive({ + mock_device.id, + { capability = "thermostatCoolingSetpoint", component = "main", command = "setCoolingSetpoint", args = { 18 } } + }) + test.socket.zigbee:__expect_send({ + mock_device.id, + Thermostat.attributes.OccupiedCoolingSetpoint:write(mock_device, 2000) + }) + test.wait_for_events() + + -- 2c. Value above device MaxCoolSetpointLimit (30 C > 28 C): clamped to 28.0 C + -- (30 is below DEFAULT_MAX of 37.5, proving the device field is used, not the default) + test.socket.capability:__queue_receive({ + mock_device.id, + { capability = "thermostatCoolingSetpoint", component = "main", command = "setCoolingSetpoint", args = { 30 } } + }) + test.socket.zigbee:__expect_send({ + mock_device.id, + Thermostat.attributes.OccupiedCoolingSetpoint:write(mock_device, 2800) + }) + test.wait_for_events() + + -- ── Phase 3: device switches to heat mode; setCoolingSetpoint is deferred ── + + -- Re-establish a known current cooling setpoint for the re-emit assertion + test.socket.zigbee:__queue_receive({ + mock_device.id, + Thermostat.attributes.OccupiedCoolingSetpoint:build_test_attr_report(mock_device, 2400) + }) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.thermostatCoolingSetpoint.coolingSetpoint({ value = 24.0, unit = "C" })) + ) + test.wait_for_events() + + test.socket.zigbee:__queue_receive({ + mock_device.id, + Thermostat.attributes.SystemMode:build_test_attr_report(mock_device, 0x04) -- HEAT + }) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.thermostatMode.thermostatMode.heat()) + ) + test.wait_for_events() + + -- 3. setCoolingSetpoint while in heat mode: driver stores the field (clamped to 24 C by + -- device limits), then takes the else-branch and arms the 10s backstop timer. + -- After the timer fires, update_device_setpoint detects heat mode, discards the pending + -- cooling value, and re-emits the last reported cooling setpoint (24.0 C) unchanged. + test.timer.__create_and_queue_test_time_advance_timer(10, "oneshot") + test.socket.capability:__queue_receive({ + mock_device.id, + { capability = "thermostatCoolingSetpoint", component = "main", command = "setCoolingSetpoint", args = { 24 } } + }) + test.wait_for_events() + + test.mock_time.advance_time(10) + test.socket.capability:__expect_send( + mock_device:generate_test_message("main", capabilities.thermostatCoolingSetpoint.coolingSetpoint({ value = 24.0, unit = "C" })) + ) + test.wait_for_events() + end, + { + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-thermostat/src/test/test_zigbee_thermostat.lua b/drivers/SmartThings/zigbee-thermostat/src/test/test_zigbee_thermostat.lua index e954e05a8a..40f8a58e2d 100644 --- a/drivers/SmartThings/zigbee-thermostat/src/test/test_zigbee_thermostat.lua +++ b/drivers/SmartThings/zigbee-thermostat/src/test/test_zigbee_thermostat.lua @@ -38,7 +38,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -58,7 +58,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -85,7 +85,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -105,7 +105,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -124,7 +124,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -148,7 +148,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -168,7 +168,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -188,7 +188,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -219,7 +219,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -250,7 +250,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -275,7 +275,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -300,7 +300,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -320,7 +320,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -361,7 +361,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -381,7 +381,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -412,7 +412,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -443,7 +443,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -474,7 +474,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -505,7 +505,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -535,7 +535,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -566,7 +566,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -597,7 +597,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -643,7 +643,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -785,7 +785,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -911,7 +911,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -931,7 +931,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-thermostat/src/test/test_zigbee_thermostat_wallhero_3in1.lua b/drivers/SmartThings/zigbee-thermostat/src/test/test_zigbee_thermostat_wallhero_3in1.lua index a93a3a36ee..b258d14727 100644 --- a/drivers/SmartThings/zigbee-thermostat/src/test/test_zigbee_thermostat_wallhero_3in1.lua +++ b/drivers/SmartThings/zigbee-thermostat/src/test/test_zigbee_thermostat_wallhero_3in1.lua @@ -212,7 +212,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -233,7 +233,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -253,7 +253,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -273,7 +273,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -293,7 +293,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -313,7 +313,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -333,7 +333,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -353,7 +353,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -373,7 +373,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -393,7 +393,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -413,7 +413,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -433,7 +433,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -453,7 +453,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -473,7 +473,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -493,7 +493,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -513,7 +513,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -533,7 +533,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -553,7 +553,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -573,7 +573,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -593,7 +593,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -613,7 +613,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -633,7 +633,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -652,7 +652,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -671,7 +671,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -690,7 +690,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -709,7 +709,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -728,7 +728,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -747,7 +747,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -766,7 +766,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -785,7 +785,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -804,7 +804,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -823,7 +823,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -842,7 +842,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -861,7 +861,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -880,7 +880,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -899,7 +899,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -918,7 +918,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -937,7 +937,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -956,7 +956,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -975,7 +975,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -994,7 +994,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1013,7 +1013,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1233,7 +1233,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-thermostat/src/zenwithin/init.lua b/drivers/SmartThings/zigbee-thermostat/src/zenwithin/init.lua index 1b71db2609..f39da8afe5 100644 --- a/drivers/SmartThings/zigbee-thermostat/src/zenwithin/init.lua +++ b/drivers/SmartThings/zigbee-thermostat/src/zenwithin/init.lua @@ -28,9 +28,9 @@ local HEATING_SETPOINT = "heatingSetpoint" local BAT_MIN = 3.4 -- voltage when device UI starts to die, ie, when battery fails local BAT_MAX = 6.0 -- 4 batteries at 1.5V (6.0V) -local DEFAULT_MIN_SETPOINT = 4.0 -local DEFAULT_MAX_SETPOINT = 37.5 - +local DEFAULT_MIN_SETPOINT = 400 -- 4.0C +local DEFAULT_MAX_SETPOINT = 3750 -- 37.5C +local FAHRENHEIT_THRESHOLD = 40 -- 40C -- In zenwithin sub driver, supported thermostat mode follow preference option because sensor always returns 'all mode possible' local SUPPORTED_THERMOSTAT_MODES = { [0x01] = { ModeAttribute.off.NAME, ModeAttribute.heat.NAME }, @@ -93,11 +93,12 @@ local update_device_setpoint = function(device) local current_mode = device:get_latest_state("main", ThermostatMode.ID, ModeAttribute.NAME) if (current_mode == ModeAttribute.heat.NAME or current_mode == ModeAttribute.emergency_heat.NAME) and cooling_setpoint ~= nil then - cooling_setpoint = device:get_latest_state("main", ThermostatCoolingSetpoint.ID, ThermostatCoolingSetpoint.coolingSetpoint.NAME) -- tried to set cooling setpoint while device was in heat mode + cooling_setpoint = device:get_latest_state("main", ThermostatCoolingSetpoint.ID, ThermostatCoolingSetpoint.coolingSetpoint.NAME) device:emit_event(ThermostatCoolingSetpoint.coolingSetpoint({value = cooling_setpoint, unit = "C"})) cooling_setpoint = nil elseif (current_mode == ModeAttribute.cool.NAME) and heating_setpoint ~= nil then + -- tried to set heating setpoint while device was in cool mode heating_setpoint = device:get_latest_state("main", ThermostatHeatingSetpoint.ID, ThermostatHeatingSetpoint.heatingSetpoint.NAME) device:emit_event(ThermostatHeatingSetpoint.heatingSetpoint({value = heating_setpoint, unit = "C"})) heating_setpoint = nil @@ -108,22 +109,23 @@ local update_device_setpoint = function(device) end if (heating_setpoint ~= nil) then - device:send(Thermostat.attributes.OccupiedHeatingSetpoint:write(device, utils.round(heating_setpoint*100))) + device:send(Thermostat.attributes.OccupiedHeatingSetpoint:write(device, utils.round(heating_setpoint))) end if (cooling_setpoint ~= nil) then - device:send(Thermostat.attributes.OccupiedCoolingSetpoint:write(device, utils.round(cooling_setpoint*100))) + device:send(Thermostat.attributes.OccupiedCoolingSetpoint:write(device, utils.round(cooling_setpoint))) end end local set_cooling_setpoint = function(driver, device, command) local value = command.args.setpoint - if value >= 40 then -- we got a command in fahrenheit + if value >= FAHRENHEIT_THRESHOLD then -- we got a command in fahrenheit value = utils.f_to_c(value) end - value = utils.clamp_value(value, - device:get_field(MIN_HEAT_LIMIT) or DEFAULT_MIN_SETPOINT, - device:get_field(MAX_HEAT_LIMIT) or DEFAULT_MAX_SETPOINT) + -- Scale up to centidegrees to align with the rest of the values + value = utils.clamp_value(value * 100, + device:get_field(MIN_COOL_LIMIT) or DEFAULT_MIN_SETPOINT, + device:get_field(MAX_COOL_LIMIT) or DEFAULT_MAX_SETPOINT) device:set_field(COOLING_SETPOINT, value) local current_mode = device:get_latest_state("main", ThermostatMode.ID, ModeAttribute.NAME) if current_mode == ModeAttribute.cool.NAME or current_mode == ModeAttribute.auto.NAME then @@ -138,10 +140,11 @@ end local set_heating_setpoint = function(driver, device, command) local value = command.args.setpoint - if value >= 40 then -- we got a command in fahrenheit + if value >= FAHRENHEIT_THRESHOLD then -- we got a command in fahrenheit value = utils.f_to_c(value) end - value = utils.clamp_value(value, + -- Scale up to centidegrees to align with the rest of the values + value = utils.clamp_value(value * 100, device:get_field(MIN_HEAT_LIMIT) or DEFAULT_MIN_SETPOINT, device:get_field(MAX_HEAT_LIMIT) or DEFAULT_MAX_SETPOINT) device:set_field(HEATING_SETPOINT, value) diff --git a/drivers/SmartThings/zigbee-valve/src/test/test_ezex_valve.lua b/drivers/SmartThings/zigbee-valve/src/test/test_ezex_valve.lua index d9db636eab..013e79a828 100644 --- a/drivers/SmartThings/zigbee-valve/src/test/test_ezex_valve.lua +++ b/drivers/SmartThings/zigbee-valve/src/test/test_ezex_valve.lua @@ -47,7 +47,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -68,7 +68,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -87,7 +87,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -106,7 +106,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -126,7 +126,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -146,7 +146,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -166,7 +166,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -186,7 +186,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -205,7 +205,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -224,7 +224,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -272,7 +272,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -314,7 +314,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -353,7 +353,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-valve/src/test/test_sinope_valve.lua b/drivers/SmartThings/zigbee-valve/src/test/test_sinope_valve.lua index 9ba28f751e..c081d0ab40 100644 --- a/drivers/SmartThings/zigbee-valve/src/test/test_sinope_valve.lua +++ b/drivers/SmartThings/zigbee-valve/src/test/test_sinope_valve.lua @@ -49,7 +49,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -97,7 +97,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -120,7 +120,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -131,7 +131,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_device:generate_test_message("main", capabilities.battery.battery(20)) ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -142,7 +142,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_device:generate_test_message("main", capabilities.battery.battery(0)) ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -153,7 +153,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_device:generate_test_message("main", capabilities.battery.battery(100)) ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-valve/src/test/test_zigbee_valve.lua b/drivers/SmartThings/zigbee-valve/src/test/test_zigbee_valve.lua index 72038fdb37..36eb70de1d 100644 --- a/drivers/SmartThings/zigbee-valve/src/test/test_zigbee_valve.lua +++ b/drivers/SmartThings/zigbee-valve/src/test/test_zigbee_valve.lua @@ -47,7 +47,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -68,7 +68,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -87,7 +87,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -107,7 +107,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -127,7 +127,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -147,7 +147,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -167,7 +167,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -186,7 +186,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -205,7 +205,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -254,7 +254,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -296,7 +296,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -335,7 +335,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-vent/src/test/test_zigbee_vent.lua b/drivers/SmartThings/zigbee-vent/src/test/test_zigbee_vent.lua index 26420c997b..d4781ddfd3 100644 --- a/drivers/SmartThings/zigbee-vent/src/test/test_zigbee_vent.lua +++ b/drivers/SmartThings/zigbee-vent/src/test/test_zigbee_vent.lua @@ -61,7 +61,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -81,7 +81,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -101,7 +101,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -119,7 +119,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({mock_device.id, Level.attributes.CurrentLevel:read(mock_device)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -138,7 +138,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -162,7 +162,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -241,7 +241,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -299,7 +299,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -320,7 +320,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({mock_device.id, Level.commands.MoveToLevelWithOnOff(mock_device, math.floor(83 / 100 * 254), 0xFFFF)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -333,7 +333,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.battery.battery(50))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -345,7 +345,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.atmosphericPressureMeasurement.atmosphericPressure({value = 1, unit = "kPa"}))) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_aqara_water_leak_sensor.lua b/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_aqara_water_leak_sensor.lua index 51be73b5b3..06f558bdcd 100644 --- a/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_aqara_water_leak_sensor.lua +++ b/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_aqara_water_leak_sensor.lua @@ -53,7 +53,7 @@ test.register_coroutine_test( data_types.Uint8, 1) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -80,7 +80,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -107,7 +107,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -126,7 +126,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_centralite_water_leak_sensor.lua b/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_centralite_water_leak_sensor.lua index d92293d30e..a5acbfb81e 100644 --- a/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_centralite_water_leak_sensor.lua +++ b/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_centralite_water_leak_sensor.lua @@ -48,7 +48,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, TemperatureMeasurement.attributes.MeasuredValue:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -110,7 +110,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -129,7 +129,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -148,7 +148,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -167,7 +167,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -186,7 +186,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -213,7 +213,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -240,7 +240,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -272,7 +272,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_frient_water_leak_sensor.lua b/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_frient_water_leak_sensor.lua index ba6361bc9d..6c0881c715 100644 --- a/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_frient_water_leak_sensor.lua +++ b/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_frient_water_leak_sensor.lua @@ -48,7 +48,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, TemperatureMeasurement.attributes.MeasuredValue:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -116,7 +116,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -135,7 +135,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -154,7 +154,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -173,7 +173,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -192,7 +192,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -219,7 +219,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -246,7 +246,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -278,7 +278,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_leaksmart_water.lua b/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_leaksmart_water.lua index 140608bfcc..47c17f4c2f 100644 --- a/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_leaksmart_water.lua +++ b/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_leaksmart_water.lua @@ -42,7 +42,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.waterSensor.water.wet())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -54,7 +54,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.waterSensor.water.dry())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -66,7 +66,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.waterSensor.water.dry())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -78,7 +78,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.waterSensor.water.dry())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -90,7 +90,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.waterSensor.water.dry())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -103,7 +103,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -169,7 +169,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_samjin_water_leak_sensor.lua b/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_samjin_water_leak_sensor.lua index 7b28197ad6..bc941ebfdb 100644 --- a/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_samjin_water_leak_sensor.lua +++ b/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_samjin_water_leak_sensor.lua @@ -48,7 +48,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, TemperatureMeasurement.attributes.MeasuredValue:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -110,7 +110,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -129,7 +129,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -148,7 +148,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -175,7 +175,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -202,7 +202,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -234,7 +234,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_sengled_water_leak_sensor.lua b/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_sengled_water_leak_sensor.lua index 1e7c70eba1..5c2764ebe7 100644 --- a/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_sengled_water_leak_sensor.lua +++ b/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_sengled_water_leak_sensor.lua @@ -45,7 +45,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, PowerConfiguration.attributes.BatteryVoltage:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -96,7 +96,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_sinope_zigbee_water.lua b/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_sinope_zigbee_water.lua index 2a6fd6be79..c7b8f35247 100644 --- a/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_sinope_zigbee_water.lua +++ b/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_sinope_zigbee_water.lua @@ -48,7 +48,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -67,7 +67,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -86,7 +86,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -105,7 +105,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -124,7 +124,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -151,7 +151,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -170,7 +170,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -313,7 +313,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -376,7 +376,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_smartthings_water_leak_sensor.lua b/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_smartthings_water_leak_sensor.lua index e550d7d246..bde19b9206 100644 --- a/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_smartthings_water_leak_sensor.lua +++ b/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_smartthings_water_leak_sensor.lua @@ -48,7 +48,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, TemperatureMeasurement.attributes.MeasuredValue:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -110,7 +110,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -143,7 +143,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -170,7 +170,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -197,7 +197,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -229,7 +229,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_thirdreality_water_leak_sensor.lua b/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_thirdreality_water_leak_sensor.lua index e3946056f4..8056969142 100644 --- a/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_thirdreality_water_leak_sensor.lua +++ b/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_thirdreality_water_leak_sensor.lua @@ -43,7 +43,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({mock_device.id, Basic.attributes.ApplicationVersion:read(mock_device)}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -56,7 +56,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, PowerConfiguration.attributes.BatteryPercentageRemaining:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -81,7 +81,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -106,7 +106,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -131,7 +131,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -156,7 +156,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_zigbee_water.lua b/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_zigbee_water.lua index bf6bb7c4a9..bda51e2655 100644 --- a/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_zigbee_water.lua +++ b/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_zigbee_water.lua @@ -46,7 +46,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -73,7 +73,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -100,7 +100,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -127,7 +127,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -154,7 +154,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -184,7 +184,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -203,7 +203,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -346,7 +346,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -409,7 +409,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_zigbee_water_freeze.lua b/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_zigbee_water_freeze.lua index a8e951661f..a718ea0b75 100644 --- a/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_zigbee_water_freeze.lua +++ b/drivers/SmartThings/zigbee-water-leak-sensor/src/test/test_zigbee_water_freeze.lua @@ -54,7 +54,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -78,7 +78,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -102,7 +102,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -226,7 +226,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -289,7 +289,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-watering-kit/src/test/test_thirdreality_watering_kit.lua b/drivers/SmartThings/zigbee-watering-kit/src/test/test_thirdreality_watering_kit.lua index 53118b5bff..fdb72d3d0c 100644 --- a/drivers/SmartThings/zigbee-watering-kit/src/test/test_thirdreality_watering_kit.lua +++ b/drivers/SmartThings/zigbee-watering-kit/src/test/test_thirdreality_watering_kit.lua @@ -48,7 +48,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.mode.mode("0"))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -67,7 +67,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -86,7 +86,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -105,7 +105,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -124,7 +124,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -143,7 +143,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -162,7 +162,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -181,7 +181,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -198,7 +198,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.fanSpeed.fanSpeed(10))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -215,7 +215,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.fanSpeed.fanSpeed(30))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -232,7 +232,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.mode.mode("4"))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -244,7 +244,7 @@ test.register_coroutine_test( THIRDREALITY_WATERING_CLUSTER, WATERING_TIME_ATTR, 0x1407, data_types.Uint16, 20) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -256,7 +256,7 @@ test.register_coroutine_test( THIRDREALITY_WATERING_CLUSTER, WATERING_INTERVAL_ATTR, 0x1407, data_types.Uint8, 2) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -275,7 +275,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -294,7 +294,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -311,7 +311,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.fanSpeed.fanSpeed(0))) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-aqara-curtain-driver-e1.yml b/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-aqara-curtain-driver-e1.yml index dbd219e523..05e3fe0085 100644 --- a/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-aqara-curtain-driver-e1.yml +++ b/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-aqara-curtain-driver-e1.yml @@ -6,6 +6,8 @@ components: version: 1 - id: windowShadeLevel version: 1 + - id: statelessWindowShadeLevelStep + version: 1 - id: stse.initializedStateWithGuide version: 1 - id: stse.hookLockState diff --git a/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-aqara-roller-shade-rotate.yml b/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-aqara-roller-shade-rotate.yml index c454c4d590..e7f5e8d8af 100644 --- a/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-aqara-roller-shade-rotate.yml +++ b/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-aqara-roller-shade-rotate.yml @@ -6,6 +6,8 @@ components: version: 1 - id: windowShadeLevel version: 1 + - id: statelessWindowShadeLevelStep + version: 1 - id: stse.initializedStateWithGuide version: 1 - id: stse.shadeRotateState diff --git a/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-aqara.yml b/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-aqara.yml index 6c2cc967e7..4dc959ef93 100644 --- a/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-aqara.yml +++ b/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-aqara.yml @@ -6,6 +6,8 @@ components: version: 1 - id: windowShadeLevel version: 1 + - id: statelessWindowShadeLevelStep + version: 1 - id: stse.deviceInitialization version: 1 - id: firmwareUpdate diff --git a/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-battery.yml b/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-battery.yml index be0ae73d76..e9b6178ff8 100644 --- a/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-battery.yml +++ b/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-battery.yml @@ -8,6 +8,8 @@ components: version: 1 - id: windowShadeLevel version: 1 + - id: statelessWindowShadeLevelStep + version: 1 - id: battery version: 1 - id: firmwareUpdate diff --git a/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-no-preset.yml b/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-no-preset.yml index 7a65434c46..67ba3c186d 100644 --- a/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-no-preset.yml +++ b/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-no-preset.yml @@ -8,6 +8,8 @@ components: version: 1 - id: windowShadeLevel version: 1 + - id: statelessWindowShadeLevelStep + version: 1 - id: firmwareUpdate version: 1 - id: refresh diff --git a/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-powerSource.yml b/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-powerSource.yml index 7323ee0218..d72dc33308 100644 --- a/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-powerSource.yml +++ b/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-powerSource.yml @@ -6,6 +6,8 @@ components: version: 1 - id: windowShadeLevel version: 1 + - id: statelessWindowShadeLevelStep + version: 1 - id: windowShadePreset version: 1 - id: powerSource diff --git a/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-profile-no-firmware-update.yml b/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-profile-no-firmware-update.yml index 8e641e6b42..dfeeed7aa1 100644 --- a/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-profile-no-firmware-update.yml +++ b/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-profile-no-firmware-update.yml @@ -8,6 +8,8 @@ components: version: 1 - id: windowShadeLevel version: 1 + - id: statelessWindowShadeLevelStep + version: 1 - id: refresh version: 1 categories: diff --git a/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-profile.yml b/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-profile.yml index b10a5ea101..c9fce872c0 100644 --- a/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-profile.yml +++ b/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-profile.yml @@ -8,6 +8,8 @@ components: version: 1 - id: windowShadeLevel version: 1 + - id: statelessWindowShadeLevelStep + version: 1 - id: firmwareUpdate version: 1 - id: refresh diff --git a/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-reverse.yml b/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-reverse.yml index 0eb666a5d2..54b4312210 100644 --- a/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-reverse.yml +++ b/drivers/SmartThings/zigbee-window-treatment/profiles/window-treatment-reverse.yml @@ -6,6 +6,8 @@ components: version: 1 - id: windowShadeLevel version: 1 + - id: statelessWindowShadeLevelStep + version: 1 - id: windowShadePreset version: 1 - id: firmwareUpdate diff --git a/drivers/SmartThings/zigbee-window-treatment/src/init.lua b/drivers/SmartThings/zigbee-window-treatment/src/init.lua index 0a093645f8..b58c20a5be 100644 --- a/drivers/SmartThings/zigbee-window-treatment/src/init.lua +++ b/drivers/SmartThings/zigbee-window-treatment/src/init.lua @@ -33,6 +33,7 @@ local zigbee_window_treatment_driver_template = { capabilities.windowShade, capabilities.windowShadePreset, capabilities.windowShadeLevel, + capabilities.statelessWindowShadeLevelStep, capabilities.powerSource, capabilities.battery }, @@ -40,7 +41,10 @@ local zigbee_window_treatment_driver_template = { [capabilities.windowShadePreset.ID] = { [capabilities.windowShadePreset.commands.setPresetPosition.NAME] = window_shade_utils.set_preset_position_cmd, [capabilities.windowShadePreset.commands.presetPosition.NAME] = window_shade_utils.window_shade_preset_cmd, - } + }, + [capabilities.statelessWindowShadeLevelStep.ID] = { + [capabilities.statelessWindowShadeLevelStep.commands.stepShadeLevel.NAME] = window_shade_utils.step_shade_level_handler + }, }, lifecycle_handlers = { init = init_handler, diff --git a/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_shade_battery_ikea.lua b/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_shade_battery_ikea.lua index 26a08b1a84..c64116d7fa 100644 --- a/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_shade_battery_ikea.lua +++ b/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_shade_battery_ikea.lua @@ -56,7 +56,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -78,7 +78,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -100,7 +100,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -133,7 +133,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -186,7 +186,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -213,7 +213,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -232,7 +232,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -273,7 +273,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -312,7 +312,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -351,7 +351,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_shade_only_HOPOsmart.lua b/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_shade_only_HOPOsmart.lua index 71dc5c81a4..2653d47555 100644 --- a/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_shade_only_HOPOsmart.lua +++ b/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_shade_only_HOPOsmart.lua @@ -45,7 +45,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({mock_device.id, read_0x0000_messge}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -69,7 +69,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -96,7 +96,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -118,7 +118,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -136,7 +136,7 @@ test.register_coroutine_test( capabilities.windowShade.windowShade.open())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -154,7 +154,7 @@ test.register_coroutine_test( capabilities.windowShade.windowShade.opening())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -172,7 +172,7 @@ test.register_coroutine_test( capabilities.windowShade.windowShade.closed())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -190,7 +190,7 @@ test.register_coroutine_test( capabilities.windowShade.windowShade.closing())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -208,7 +208,7 @@ test.register_coroutine_test( capabilities.windowShade.windowShade.partially_open())) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment.lua b/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment.lua index ed01a87249..30bc6bfa5c 100644 --- a/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment.lua +++ b/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment.lua @@ -55,7 +55,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -108,7 +108,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -132,7 +132,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -159,7 +159,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -181,7 +181,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -209,7 +209,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -272,7 +272,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -298,7 +298,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -333,7 +333,262 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 + } +) + +test.register_coroutine_test( + "statelessWindowShadeLevelStep stepShadeLevel - positive step", + function() + test.socket.zigbee:__queue_receive({ + mock_device.id, + clusters.WindowCovering.attributes.CurrentPositionLiftPercentage:build_test_attr_report(mock_device, 50) + }) + test.socket.capability:__expect_send({ + mock_device.id, + { capability_id = "windowShadeLevel", component_id = "main", attribute_id = "shadeLevel", state = { value = 50 } } + }) + test.socket.capability:__expect_send({ + mock_device.id, + { capability_id = "windowShade", component_id = "main", attribute_id = "windowShade", state = { value = "opening" } } + }) + test.wait_for_events() + + mock_device:set_field("_latestTargetLevel", 50) + + test.socket.capability:__queue_receive({ + mock_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { 10 } } + }) + + test.socket.zigbee:__expect_send({ + mock_device.id, + clusters.WindowCovering.server.commands.GoToLiftPercentage(mock_device, 60) + }) + end, + { + min_api_version = 15 + } +) + +test.register_coroutine_test( + "statelessWindowShadeLevelStep stepShadeLevel - negative step", + function() + test.socket.zigbee:__queue_receive({ + mock_device.id, + clusters.WindowCovering.attributes.CurrentPositionLiftPercentage:build_test_attr_report(mock_device, 30) + }) + test.socket.capability:__expect_send({ + mock_device.id, + { capability_id = "windowShadeLevel", component_id = "main", attribute_id = "shadeLevel", state = { value = 30 } } + }) + test.socket.capability:__expect_send({ + mock_device.id, + { capability_id = "windowShade", component_id = "main", attribute_id = "windowShade", state = { value = "opening" } } + }) + test.wait_for_events() + + mock_device:set_field("_latestTargetLevel", 30) + + test.socket.capability:__queue_receive({ + mock_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { -20 } } + }) + + test.socket.zigbee:__expect_send({ + mock_device.id, + clusters.WindowCovering.server.commands.GoToLiftPercentage(mock_device, 10) + }) + end, + { + min_api_version = 15 + } +) + +test.register_coroutine_test( + "statelessWindowShadeLevelStep stepShadeLevel - accumulated steps with mixed directions", + function() + test.socket.zigbee:__set_channel_ordering("relaxed") + test.socket.zigbee:__queue_receive({ + mock_device.id, + clusters.WindowCovering.attributes.CurrentPositionLiftPercentage:build_test_attr_report(mock_device, 50) + }) + test.socket.capability:__expect_send({ + mock_device.id, + { capability_id = "windowShadeLevel", component_id = "main", attribute_id = "shadeLevel", state = { value = 50 } } + }) + test.socket.capability:__expect_send({ + mock_device.id, + { capability_id = "windowShade", component_id = "main", attribute_id = "windowShade", state = { value = "opening" } } + }) + test.wait_for_events() + + mock_device:set_field("_latestTargetLevel", 50) + + test.socket.capability:__queue_receive({ + mock_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { 10 } } + }) + test.socket.zigbee:__expect_send({ + mock_device.id, + clusters.WindowCovering.server.commands.GoToLiftPercentage(mock_device, 60) + }) + test.wait_for_events() + + test.socket.capability:__queue_receive({ + mock_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { -5 } } + }) + test.socket.zigbee:__expect_send({ + mock_device.id, + clusters.WindowCovering.server.commands.GoToLiftPercentage(mock_device, 55) + }) + test.wait_for_events() + + test.socket.capability:__queue_receive({ + mock_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { 15 } } + }) + test.socket.zigbee:__expect_send({ + mock_device.id, + clusters.WindowCovering.server.commands.GoToLiftPercentage(mock_device, 70) + }) + test.wait_for_events() + end, + { + min_api_version = 15 + } +) + +test.register_coroutine_test( + "statelessWindowShadeLevelStep stepShadeLevel - clamped to 100", + function() + test.socket.zigbee:__set_channel_ordering("relaxed") + test.socket.zigbee:__queue_receive({ + mock_device.id, + clusters.WindowCovering.attributes.CurrentPositionLiftPercentage:build_test_attr_report(mock_device, 90) + }) + test.socket.capability:__expect_send({ + mock_device.id, + { capability_id = "windowShadeLevel", component_id = "main", attribute_id = "shadeLevel", state = { value = 90 } } + }) + test.socket.capability:__expect_send({ + mock_device.id, + { capability_id = "windowShade", component_id = "main", attribute_id = "windowShade", state = { value = "opening" } } + }) + test.wait_for_events() + + mock_device:set_field("_latestTargetLevel", 90) + + test.socket.capability:__queue_receive({ + mock_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { 50 } } + }) + test.socket.zigbee:__expect_send({ + mock_device.id, + clusters.WindowCovering.server.commands.GoToLiftPercentage(mock_device, 100) + }) + test.wait_for_events() + end, + { + min_api_version = 15 + } +) + +test.register_coroutine_test( + "statelessWindowShadeLevelStep stepShadeLevel - clamped to 0", + function() + test.socket.zigbee:__set_channel_ordering("relaxed") + test.socket.zigbee:__queue_receive({ + mock_device.id, + clusters.WindowCovering.attributes.CurrentPositionLiftPercentage:build_test_attr_report(mock_device, 10) + }) + test.socket.capability:__expect_send({ + mock_device.id, + { capability_id = "windowShadeLevel", component_id = "main", attribute_id = "shadeLevel", state = { value = 10 } } + }) + test.socket.capability:__expect_send({ + mock_device.id, + { capability_id = "windowShade", component_id = "main", attribute_id = "windowShade", state = { value = "opening" } } + }) + test.wait_for_events() + + mock_device:set_field("_latestTargetLevel", 10) + + test.socket.capability:__queue_receive({ + mock_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { -50 } } + }) + test.socket.zigbee:__expect_send({ + mock_device.id, + clusters.WindowCovering.server.commands.GoToLiftPercentage(mock_device, 0) + }) + test.wait_for_events() + end, + { + min_api_version = 15 + } +) + +test.register_coroutine_test( + "statelessWindowShadeLevelStep stepShadeLevel - zero stepSize", + function() + test.socket.zigbee:__queue_receive({ + mock_device.id, + clusters.WindowCovering.attributes.CurrentPositionLiftPercentage:build_test_attr_report(mock_device, 50) + }) + test.socket.capability:__expect_send({ + mock_device.id, + { capability_id = "windowShadeLevel", component_id = "main", attribute_id = "shadeLevel", state = { value = 50 } } + }) + test.socket.capability:__expect_send({ + mock_device.id, + { capability_id = "windowShade", component_id = "main", attribute_id = "windowShade", state = { value = "opening" } } + }) + test.wait_for_events() + + mock_device:set_field("_latestTargetLevel", 50) + + test.socket.capability:__queue_receive({ + mock_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { 0 } } + }) + test.wait_for_events() + end, + { + min_api_version = 14 + } +) + +-- Test step_shade_level_handler with zero step +test.register_coroutine_test( + "step_shade_level_handler returns early when stepSize is zero", + function() + test.socket.zigbee:__queue_receive({ + mock_device.id, + clusters.WindowCovering.attributes.CurrentPositionLiftPercentage:build_test_attr_report(mock_device, 50) + }) + test.socket.capability:__expect_send({ + mock_device.id, + { capability_id = "windowShadeLevel", component_id = "main", attribute_id = "shadeLevel", state = { value = 50 } } + }) + test.socket.capability:__expect_send({ + mock_device.id, + { capability_id = "windowShade", component_id = "main", attribute_id = "windowShade", state = { value = "opening" } } + }) + test.wait_for_events() + + mock_device:set_field("_latestTargetLevel", 50) + + -- Send zero step - should return early without sending any command + test.socket.capability:__queue_receive({ + mock_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { 0 } } + }) + test.wait_for_events() + end, + { + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_VWSDSTUST120H.lua b/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_VWSDSTUST120H.lua index ecf2586a5c..ba5b9c20a5 100644 --- a/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_VWSDSTUST120H.lua +++ b/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_VWSDSTUST120H.lua @@ -51,7 +51,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({mock_device.id, read_0x0001_messge}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -70,7 +70,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({mock_device.id, read_0x0001_messge}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -94,7 +94,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -121,7 +121,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -143,7 +143,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -160,7 +160,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -177,7 +177,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -194,7 +194,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -211,7 +211,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -229,7 +229,7 @@ test.register_coroutine_test( capabilities.mode.mode("Delete upper limit"))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -247,7 +247,7 @@ test.register_coroutine_test( capabilities.mode.mode("Set the upper limit"))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -265,7 +265,7 @@ test.register_coroutine_test( capabilities.mode.mode("Delete lower limit"))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -283,7 +283,7 @@ test.register_coroutine_test( capabilities.mode.mode("Set the lower limit"))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -301,7 +301,7 @@ test.register_coroutine_test( capabilities.hardwareFault.hardwareFault.clear())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -319,7 +319,7 @@ test.register_coroutine_test( capabilities.hardwareFault.hardwareFault.detected())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -340,7 +340,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -361,7 +361,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_aqara.lua b/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_aqara.lua index 08c71ec85a..23b54edab5 100644 --- a/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_aqara.lua +++ b/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_aqara.lua @@ -143,7 +143,7 @@ test.register_coroutine_test( PREF_SOFT_TOUCH_ON) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -178,7 +178,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -200,7 +200,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -222,7 +222,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -244,7 +244,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -263,7 +263,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -282,7 +282,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -301,7 +301,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -348,7 +348,7 @@ test.register_coroutine_test( deviceInitialization.initializedState.initialized())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -380,7 +380,7 @@ test.register_coroutine_test( PREF_SOFT_TOUCH_OFF) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -404,7 +404,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -434,7 +434,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -464,7 +464,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -494,7 +494,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -514,7 +514,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -544,7 +544,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -576,7 +576,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -609,7 +609,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -631,7 +631,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -653,7 +653,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_aqara_curtain_driver_e1.lua b/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_aqara_curtain_driver_e1.lua index 0177c71467..82d5fac234 100644 --- a/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_aqara_curtain_driver_e1.lua +++ b/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_aqara_curtain_driver_e1.lua @@ -111,7 +111,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -158,7 +158,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -175,7 +175,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -190,7 +190,7 @@ test.register_coroutine_test( PRIVATE_CURTAIN_MANUAL_ATTRIBUTE_ID, MFG_CODE, data_types.Boolean, false) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -221,7 +221,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -250,7 +250,7 @@ test.register_coroutine_test( -- }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -280,7 +280,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -298,7 +298,7 @@ test.register_coroutine_test( PRIVATE_CURTAIN_LOCKING_SETTING_ATTRIBUTE_ID, MFG_CODE, data_types.Uint8, 0x01) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -316,7 +316,7 @@ test.register_coroutine_test( PRIVATE_CURTAIN_LOCKING_SETTING_ATTRIBUTE_ID, MFG_CODE, data_types.Uint8, 0x00) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -348,7 +348,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -368,7 +368,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -388,7 +388,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -407,7 +407,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -426,7 +426,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -445,7 +445,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_aqara_roller_shade_rotate.lua b/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_aqara_roller_shade_rotate.lua index 3e1e013c38..4f8c0780c7 100644 --- a/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_aqara_roller_shade_rotate.lua +++ b/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_aqara_roller_shade_rotate.lua @@ -116,7 +116,7 @@ test.register_coroutine_test( PREF_REVERSE_OFF) }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -151,7 +151,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -173,7 +173,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -195,7 +195,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -217,7 +217,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -246,7 +246,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -275,7 +275,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -294,7 +294,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -313,7 +313,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -333,7 +333,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -371,7 +371,7 @@ test.register_coroutine_test( initializedStateWithGuide.initializedStateWithGuide.initialized())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -395,7 +395,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -427,7 +427,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -446,7 +446,7 @@ test.register_coroutine_test( initializedStateWithGuide.initializedStateWithGuide.notInitialized())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -466,7 +466,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -507,7 +507,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, message }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_axis.lua b/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_axis.lua index fb63dd121d..333eca0f9e 100644 --- a/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_axis.lua +++ b/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_axis.lua @@ -82,7 +82,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -123,7 +123,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -176,7 +176,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -204,7 +204,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -236,7 +236,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -264,7 +264,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -296,7 +296,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -336,7 +336,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -378,7 +378,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -406,7 +406,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -441,7 +441,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -469,7 +469,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -506,7 +506,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -541,7 +541,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -586,7 +586,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -624,7 +624,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -679,7 +679,7 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_device.id, WindowCovering.attributes.CurrentPositionLiftPercentage:read(mock_device) }) end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_inverted_step.lua b/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_inverted_step.lua new file mode 100644 index 0000000000..3c7c0cbee2 --- /dev/null +++ b/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_inverted_step.lua @@ -0,0 +1,346 @@ +-- Copyright 2026 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + +-- Test for statelessWindowShadeLevelStep capability with Somfy (reverse) devices +-- Tests devices like Somfy Glydea that use inverted lift percentage + +local capabilities = require "st.capabilities" +local clusters = require "st.zigbee.zcl.clusters" +local t_utils = require "integration_test.utils" +local test = require "integration_test" +local zigbee_test_utils = require "integration_test.zigbee_test_utils" + +local WindowCovering = clusters.WindowCovering + +-- Create mock Somfy Glydea device using WindowCovering cluster with inverted logic +-- This device matches the somfy sub-driver which inverts the lift percentage +local somfy_device = test.mock_device.build_test_zigbee_device( + { + profile = t_utils.get_profile_definition("window-treatment-profile.yml"), + zigbee_endpoints = { + [1] = { + id = 1, + manufacturer = "SOMFY", + model = "Glydea Ultra Curtain", + server_clusters = { WindowCovering.ID } + } + } + } +) + +zigbee_test_utils.prepare_zigbee_env_info() + +local function test_init() + test.mock_device.add_test_device(somfy_device) + test.socket.capability:__expect_send( + somfy_device:generate_test_message("main", capabilities.windowShadePreset.supportedCommands({"presetPosition", "setPresetPosition"}, {visibility = {displayed=false}})) + ) + test.socket.capability:__expect_send( + somfy_device:generate_test_message("main", capabilities.windowShadePreset.position(50, {visibility = {displayed=false}})) + ) +end + +test.set_test_init_function(test_init) + +-- Test 1: Boundary condition - stepSize = 0 should not send command +test.register_coroutine_test( + "statelessWindowShadeLevelStep with Somfy (reverse) - stepSize 0 does not send command", + function() + -- Set initial state via WindowCovering cluster report: 50% (inverted: device reports 50 for 50% shade) + test.socket.zigbee:__queue_receive({ + somfy_device.id, + WindowCovering.attributes.CurrentPositionLiftPercentage:build_test_attr_report(somfy_device, 50) + }) + test.socket.capability:__expect_send({ + somfy_device.id, + { capability_id = "windowShadeLevel", component_id = "main", attribute_id = "shadeLevel", state = { value = 50 } } + }) + -- Somfy sub-driver emits "opening" for initial report when no previous state exists + test.socket.capability:__expect_send({ + somfy_device.id, + { capability_id = "windowShade", component_id = "main", attribute_id = "windowShade", state = { value = "opening" } } + }) + test.wait_for_events() + + -- Manually set LATEST_TARGET_LEVEL to simulate the reported value + somfy_device:set_field("_latestTargetLevel", 50) + + -- Send stepShadeLevel command with stepSize = 0 + test.socket.capability:__queue_receive({ + somfy_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { 0 } } + }) + + -- Should NOT send any Zigbee command (stepSize 0 is ignored) + test.wait_for_events() + end, + { min_api_version = 17 } +) + +-- Test 2: Normal step up operation with Somfy (reverse) device +-- Somfy inverts the value: shadeLevel 60 means device goes to 100-60=40 +test.register_coroutine_test( + "statelessWindowShadeLevelStep with Somfy (reverse) - normal step up", + function() + test.socket.zigbee:__set_channel_ordering("relaxed") + -- Set initial state: WindowCovering cluster reports 50 (inverted: 100-50=50 shade level) + test.socket.zigbee:__queue_receive({ + somfy_device.id, + WindowCovering.attributes.CurrentPositionLiftPercentage:build_test_attr_report(somfy_device, 50) + }) + test.socket.capability:__expect_send({ + somfy_device.id, + { capability_id = "windowShadeLevel", component_id = "main", attribute_id = "shadeLevel", state = { value = 50 } } + }) + -- Somfy sub-driver emits "opening" for initial report when no previous state exists + test.socket.capability:__expect_send({ + somfy_device.id, + { capability_id = "windowShade", component_id = "main", attribute_id = "windowShade", state = { value = "opening" } } + }) + test.wait_for_events() + + -- Manually set LATEST_TARGET_LEVEL to simulate the reported value + somfy_device:set_field("_latestTargetLevel", 50) + + -- Send stepShadeLevel command with stepSize = 10 + -- new_target_level = clamp(50 + 10, 0, 100) = 60 + test.socket.capability:__queue_receive({ + somfy_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { 10 } } + }) + + -- Note: Somfy sub-driver's window_shade_level_cmd directly sends Zigbee command without emitting events + -- Somfy sub-driver's window_shade_level_cmd inverts the value: 100 - 60 = 40 + test.socket.zigbee:__expect_send({ + somfy_device.id, + WindowCovering.server.commands.GoToLiftPercentage(somfy_device, 40) + }) + end, + { min_api_version = 17 } +) + +-- Test 3: Normal step down operation with Somfy (reverse) device +test.register_coroutine_test( + "statelessWindowShadeLevelStep with Somfy (reverse) - normal step down", + function() + test.socket.zigbee:__set_channel_ordering("relaxed") + -- Set initial state: WindowCovering cluster reports 25 (inverted: 100-25=75 shade level) + test.socket.zigbee:__queue_receive({ + somfy_device.id, + WindowCovering.attributes.CurrentPositionLiftPercentage:build_test_attr_report(somfy_device, 25) + }) + test.socket.capability:__expect_send({ + somfy_device.id, + { capability_id = "windowShadeLevel", component_id = "main", attribute_id = "shadeLevel", state = { value = 75 } } + }) + -- Somfy sub-driver emits "opening" for initial report when no previous state exists + test.socket.capability:__expect_send({ + somfy_device.id, + { capability_id = "windowShade", component_id = "main", attribute_id = "windowShade", state = { value = "opening" } } + }) + test.wait_for_events() + + -- Manually set LATEST_TARGET_LEVEL to simulate the reported value + somfy_device:set_field("_latestTargetLevel", 75) + + -- Send stepShadeLevel command with stepSize = -25 + -- new_target_level = clamp(75 + (-25), 0, 100) = 50 + test.socket.capability:__queue_receive({ + somfy_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { -25 } } + }) + + -- Note: Somfy sub-driver's window_shade_level_cmd directly sends Zigbee command without emitting events + -- Somfy sub-driver's window_shade_level_cmd inverts the value: 100 - 50 = 50 + test.socket.zigbee:__expect_send({ + somfy_device.id, + WindowCovering.server.commands.GoToLiftPercentage(somfy_device, 50) + }) + end, + { min_api_version = 17 } +) + +-- Test 4: Boundary condition - value clamped to 100 (maximum) +test.register_coroutine_test( + "statelessWindowShadeLevelStep with Somfy (reverse) - value clamped to 100", + function() + test.socket.zigbee:__set_channel_ordering("relaxed") + -- Set initial state: WindowCovering cluster reports 10 (inverted: 100-10=90 shade level) + test.socket.zigbee:__queue_receive({ + somfy_device.id, + WindowCovering.attributes.CurrentPositionLiftPercentage:build_test_attr_report(somfy_device, 10) + }) + test.socket.capability:__expect_send({ + somfy_device.id, + { capability_id = "windowShadeLevel", component_id = "main", attribute_id = "shadeLevel", state = { value = 90 } } + }) + -- Somfy sub-driver emits "opening" for initial report when no previous state exists + test.socket.capability:__expect_send({ + somfy_device.id, + { capability_id = "windowShade", component_id = "main", attribute_id = "windowShade", state = { value = "opening" } } + }) + test.wait_for_events() + + -- Manually set LATEST_TARGET_LEVEL to simulate the reported value + somfy_device:set_field("_latestTargetLevel", 90) + + -- Send stepShadeLevel command with stepSize = 50 + -- new_target_level = clamp(90 + 50, 0, 100) = 100 + test.socket.capability:__queue_receive({ + somfy_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { 50 } } + }) + + -- Note: Somfy sub-driver's window_shade_level_cmd directly sends Zigbee command without emitting events + -- Somfy sub-driver's window_shade_level_cmd inverts the value: 100 - 100 = 0 + test.socket.zigbee:__expect_send({ + somfy_device.id, + WindowCovering.server.commands.GoToLiftPercentage(somfy_device, 0) + }) + end, + { min_api_version = 17 } +) + +-- Test 5: Boundary condition - value clamped to 0 (minimum) +test.register_coroutine_test( + "statelessWindowShadeLevelStep with Somfy (reverse) - value clamped to 0", + function() + test.socket.zigbee:__set_channel_ordering("relaxed") + -- Set initial state: WindowCovering cluster reports 80 (inverted: 100-80=20 shade level) + test.socket.zigbee:__queue_receive({ + somfy_device.id, + WindowCovering.attributes.CurrentPositionLiftPercentage:build_test_attr_report(somfy_device, 80) + }) + test.socket.capability:__expect_send({ + somfy_device.id, + { capability_id = "windowShadeLevel", component_id = "main", attribute_id = "shadeLevel", state = { value = 20 } } + }) + -- Somfy sub-driver emits "opening" for initial report when no previous state exists + test.socket.capability:__expect_send({ + somfy_device.id, + { capability_id = "windowShade", component_id = "main", attribute_id = "windowShade", state = { value = "opening" } } + }) + test.wait_for_events() + + -- Manually set LATEST_TARGET_LEVEL to simulate the reported value + somfy_device:set_field("_latestTargetLevel", 20) + + -- Send stepShadeLevel command with stepSize = -50 + -- new_target_level = clamp(20 + (-50), 0, 100) = 0 + test.socket.capability:__queue_receive({ + somfy_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { -50 } } + }) + + -- Note: Somfy sub-driver's window_shade_level_cmd directly sends Zigbee command without emitting events + -- Somfy sub-driver's window_shade_level_cmd inverts the value: 100 - 0 = 100 + test.socket.zigbee:__expect_send({ + somfy_device.id, + WindowCovering.server.commands.GoToLiftPercentage(somfy_device, 100) + }) + end, + { min_api_version = 17 } +) + +-- Test 6: Continuous step operations with mixed directions +test.register_coroutine_test( + "statelessWindowShadeLevelStep with Somfy (reverse) - continuous steps with mixed directions", + function() + test.socket.zigbee:__set_channel_ordering("relaxed") + -- Set initial state: WindowCovering cluster reports 50 (inverted: 100-50=50 shade level) + test.socket.zigbee:__queue_receive({ + somfy_device.id, + WindowCovering.attributes.CurrentPositionLiftPercentage:build_test_attr_report(somfy_device, 50) + }) + test.socket.capability:__expect_send({ + somfy_device.id, + { capability_id = "windowShadeLevel", component_id = "main", attribute_id = "shadeLevel", state = { value = 50 } } + }) + -- Somfy sub-driver emits "opening" for initial report when no previous state exists + test.socket.capability:__expect_send({ + somfy_device.id, + { capability_id = "windowShade", component_id = "main", attribute_id = "windowShade", state = { value = "opening" } } + }) + test.wait_for_events() + + -- Manually set LATEST_TARGET_LEVEL to simulate the reported value + somfy_device:set_field("_latestTargetLevel", 50) + + -- Step 1: stepSize = 10 (up) -> 60% + test.socket.capability:__queue_receive({ + somfy_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { 10 } } + }) + -- Note: Somfy sub-driver's window_shade_level_cmd directly sends Zigbee command without emitting events + -- Somfy sub-driver's window_shade_level_cmd inverts the value: 100 - 60 = 40 + test.socket.zigbee:__expect_send({ + somfy_device.id, + WindowCovering.server.commands.GoToLiftPercentage(somfy_device, 40) + }) + test.wait_for_events() + + -- Step 2: stepSize = -5 (down) -> 55% + test.socket.capability:__queue_receive({ + somfy_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { -5 } } + }) + -- Note: Somfy sub-driver's window_shade_level_cmd directly sends Zigbee command without emitting events + -- Somfy sub-driver's window_shade_level_cmd inverts the value: 100 - 55 = 45 + test.socket.zigbee:__expect_send({ + somfy_device.id, + WindowCovering.server.commands.GoToLiftPercentage(somfy_device, 45) + }) + test.wait_for_events() + + -- Step 3: stepSize = 20 (up) -> 75% + test.socket.capability:__queue_receive({ + somfy_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { 20 } } + }) + -- Note: Somfy sub-driver's window_shade_level_cmd directly sends Zigbee command without emitting events + -- Somfy sub-driver's window_shade_level_cmd inverts the value: 100 - 75 = 25 + test.socket.zigbee:__expect_send({ + somfy_device.id, + WindowCovering.server.commands.GoToLiftPercentage(somfy_device, 25) + }) + test.wait_for_events() + end, + { min_api_version = 17 } +) + +-- Test 7: nil stepSize should not send command +test.register_coroutine_test( + "statelessWindowShadeLevelStep with Somfy (reverse) - nil stepSize does not send command", + function() + -- Set initial state: WindowCovering cluster reports 50 (inverted: 100-50=50 shade level) + test.socket.zigbee:__queue_receive({ + somfy_device.id, + WindowCovering.attributes.CurrentPositionLiftPercentage:build_test_attr_report(somfy_device, 50) + }) + test.socket.capability:__expect_send({ + somfy_device.id, + { capability_id = "windowShadeLevel", component_id = "main", attribute_id = "shadeLevel", state = { value = 50 } } + }) + -- Somfy sub-driver emits "opening" for initial report when no previous state exists + test.socket.capability:__expect_send({ + somfy_device.id, + { capability_id = "windowShade", component_id = "main", attribute_id = "windowShade", state = { value = "opening" } } + }) + test.wait_for_events() + + -- Manually set LATEST_TARGET_LEVEL to simulate the reported value + somfy_device:set_field("_latestTargetLevel", 50) + + -- Send stepShadeLevel command with nil stepSize + test.socket.capability:__queue_receive({ + somfy_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = {} } + }) + + -- Should NOT send any Zigbee command + test.wait_for_events() + end, + { min_api_version = 17 } +) + +test.run_registered_tests() diff --git a/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_level_cluster_step.lua b/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_level_cluster_step.lua new file mode 100644 index 0000000000..602aa34bd4 --- /dev/null +++ b/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_level_cluster_step.lua @@ -0,0 +1,400 @@ +-- Copyright 2026 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + +-- Test for statelessWindowShadeLevelStep capability with Level cluster devices +-- Tests devices like AXIS Gear that use Level cluster for window covering control + +local capabilities = require "st.capabilities" +local clusters = require "st.zigbee.zcl.clusters" +local t_utils = require "integration_test.utils" +local test = require "integration_test" +local zigbee_test_utils = require "integration_test.zigbee_test_utils" + +local Level = clusters.Level +local WindowCovering = clusters.WindowCovering + +-- Create mock AXIS Gear device using Level cluster +-- This device matches the axis sub-driver which uses Level cluster +local axis_device = test.mock_device.build_test_zigbee_device( + { + profile = t_utils.get_profile_definition("window-treatment-profile.yml"), + zigbee_endpoints = { + [1] = { + id = 1, + manufacturer = "AXIS", + model = "Gear", + server_clusters = { Level.ID, WindowCovering.ID } + } + } + } +) + +zigbee_test_utils.prepare_zigbee_env_info() + +local function test_init() + test.mock_device.add_test_device(axis_device) + test.socket.capability:__expect_send( + axis_device:generate_test_message("main", capabilities.windowShadePreset.supportedCommands({"presetPosition", "setPresetPosition"}, {visibility = {displayed=false}})) + ) + test.socket.capability:__expect_send( + axis_device:generate_test_message("main", capabilities.windowShadePreset.position(50, {visibility = {displayed=false}})) + ) +end + +test.set_test_init_function(test_init) + +-- Test 1: Boundary condition - stepSize = 0 should not send command +test.register_coroutine_test( + "statelessWindowShadeLevelStep with Level cluster - stepSize 0 does not send command", + function() + -- Set initial state via Level cluster report: 50% (127 out of 254) + test.socket.zigbee:__queue_receive({ + axis_device.id, + Level.attributes.CurrentLevel:build_test_attr_report(axis_device, 127) + }) + test.socket.capability:__expect_send({ + axis_device.id, + { capability_id = "windowShadeLevel", component_id = "main", attribute_id = "shadeLevel", state = { value = 50 } } + }) + test.socket.capability:__expect_send({ + axis_device.id, + { capability_id = "windowShade", component_id = "main", attribute_id = "windowShade", state = { value = "partially open" } } + }) + test.wait_for_events() + + -- Manually set LATEST_TARGET_LEVEL to simulate the reported value + axis_device:set_field("_latestTargetLevel", 50) + + -- Send stepShadeLevel command with stepSize = 0 + test.socket.capability:__queue_receive({ + axis_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { 0 } } + }) + + -- Should NOT send any Zigbee command (stepSize 0 is ignored) + test.wait_for_events() + end, + { min_api_version = 17 } +) + +-- Test 2: Normal step up operation with Level cluster +test.register_coroutine_test( + "statelessWindowShadeLevelStep with Level cluster - normal step up", + function() + test.socket.zigbee:__set_channel_ordering("relaxed") + -- Set initial state: Level cluster reports 50% (127 out of 254) + test.socket.zigbee:__queue_receive({ + axis_device.id, + Level.attributes.CurrentLevel:build_test_attr_report(axis_device, 127) + }) + test.socket.capability:__expect_send({ + axis_device.id, + { capability_id = "windowShadeLevel", component_id = "main", attribute_id = "shadeLevel", state = { value = 50 } } + }) + test.socket.capability:__expect_send({ + axis_device.id, + { capability_id = "windowShade", component_id = "main", attribute_id = "windowShade", state = { value = "partially open" } } + }) + test.wait_for_events() + + -- Manually set LATEST_TARGET_LEVEL to simulate the reported value + axis_device:set_field("_latestTargetLevel", 50) + + -- Send stepShadeLevel command with stepSize = 10 + -- new_target_level = clamp(50 + 10, 0, 100) = 60 + test.socket.capability:__queue_receive({ + axis_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { 10 } } + }) + + -- AXIS sub-driver emits shadeLevel event when handling setShadeLevel (injected by main driver) + test.socket.capability:__expect_send({ + axis_device.id, + { capability_id = "windowShadeLevel", component_id = "main", attribute_id = "shadeLevel", state = { value = 60 } } + }) + -- AXIS sub-driver also emits windowShade event (opening because 60 > 50) + test.socket.capability:__expect_send({ + axis_device.id, + { capability_id = "windowShade", component_id = "main", attribute_id = "windowShade", state = { value = "opening" } } + }) + + -- Should send MoveToLevelWithOnOff with level 60 (152 out of 254, rounded from 152.4) + test.socket.zigbee:__expect_send({ + axis_device.id, + Level.server.commands.MoveToLevelWithOnOff(axis_device, 152) + }) + end, + { min_api_version = 17 } +) + +-- Test 3: Normal step down operation with Level cluster +test.register_coroutine_test( + "statelessWindowShadeLevelStep with Level cluster - normal step down", + function() + test.socket.zigbee:__set_channel_ordering("relaxed") + -- Set initial state: Level cluster reports 75% (191 out of 254) + test.socket.zigbee:__queue_receive({ + axis_device.id, + Level.attributes.CurrentLevel:build_test_attr_report(axis_device, 191) + }) + test.socket.capability:__expect_send({ + axis_device.id, + { capability_id = "windowShadeLevel", component_id = "main", attribute_id = "shadeLevel", state = { value = 75 } } + }) + test.socket.capability:__expect_send({ + axis_device.id, + { capability_id = "windowShade", component_id = "main", attribute_id = "windowShade", state = { value = "partially open" } } + }) + test.wait_for_events() + + -- Manually set LATEST_TARGET_LEVEL to simulate the reported value + axis_device:set_field("_latestTargetLevel", 75) + + -- Send stepShadeLevel command with stepSize = -25 + -- new_target_level = clamp(75 + (-25), 0, 100) = 50 + test.socket.capability:__queue_receive({ + axis_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { -25 } } + }) + + -- AXIS sub-driver emits shadeLevel event when handling setShadeLevel (injected by main driver) + test.socket.capability:__expect_send({ + axis_device.id, + { capability_id = "windowShadeLevel", component_id = "main", attribute_id = "shadeLevel", state = { value = 50 } } + }) + -- AXIS sub-driver also emits windowShade event (closing because 50 < 75) + test.socket.capability:__expect_send({ + axis_device.id, + { capability_id = "windowShade", component_id = "main", attribute_id = "windowShade", state = { value = "closing" } } + }) + + -- Should send MoveToLevelWithOnOff with level 50 (127 out of 254) + test.socket.zigbee:__expect_send({ + axis_device.id, + Level.server.commands.MoveToLevelWithOnOff(axis_device, 127) + }) + end, + { min_api_version = 17 } +) + +-- Test 4: Boundary condition - value clamped to 100 (maximum) +test.register_coroutine_test( + "statelessWindowShadeLevelStep with Level cluster - value clamped to 100", + function() + test.socket.zigbee:__set_channel_ordering("relaxed") + -- Set initial state: Level cluster reports 90% (229 out of 254) + test.socket.zigbee:__queue_receive({ + axis_device.id, + Level.attributes.CurrentLevel:build_test_attr_report(axis_device, 229) + }) + test.socket.capability:__expect_send({ + axis_device.id, + { capability_id = "windowShadeLevel", component_id = "main", attribute_id = "shadeLevel", state = { value = 90 } } + }) + test.socket.capability:__expect_send({ + axis_device.id, + { capability_id = "windowShade", component_id = "main", attribute_id = "windowShade", state = { value = "partially open" } } + }) + test.wait_for_events() + + -- Manually set LATEST_TARGET_LEVEL to simulate the reported value + axis_device:set_field("_latestTargetLevel", 90) + + -- Send stepShadeLevel command with stepSize = 50 + -- new_target_level = clamp(90 + 50, 0, 100) = 100 + test.socket.capability:__queue_receive({ + axis_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { 50 } } + }) + + -- AXIS sub-driver emits shadeLevel event when handling setShadeLevel (injected by main driver) + test.socket.capability:__expect_send({ + axis_device.id, + { capability_id = "windowShadeLevel", component_id = "main", attribute_id = "shadeLevel", state = { value = 100 } } + }) + -- AXIS sub-driver also emits windowShade event (opening because 100 > 90) + test.socket.capability:__expect_send({ + axis_device.id, + { capability_id = "windowShade", component_id = "main", attribute_id = "windowShade", state = { value = "opening" } } + }) + + -- Should send MoveToLevelWithOnOff with level 100 (254 out of 254) + test.socket.zigbee:__expect_send({ + axis_device.id, + Level.server.commands.MoveToLevelWithOnOff(axis_device, 254) + }) + end, + { min_api_version = 17 } +) + +-- Test 5: Boundary condition - value clamped to 0 (minimum) +test.register_coroutine_test( + "statelessWindowShadeLevelStep with Level cluster - value clamped to 0", + function() + test.socket.zigbee:__set_channel_ordering("relaxed") + -- Set initial state: Level cluster reports 20% (51 out of 254) + test.socket.zigbee:__queue_receive({ + axis_device.id, + Level.attributes.CurrentLevel:build_test_attr_report(axis_device, 51) + }) + test.socket.capability:__expect_send({ + axis_device.id, + { capability_id = "windowShadeLevel", component_id = "main", attribute_id = "shadeLevel", state = { value = 20 } } + }) + test.socket.capability:__expect_send({ + axis_device.id, + { capability_id = "windowShade", component_id = "main", attribute_id = "windowShade", state = { value = "partially open" } } + }) + test.wait_for_events() + + -- Manually set LATEST_TARGET_LEVEL to simulate the reported value + axis_device:set_field("_latestTargetLevel", 20) + + -- Send stepShadeLevel command with stepSize = -50 + -- new_target_level = clamp(20 + (-50), 0, 100) = 0 + test.socket.capability:__queue_receive({ + axis_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { -50 } } + }) + + -- AXIS sub-driver emits shadeLevel event when handling setShadeLevel (injected by main driver) + test.socket.capability:__expect_send({ + axis_device.id, + { capability_id = "windowShadeLevel", component_id = "main", attribute_id = "shadeLevel", state = { value = 0 } } + }) + -- AXIS sub-driver also emits windowShade event (closing because 0 < 20) + test.socket.capability:__expect_send({ + axis_device.id, + { capability_id = "windowShade", component_id = "main", attribute_id = "windowShade", state = { value = "closing" } } + }) + + -- Should send MoveToLevelWithOnOff with level 0 (0 out of 254) + test.socket.zigbee:__expect_send({ + axis_device.id, + Level.server.commands.MoveToLevelWithOnOff(axis_device, 0) + }) + end, + { min_api_version = 17 } +) + +-- Test 6: Continuous step operations with mixed directions +test.register_coroutine_test( + "statelessWindowShadeLevelStep with Level cluster - continuous steps with mixed directions", + function() + test.socket.zigbee:__set_channel_ordering("relaxed") + -- Set initial state: Level cluster reports 50% (127 out of 254) + test.socket.zigbee:__queue_receive({ + axis_device.id, + Level.attributes.CurrentLevel:build_test_attr_report(axis_device, 127) + }) + test.socket.capability:__expect_send({ + axis_device.id, + { capability_id = "windowShadeLevel", component_id = "main", attribute_id = "shadeLevel", state = { value = 50 } } + }) + test.socket.capability:__expect_send({ + axis_device.id, + { capability_id = "windowShade", component_id = "main", attribute_id = "windowShade", state = { value = "partially open" } } + }) + test.wait_for_events() + + -- Manually set LATEST_TARGET_LEVEL to simulate the reported value + axis_device:set_field("_latestTargetLevel", 50) + + -- Step 1: stepSize = 10 (up) -> 60% + test.socket.capability:__queue_receive({ + axis_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { 10 } } + }) + -- AXIS sub-driver emits shadeLevel and windowShade events + test.socket.capability:__expect_send({ + axis_device.id, + { capability_id = "windowShadeLevel", component_id = "main", attribute_id = "shadeLevel", state = { value = 60 } } + }) + test.socket.capability:__expect_send({ + axis_device.id, + { capability_id = "windowShade", component_id = "main", attribute_id = "windowShade", state = { value = "opening" } } + }) + test.socket.zigbee:__expect_send({ + axis_device.id, + Level.server.commands.MoveToLevelWithOnOff(axis_device, 152) + }) + test.wait_for_events() + + -- Step 2: stepSize = -5 (down) -> 55% + test.socket.capability:__queue_receive({ + axis_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { -5 } } + }) + -- AXIS sub-driver emits shadeLevel and windowShade events + test.socket.capability:__expect_send({ + axis_device.id, + { capability_id = "windowShadeLevel", component_id = "main", attribute_id = "shadeLevel", state = { value = 55 } } + }) + test.socket.capability:__expect_send({ + axis_device.id, + { capability_id = "windowShade", component_id = "main", attribute_id = "windowShade", state = { value = "closing" } } + }) + test.socket.zigbee:__expect_send({ + axis_device.id, + Level.server.commands.MoveToLevelWithOnOff(axis_device, 140) + }) + test.wait_for_events() + + -- Step 3: stepSize = 20 (up) -> 75% + test.socket.capability:__queue_receive({ + axis_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { 20 } } + }) + -- AXIS sub-driver emits shadeLevel and windowShade events + test.socket.capability:__expect_send({ + axis_device.id, + { capability_id = "windowShadeLevel", component_id = "main", attribute_id = "shadeLevel", state = { value = 75 } } + }) + test.socket.capability:__expect_send({ + axis_device.id, + { capability_id = "windowShade", component_id = "main", attribute_id = "windowShade", state = { value = "opening" } } + }) + test.socket.zigbee:__expect_send({ + axis_device.id, + Level.server.commands.MoveToLevelWithOnOff(axis_device, 191) + }) + test.wait_for_events() + end, + { min_api_version = 17 } +) + +-- Test 7: nil stepSize should not send command +test.register_coroutine_test( + "statelessWindowShadeLevelStep with Level cluster - nil stepSize does not send command", + function() + -- Set initial state: Level cluster reports 50% (127 out of 254) + test.socket.zigbee:__queue_receive({ + axis_device.id, + Level.attributes.CurrentLevel:build_test_attr_report(axis_device, 127) + }) + test.socket.capability:__expect_send({ + axis_device.id, + { capability_id = "windowShadeLevel", component_id = "main", attribute_id = "shadeLevel", state = { value = 50 } } + }) + test.socket.capability:__expect_send({ + axis_device.id, + { capability_id = "windowShade", component_id = "main", attribute_id = "windowShade", state = { value = "partially open" } } + }) + test.wait_for_events() + + -- Manually set LATEST_TARGET_LEVEL to simulate the reported value + axis_device:set_field("_latestTargetLevel", 50) + + -- Send stepShadeLevel command with nil stepSize + test.socket.capability:__queue_receive({ + axis_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = {} } + }) + + -- Should NOT send any Zigbee command + test.wait_for_events() + end, + { min_api_version = 17 } +) + +test.run_registered_tests() diff --git a/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_rooms.lua b/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_rooms.lua index 9f80bfdc80..dfecbc28ab 100644 --- a/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_rooms.lua +++ b/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_rooms.lua @@ -58,7 +58,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -80,7 +80,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -102,7 +102,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -124,7 +124,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -146,7 +146,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -169,7 +169,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -189,7 +189,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -209,7 +209,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -229,7 +229,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -251,7 +251,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -296,7 +296,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.windowShadeLevel.shadeLevel(100))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -335,7 +335,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -384,7 +384,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_screen_innovations.lua b/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_screen_innovations.lua index a929eb4e98..17d8d61f76 100644 --- a/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_screen_innovations.lua +++ b/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_screen_innovations.lua @@ -64,7 +64,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -86,7 +86,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -115,7 +115,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -135,7 +135,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -155,7 +155,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -175,7 +175,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -196,7 +196,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -219,7 +219,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -271,7 +271,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -303,7 +303,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -346,7 +346,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -389,7 +389,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -432,7 +432,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -457,7 +457,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_sombra.lua b/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_sombra.lua index 35ab9eab24..febbfe6ea5 100644 --- a/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_sombra.lua +++ b/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_sombra.lua @@ -59,7 +59,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -81,7 +81,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -126,7 +126,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -171,7 +171,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -191,7 +191,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -211,7 +211,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -231,7 +231,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -253,7 +253,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -275,7 +275,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -295,7 +295,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -320,7 +320,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -343,7 +343,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -395,7 +395,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -427,7 +427,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_somfy.lua b/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_somfy.lua index e772b46bb9..7e89c956ea 100644 --- a/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_somfy.lua +++ b/drivers/SmartThings/zigbee-window-treatment/src/test/test_zigbee_window_treatment_somfy.lua @@ -68,7 +68,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -121,7 +121,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -161,7 +161,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -243,7 +243,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -267,7 +267,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -294,7 +294,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -316,7 +316,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -344,7 +344,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -372,7 +372,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -400,7 +400,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -427,7 +427,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -448,7 +448,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -475,7 +475,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -500,7 +500,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -536,7 +536,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -561,7 +561,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -591,7 +591,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -621,7 +621,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -662,7 +662,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/zigbee-window-treatment/src/window_shade_utils.lua b/drivers/SmartThings/zigbee-window-treatment/src/window_shade_utils.lua index f3e09c20a6..fd07648021 100644 --- a/drivers/SmartThings/zigbee-window-treatment/src/window_shade_utils.lua +++ b/drivers/SmartThings/zigbee-window-treatment/src/window_shade_utils.lua @@ -1,6 +1,7 @@ -- Copyright 2025 SmartThings, Inc. -- Licensed under the Apache License, Version 2.0 +local st_utils = require "st.utils" local capabilities = require "st.capabilities" local zcl_clusters = require "st.zigbee.zcl.clusters" @@ -9,6 +10,15 @@ local utils = {} utils.PRESET_LEVEL = 50 utils.PRESET_LEVEL_KEY = "_presetLevel" +-- LATEST_TARGET_LEVEL stores the latest target position during stateless step operations. +-- It is cleared after TARGET_LEVEL_TIME_OUT_SECONDS timeout to allow accumulated steps +-- within a short time frame while preventing indefinite accumulation. +local LATEST_TARGET_LEVEL = "_latestTargetLevel" +-- Timeout in seconds for the stateless step accumulation window +local TARGET_LEVEL_TIME_OUT_SECONDS = 15 +-- Field name for the timer that clears LATEST_TARGET_LEVEL after timeout +local TARGET_LEVEL_TIME_OUT = "_targetLevelTimeOut" + utils.get_preset_level = function(device, component) local level = device:get_latest_state(component, "windowShadePreset", "position") or device:get_field(utils.PRESET_LEVEL_KEY) or @@ -31,4 +41,34 @@ utils.set_preset_position_cmd = function(driver, device, command) device:set_field(utils.PRESET_LEVEL_KEY, command.args.position, {persist = true}) end +-- Step shade level handler for statelessWindowShadeLevelStep capability +utils.step_shade_level_handler = function(driver, device, command) + local step = command.args.stepSize or 0 + if step == 0 then return end + + -- Step from the latest target level if it exists, or from the current shade level + local latest_target_level = device:get_field(LATEST_TARGET_LEVEL) or + device:get_latest_state("main", capabilities.windowShadeLevel.ID, capabilities.windowShadeLevel.shadeLevel.NAME, 0) + local new_target_level = st_utils.clamp_value(latest_target_level + step, 0, 100) + + -- Cancel any previous timer and set a 15 second timeout timer to ensure LATEST_TARGET_LEVEL is cleared + -- This is to prevent the stateless step from accumulating indefinitely, while ensuring that a single + -- "scroll" action can accumulate multiple steps within a short time frame + if device:get_field(TARGET_LEVEL_TIME_OUT) then + device.thread:cancel_timer(device:get_field(TARGET_LEVEL_TIME_OUT)) + end + local timer = device.thread:call_with_delay(TARGET_LEVEL_TIME_OUT_SECONDS, function(d) + device:set_field(LATEST_TARGET_LEVEL, nil) + end) + device:set_field(TARGET_LEVEL_TIME_OUT, timer) + device:set_field(LATEST_TARGET_LEVEL, new_target_level) + + driver:inject_capability_command(device, { + capability = capabilities.windowShadeLevel.ID, + component = command.component, + command = capabilities.windowShadeLevel.commands.setShadeLevel.NAME, + named_args = { shadeLevel = new_target_level } + }) +end + return utils diff --git a/drivers/SmartThings/zwave-bulb/src/test/test_aeon_multiwhite_bulb.lua b/drivers/SmartThings/zwave-bulb/src/test/test_aeon_multiwhite_bulb.lua index 8ef8ceea42..fb2b6cf81c 100644 --- a/drivers/SmartThings/zwave-bulb/src/test/test_aeon_multiwhite_bulb.lua +++ b/drivers/SmartThings/zwave-bulb/src/test/test_aeon_multiwhite_bulb.lua @@ -62,7 +62,7 @@ do } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -83,7 +83,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -107,7 +107,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -131,7 +131,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -157,7 +157,7 @@ do } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -183,7 +183,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -207,7 +207,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -232,7 +232,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -257,7 +257,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -281,7 +281,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -313,7 +313,7 @@ do } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -347,7 +347,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -379,7 +379,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -408,7 +408,7 @@ do } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -438,7 +438,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -465,7 +465,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -493,7 +493,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -570,7 +570,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-bulb/src/test/test_aeotec_led_bulb_6.lua b/drivers/SmartThings/zwave-bulb/src/test/test_aeotec_led_bulb_6.lua index faa5125ebe..49ae2a0145 100644 --- a/drivers/SmartThings/zwave-bulb/src/test/test_aeotec_led_bulb_6.lua +++ b/drivers/SmartThings/zwave-bulb/src/test/test_aeotec_led_bulb_6.lua @@ -105,7 +105,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -159,7 +159,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -188,7 +188,7 @@ do } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-bulb/src/test/test_fibaro_rgbw_controller.lua b/drivers/SmartThings/zwave-bulb/src/test/test_fibaro_rgbw_controller.lua index 0fc5140c4e..6d5782c676 100644 --- a/drivers/SmartThings/zwave-bulb/src/test/test_fibaro_rgbw_controller.lua +++ b/drivers/SmartThings/zwave-bulb/src/test/test_fibaro_rgbw_controller.lua @@ -99,7 +99,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -170,7 +170,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -202,7 +202,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -234,7 +234,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -265,7 +265,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -297,7 +297,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -321,7 +321,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -349,7 +349,7 @@ do } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -398,7 +398,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -478,7 +478,7 @@ do } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -509,7 +509,7 @@ do } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -540,7 +540,7 @@ do } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-bulb/src/test/test_zwave_bulb.lua b/drivers/SmartThings/zwave-bulb/src/test/test_zwave_bulb.lua index a658806774..eea8a679a2 100644 --- a/drivers/SmartThings/zwave-bulb/src/test/test_zwave_bulb.lua +++ b/drivers/SmartThings/zwave-bulb/src/test/test_zwave_bulb.lua @@ -100,7 +100,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -133,7 +133,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -161,7 +161,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -195,7 +195,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -228,7 +228,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -263,7 +263,7 @@ do } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -315,7 +315,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -386,7 +386,7 @@ do } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -431,7 +431,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -479,7 +479,7 @@ do } }, { - min_api_version = 17 + min_api_version = 14 } ) end diff --git a/drivers/SmartThings/zwave-button/fingerprints.yml b/drivers/SmartThings/zwave-button/fingerprints.yml index 6a2995f5cc..df4a621220 100644 --- a/drivers/SmartThings/zwave-button/fingerprints.yml +++ b/drivers/SmartThings/zwave-button/fingerprints.yml @@ -78,4 +78,11 @@ zwaveManufacturer: manufacturerId: 0x0460 productType: 0x0009 productId: 0x0082 - deviceProfileName: multi-button-4-no-battery \ No newline at end of file + deviceProfileName: multi-button-4-no-battery + - id: "0312/0924/D001" + deviceLabel: Z-Wave Scene Control Switch + manufacturerId: 0x0312 + productId: 0xD001 + productType: 0x0924 + deviceProfileName: multi-button-4 + diff --git a/drivers/SmartThings/zwave-button/src/test/test_zwave_aeotec_nanomote_one.lua b/drivers/SmartThings/zwave-button/src/test/test_zwave_aeotec_nanomote_one.lua index 7df9c6cada..a7fd84e0e6 100644 --- a/drivers/SmartThings/zwave-button/src/test/test_zwave_aeotec_nanomote_one.lua +++ b/drivers/SmartThings/zwave-button/src/test/test_zwave_aeotec_nanomote_one.lua @@ -58,7 +58,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-button/src/test/test_zwave_button.lua b/drivers/SmartThings/zwave-button/src/test/test_zwave_button.lua index 664d048010..155157e51b 100644 --- a/drivers/SmartThings/zwave-button/src/test/test_zwave_button.lua +++ b/drivers/SmartThings/zwave-button/src/test/test_zwave_button.lua @@ -49,7 +49,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -68,7 +68,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -89,7 +89,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -110,7 +110,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -141,7 +141,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -173,7 +173,7 @@ test.register_coroutine_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-button/src/test/test_zwave_fibaro_button.lua b/drivers/SmartThings/zwave-button/src/test/test_zwave_fibaro_button.lua index 5418917ee5..39223ad82e 100644 --- a/drivers/SmartThings/zwave-button/src/test/test_zwave_fibaro_button.lua +++ b/drivers/SmartThings/zwave-button/src/test/test_zwave_fibaro_button.lua @@ -57,7 +57,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-button/src/test/test_zwave_multi_button.lua b/drivers/SmartThings/zwave-button/src/test/test_zwave_multi_button.lua index b88a85a800..5e1c27b371 100644 --- a/drivers/SmartThings/zwave-button/src/test/test_zwave_multi_button.lua +++ b/drivers/SmartThings/zwave-button/src/test/test_zwave_multi_button.lua @@ -108,7 +108,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -137,7 +137,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -163,7 +163,7 @@ test.register_coroutine_test( capabilities.button.button.double({state_change = true}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -192,7 +192,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -221,7 +221,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -247,7 +247,7 @@ test.register_coroutine_test( capabilities.button.button.double({state_change = true}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -276,7 +276,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -305,7 +305,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -334,7 +334,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -359,7 +359,7 @@ test.register_coroutine_test( capabilities.button.button.held({state_change = true}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -378,7 +378,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -408,7 +408,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -437,7 +437,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -466,7 +466,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -495,7 +495,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -520,7 +520,7 @@ test.register_coroutine_test( mock_aeotec_keyfob_button:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -608,7 +608,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -649,7 +649,7 @@ test.register_coroutine_test( mock_fibaro_keyfob_button:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -765,7 +765,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -853,7 +853,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -913,7 +913,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -942,7 +942,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-electric-meter/src/test/test_aeon_meter.lua b/drivers/SmartThings/zwave-electric-meter/src/test/test_aeon_meter.lua index 391b3b2b0d..ed4d4f3609 100644 --- a/drivers/SmartThings/zwave-electric-meter/src/test/test_aeon_meter.lua +++ b/drivers/SmartThings/zwave-electric-meter/src/test/test_aeon_meter.lua @@ -54,7 +54,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -76,7 +76,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -107,7 +107,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -139,7 +139,7 @@ test.register_coroutine_test( mock_meter:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-electric-meter/src/test/test_aeotec_gen5_meter.lua b/drivers/SmartThings/zwave-electric-meter/src/test/test_aeotec_gen5_meter.lua index 016aff4061..9534c5d2e1 100644 --- a/drivers/SmartThings/zwave-electric-meter/src/test/test_aeotec_gen5_meter.lua +++ b/drivers/SmartThings/zwave-electric-meter/src/test/test_aeotec_gen5_meter.lua @@ -54,7 +54,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -76,7 +76,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -107,7 +107,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -143,7 +143,7 @@ test.register_coroutine_test( mock_meter:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-electric-meter/src/test/test_qubino_3_phase_meter.lua b/drivers/SmartThings/zwave-electric-meter/src/test/test_qubino_3_phase_meter.lua index ce9b61f949..fad1510245 100644 --- a/drivers/SmartThings/zwave-electric-meter/src/test/test_qubino_3_phase_meter.lua +++ b/drivers/SmartThings/zwave-electric-meter/src/test/test_qubino_3_phase_meter.lua @@ -96,7 +96,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -118,7 +118,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -180,7 +180,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -222,7 +222,7 @@ test.register_coroutine_test( mock_meter:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-electric-meter/src/test/test_qubino_smart_meter.lua b/drivers/SmartThings/zwave-electric-meter/src/test/test_qubino_smart_meter.lua index d96d90aae1..e97be3bde3 100644 --- a/drivers/SmartThings/zwave-electric-meter/src/test/test_qubino_smart_meter.lua +++ b/drivers/SmartThings/zwave-electric-meter/src/test/test_qubino_smart_meter.lua @@ -54,7 +54,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -76,7 +76,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -107,7 +107,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -127,7 +127,7 @@ test.register_coroutine_test( mock_meter:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-electric-meter/src/test/test_zwave_electric_meter.lua b/drivers/SmartThings/zwave-electric-meter/src/test/test_zwave_electric_meter.lua index 4df103e086..436862230d 100644 --- a/drivers/SmartThings/zwave-electric-meter/src/test/test_zwave_electric_meter.lua +++ b/drivers/SmartThings/zwave-electric-meter/src/test/test_zwave_electric_meter.lua @@ -47,7 +47,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -69,7 +69,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -100,7 +100,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-fan/src/test/test_zwave_fan_3_speed.lua b/drivers/SmartThings/zwave-fan/src/test/test_zwave_fan_3_speed.lua index 534c48698e..179baed5aa 100644 --- a/drivers/SmartThings/zwave-fan/src/test/test_zwave_fan_3_speed.lua +++ b/drivers/SmartThings/zwave-fan/src/test/test_zwave_fan_3_speed.lua @@ -64,7 +64,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -96,7 +96,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -129,7 +129,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -160,7 +160,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -194,7 +194,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-fan/src/test/test_zwave_fan_4_speed.lua b/drivers/SmartThings/zwave-fan/src/test/test_zwave_fan_4_speed.lua index 80ccef948b..fc8a5b742c 100644 --- a/drivers/SmartThings/zwave-fan/src/test/test_zwave_fan_4_speed.lua +++ b/drivers/SmartThings/zwave-fan/src/test/test_zwave_fan_4_speed.lua @@ -63,7 +63,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -94,7 +94,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -127,7 +127,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -158,7 +158,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -192,7 +192,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-garage-door-opener/src/test/test_ecolink_garage_door_operator.lua b/drivers/SmartThings/zwave-garage-door-opener/src/test/test_ecolink_garage_door_operator.lua index 0608ca2ef2..ae86832e4d 100644 --- a/drivers/SmartThings/zwave-garage-door-opener/src/test/test_ecolink_garage_door_operator.lua +++ b/drivers/SmartThings/zwave-garage-door-opener/src/test/test_ecolink_garage_door_operator.lua @@ -59,7 +59,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -78,7 +78,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -120,7 +120,7 @@ test.register_message_test( { test_init = test_init, inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -160,7 +160,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -183,7 +183,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -206,7 +206,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -234,7 +234,7 @@ test.register_coroutine_test( mock_garage_door:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -264,7 +264,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -294,7 +294,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -311,7 +311,7 @@ test.register_coroutine_test( test.mock_time.advance_time(1) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -328,7 +328,7 @@ test.register_coroutine_test( test.mock_time.advance_time(1) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-garage-door-opener/src/test/test_mimolite_garage_door.lua b/drivers/SmartThings/zwave-garage-door-opener/src/test/test_mimolite_garage_door.lua index cc33391a4c..946978e0b0 100644 --- a/drivers/SmartThings/zwave-garage-door-opener/src/test/test_mimolite_garage_door.lua +++ b/drivers/SmartThings/zwave-garage-door-opener/src/test/test_mimolite_garage_door.lua @@ -59,7 +59,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -83,7 +83,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -107,7 +107,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -131,7 +131,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -155,7 +155,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -179,7 +179,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -213,7 +213,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -247,7 +247,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -277,7 +277,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -307,7 +307,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -327,7 +327,7 @@ test.register_coroutine_test( mock_garage_door:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -350,7 +350,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) test.run_registered_tests() diff --git a/drivers/SmartThings/zwave-garage-door-opener/src/test/test_zwave_garage_door_opener.lua b/drivers/SmartThings/zwave-garage-door-opener/src/test/test_zwave_garage_door_opener.lua index 0d5da468e8..366824a8d2 100644 --- a/drivers/SmartThings/zwave-garage-door-opener/src/test/test_zwave_garage_door_opener.lua +++ b/drivers/SmartThings/zwave-garage-door-opener/src/test/test_zwave_garage_door_opener.lua @@ -50,7 +50,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -69,7 +69,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -93,7 +93,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -117,7 +117,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -136,7 +136,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -156,7 +156,7 @@ test.register_message_test( }, { test_init = test_init, - min_api_version = 17 + min_api_version = 14 } ) @@ -177,7 +177,7 @@ test.register_message_test( { test_init = test_init, inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-lock/src/init.lua b/drivers/SmartThings/zwave-lock/src/init.lua index 5aeb499b63..b49489a008 100644 --- a/drivers/SmartThings/zwave-lock/src/init.lua +++ b/drivers/SmartThings/zwave-lock/src/init.lua @@ -67,7 +67,8 @@ local driver_template = { }, zwave_handlers = { [cc.TIME] = { - [0x01] = zwave_handlers.time_get_handler -- used by DanaLock + [0x01] = zwave_handlers.time_get_handler, -- used by DanaLock + [0x03] = zwave_handlers.date_get_handler }, [cc.NOTIFICATION] = { [Notification.REPORT] = zwave_handlers.notification_report diff --git a/drivers/SmartThings/zwave-lock/src/lock_handlers/zwave_responses.lua b/drivers/SmartThings/zwave-lock/src/lock_handlers/zwave_responses.lua index cfabe41932..7822ab2bfe 100644 --- a/drivers/SmartThings/zwave-lock/src/lock_handlers/zwave_responses.lua +++ b/drivers/SmartThings/zwave-lock/src/lock_handlers/zwave_responses.lua @@ -240,4 +240,17 @@ function ZwaveHandlers.time_get_handler(driver, device, cmd) ) end +function ZwaveHandlers.date_get_handler(driver, device, cmd) + local Time = (require "st.zwave.CommandClass.Time")({ version = 1 }) + local time = os.date("*t") + device:send_to_component( + Time:DateReport({ + year = time.year, + month = time.month, + day = time.day + }), + device:endpoint_to_component(cmd.src_channel) + ) +end + return ZwaveHandlers diff --git a/drivers/SmartThings/zwave-lock/src/test/test_keywe_lock.lua b/drivers/SmartThings/zwave-lock/src/test/test_keywe_lock.lua index 6724094462..0a41f80f2b 100644 --- a/drivers/SmartThings/zwave-lock/src/test/test_keywe_lock.lua +++ b/drivers/SmartThings/zwave-lock/src/test/test_keywe_lock.lua @@ -88,7 +88,9 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.lock.lock.unlocked({data={method="manual"}}))) test.socket.zwave:__queue_receive({ mock_device.id, Notification:Report({notification_type = 6, event = 25}) } ) test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.lock.lock.locked({data={method="manual"}}))) - end -) + end, + { + min_api_version = 17 + }) test.run_registered_tests() diff --git a/drivers/SmartThings/zwave-lock/src/test/test_keywe_lock_legacy.lua b/drivers/SmartThings/zwave-lock/src/test/test_keywe_lock_legacy.lua index a5c7aee7d4..63a8729ce9 100644 --- a/drivers/SmartThings/zwave-lock/src/test/test_keywe_lock_legacy.lua +++ b/drivers/SmartThings/zwave-lock/src/test/test_keywe_lock_legacy.lua @@ -46,7 +46,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.lock.lock.unlocked())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -59,7 +59,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.lock.lock.locked())) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-lock/src/test/test_lock_battery.lua b/drivers/SmartThings/zwave-lock/src/test/test_lock_battery.lua index 11c03650c6..3254edf58a 100644 --- a/drivers/SmartThings/zwave-lock/src/test/test_lock_battery.lua +++ b/drivers/SmartThings/zwave-lock/src/test/test_lock_battery.lua @@ -60,7 +60,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.lock.lock.unlocked())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -79,7 +79,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -98,7 +98,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -115,7 +115,7 @@ test.register_coroutine_test( test.socket.zwave:__expect_send(DoorLock:OperationGet({}):build_test_tx(mock_device.id)) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -136,7 +136,28 @@ test.register_coroutine_test( }):build_test_tx(mock_device.id)) end, { - min_api_version = 17 + min_api_version = 14 + } +) + +test.register_coroutine_test( + "The driver should respond correctly to a date get", + function () + test.socket.zwave:__queue_receive({ mock_device.id, Time:DateGet({},{ + encap = zw.ENCAP.AUTO, + src_channel = 0, + dst_channels = {} + }) + }) + local time = os.date("*t") + test.socket.zwave:__expect_send(Time:DateReport({ + year = time.year, + month = time.month, + day = time.day + }):build_test_tx(mock_device.id)) + end, + { + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-lock/src/test/test_lock_credentials_commands.lua b/drivers/SmartThings/zwave-lock/src/test/test_lock_credentials_commands.lua index 96b192a03d..5daee2191a 100644 --- a/drivers/SmartThings/zwave-lock/src/test/test_lock_credentials_commands.lua +++ b/drivers/SmartThings/zwave-lock/src/test/test_lock_credentials_commands.lua @@ -175,7 +175,10 @@ test.register_coroutine_test( )) ) test.wait_for_events() - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -200,7 +203,10 @@ test.register_coroutine_test( )) ) test.wait_for_events() - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -229,7 +235,10 @@ test.register_coroutine_test( )) ) test.wait_for_events() - end + end, + { + min_api_version = 15 + } ) -- ============================================================================ @@ -253,7 +262,10 @@ test.register_coroutine_test( )) ) test.wait_for_events() - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -275,7 +287,10 @@ test.register_coroutine_test( )) ) test.wait_for_events() - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -297,7 +312,10 @@ test.register_coroutine_test( )) ) test.wait_for_events() - end + end, + { + min_api_version = 15 + } ) -- ============================================================================ @@ -321,7 +339,10 @@ test.register_coroutine_test( )) ) test.wait_for_events() - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -341,7 +362,10 @@ test.register_coroutine_test( )) ) test.wait_for_events() - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -363,7 +387,10 @@ test.register_coroutine_test( )) ) test.wait_for_events() - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -385,7 +412,10 @@ test.register_coroutine_test( )) ) test.wait_for_events() - end + end, + { + min_api_version = 15 + } ) -- ============================================================================ @@ -423,7 +453,10 @@ test.register_coroutine_test( )) ) test.wait_for_events() - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -445,7 +478,10 @@ test.register_coroutine_test( )) ) test.wait_for_events() - end + end, + { + min_api_version = 15 + } ) test.register_coroutine_test( @@ -474,7 +510,10 @@ test.register_coroutine_test( )) ) test.wait_for_events() - end + end, + { + min_api_version = 15 + } ) test.run_registered_tests() diff --git a/drivers/SmartThings/zwave-lock/src/test/test_lock_pre_configured.lua b/drivers/SmartThings/zwave-lock/src/test/test_lock_pre_configured.lua index 0895ff3215..ef264e0c88 100644 --- a/drivers/SmartThings/zwave-lock/src/test/test_lock_pre_configured.lua +++ b/drivers/SmartThings/zwave-lock/src/test/test_lock_pre_configured.lua @@ -205,7 +205,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) -- ============================================================================ -- updateUser — pre-configured device @@ -240,7 +243,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) test.register_coroutine_test( "updateUser (pre-configured): returns failure for a userIndex that does not exist", @@ -273,7 +279,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) -- ============================================================================ -- deleteUser with associated credential — exercises clear_pin_code_response @@ -324,7 +333,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) -- ============================================================================ -- addCredential response states — set_pin_code_response @@ -365,7 +377,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) test.register_coroutine_test( "addCredential (pre-configured): emits duplicate when the lock rejects with DUPLICATE_CODE", @@ -392,7 +407,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) test.register_coroutine_test( "addCredential (pre-configured): emits failure when the lock returns available", @@ -419,7 +437,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) -- ============================================================================ -- updateCredential response states — set_pin_code_response @@ -450,7 +471,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) test.register_coroutine_test( "updateCredential (pre-configured): returns failure immediately for a non-existent credentialIndex", @@ -472,7 +496,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) -- ============================================================================ -- deleteCredential standalone (lockCredentials.DELETE path) @@ -509,6 +536,9 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) test.run_registered_tests() diff --git a/drivers/SmartThings/zwave-lock/src/test/test_lock_users_commands.lua b/drivers/SmartThings/zwave-lock/src/test/test_lock_users_commands.lua index da39c8c692..21c829c497 100644 --- a/drivers/SmartThings/zwave-lock/src/test/test_lock_users_commands.lua +++ b/drivers/SmartThings/zwave-lock/src/test/test_lock_users_commands.lua @@ -192,7 +192,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) test.register_coroutine_test( "addUser: assigns the next sequential userIndex when users already exist", @@ -223,7 +226,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) test.register_coroutine_test( "addUser: fills a gap left by a deleted user rather than appending beyond max", @@ -259,7 +265,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) test.register_coroutine_test( "addUser: returns resourceExhausted when totalUsersSupported has been reached", @@ -284,7 +293,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) -- ============================================================================ -- updateUser @@ -322,7 +334,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) test.register_coroutine_test( "updateUser: creates user when userIndex does not exist", @@ -352,7 +367,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) test.register_coroutine_test( "updateUser: can change a user's type as well as name", @@ -380,7 +398,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) -- ============================================================================ -- deleteUser (no associated credential — pure local delete) @@ -415,7 +436,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) test.register_coroutine_test( "deleteUser: returns failure when the target userIndex is not in the users table", @@ -435,7 +459,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) -- ============================================================================ -- deleteAllUsers (injects deleteAllCredentials → ClearAllPINCodes z-wave flow) @@ -495,7 +522,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) test.register_coroutine_test( "deleteAllUsers: emits busy when another lock command is in progress", @@ -517,7 +547,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) -- ============================================================================ -- State-consistency: add → delete → re-add (indices 1, 2, 3 lifecycle) @@ -590,7 +623,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) test.register_coroutine_test( "State-consistency: add users+credentials 1-3, deleteUser 2 (with credential), re-add user+credential reclaims index 2 cleanly", @@ -700,6 +736,9 @@ test.register_coroutine_test( }) == constants.COMMAND_RESULT.SUCCESS) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) test.run_registered_tests() diff --git a/drivers/SmartThings/zwave-lock/src/test/test_samsung_lock_legacy.lua b/drivers/SmartThings/zwave-lock/src/test/test_samsung_lock_legacy.lua index 81ba1df2ad..42cb17a2a2 100644 --- a/drivers/SmartThings/zwave-lock/src/test/test_samsung_lock_legacy.lua +++ b/drivers/SmartThings/zwave-lock/src/test/test_samsung_lock_legacy.lua @@ -51,7 +51,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -97,7 +97,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -114,7 +114,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.lockCodes.codeChanged("2 failed", { state_change = true }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -131,7 +131,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.lockCodes.codeChanged(2 .. " failed", { state_change = true }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -176,7 +176,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-lock/src/test/test_schlage_lock_legacy.lua b/drivers/SmartThings/zwave-lock/src/test/test_schlage_lock_legacy.lua index 38dabbd9dd..3c8a165f7f 100644 --- a/drivers/SmartThings/zwave-lock/src/test/test_schlage_lock_legacy.lua +++ b/drivers/SmartThings/zwave-lock/src/test/test_schlage_lock_legacy.lua @@ -77,7 +77,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -97,7 +97,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -116,7 +116,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -148,7 +148,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -167,7 +167,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -204,7 +204,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -232,7 +232,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -259,7 +259,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-lock/src/test/test_zwave_lock_legacy.lua b/drivers/SmartThings/zwave-lock/src/test/test_zwave_lock_legacy.lua index 66038d0760..b7ddf56227 100644 --- a/drivers/SmartThings/zwave-lock/src/test/test_zwave_lock_legacy.lua +++ b/drivers/SmartThings/zwave-lock/src/test/test_zwave_lock_legacy.lua @@ -62,7 +62,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.lock.lock.locked())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -81,7 +81,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -105,7 +105,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -137,7 +137,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -162,7 +162,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -179,7 +179,7 @@ test.register_coroutine_test( test.socket.zwave:__expect_send(DoorLock:OperationGet({}):build_test_tx(mock_device.id)) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -198,7 +198,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -209,7 +209,7 @@ test.register_coroutine_test( expect_reload_all_codes_messages() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -228,7 +228,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -244,7 +244,7 @@ test.register_coroutine_test( test.socket.zwave:__expect_send(UserCode:Get( {user_identifier = 1}):build_test_tx(mock_device.id)) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -264,7 +264,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -289,7 +289,7 @@ test.register_coroutine_test( {state_change = true}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -316,7 +316,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -341,7 +341,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -371,7 +371,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -395,7 +395,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -438,7 +438,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -463,7 +463,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -488,7 +488,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -519,7 +519,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -754,7 +754,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -779,7 +779,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -808,7 +808,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-lock/src/test/test_zwave_responses.lua b/drivers/SmartThings/zwave-lock/src/test/test_zwave_responses.lua index 71bf25209d..24db26a3ba 100644 --- a/drivers/SmartThings/zwave-lock/src/test/test_zwave_responses.lua +++ b/drivers/SmartThings/zwave-lock/src/test/test_zwave_responses.lua @@ -100,7 +100,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) test.register_coroutine_test( "user_code_report: sync completes when the last slot is reached", @@ -140,7 +143,10 @@ test.register_coroutine_test( assert(mock_device:get_field(constants.DRIVER_STATE.BUSY) == false, "BUSY must be false after sync completes") end -) +, + { + min_api_version = 15 + }) test.register_coroutine_test( "user_code_report: out-of-band ENABLED code creates user and credential entries", @@ -173,7 +179,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) -- ============================================================================ -- user_code_event_handler (ACCESS_CONTROL Notification:Report) @@ -208,7 +217,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) test.register_coroutine_test( "user_code_event: multi-byte event_parameter uses byte 3 to extract user_id", @@ -239,7 +251,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) -- ============================================================================ -- door_operation_event_handler (ACCESS_CONTROL Notification:Report) @@ -279,7 +294,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) test.register_coroutine_test( "door_operation_event: KEYPAD_UNLOCK_OPERATION with unknown credential sets userIndex from event_parameter", @@ -306,7 +324,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) test.register_coroutine_test( "door_operation_event: AUTO_LOCK_LOCKED_OPERATION emits locked with auto method", @@ -327,7 +348,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) -- ============================================================================ -- DoorLock:OperationReport → lock state @@ -346,7 +370,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) test.register_coroutine_test( "OperationReport: DOOR_UNSECURED emits unlocked event", @@ -360,7 +387,10 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) -- ============================================================================ -- users_number_report: UserCode:UsersNumberReport @@ -388,6 +418,9 @@ test.register_coroutine_test( ) test.wait_for_events() end -) +, + { + min_api_version = 15 + }) test.run_registered_tests() diff --git a/drivers/SmartThings/zwave-mouse-trap/src/test/test_zwave_mouse_trap.lua b/drivers/SmartThings/zwave-mouse-trap/src/test/test_zwave_mouse_trap.lua index 519f577c86..ca1ae9ede4 100644 --- a/drivers/SmartThings/zwave-mouse-trap/src/test/test_zwave_mouse_trap.lua +++ b/drivers/SmartThings/zwave-mouse-trap/src/test/test_zwave_mouse_trap.lua @@ -67,7 +67,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -89,7 +89,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -111,7 +111,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -133,7 +133,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -155,7 +155,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -177,7 +177,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -199,7 +199,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -221,7 +221,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -243,7 +243,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -262,7 +262,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -281,7 +281,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -335,7 +335,7 @@ test.register_coroutine_test( mock_mouse_trap:expect_metadata_update({provisioning_state = "PROVISIONED"}) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_aeon_multisensor.lua b/drivers/SmartThings/zwave-sensor/src/test/test_aeon_multisensor.lua index 472932fdfb..649855f9c3 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_aeon_multisensor.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_aeon_multisensor.lua @@ -83,7 +83,7 @@ test.register_coroutine_test( mock_sensor:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -108,7 +108,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_aeotec_multisensor_6.lua b/drivers/SmartThings/zwave-sensor/src/test/test_aeotec_multisensor_6.lua index 323c0d4807..9e7a02851b 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_aeotec_multisensor_6.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_aeotec_multisensor_6.lua @@ -108,7 +108,7 @@ test.register_coroutine_test( mock_sensor:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -159,7 +159,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) test.register_coroutine_test( @@ -231,7 +231,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -253,7 +253,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -288,7 +288,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -323,7 +323,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -345,7 +345,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -369,7 +369,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -405,7 +405,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -429,7 +429,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -454,7 +454,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_aeotec_multisensor_7.lua b/drivers/SmartThings/zwave-sensor/src/test/test_aeotec_multisensor_7.lua index 13442ec635..648fb9a5ad 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_aeotec_multisensor_7.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_aeotec_multisensor_7.lua @@ -110,7 +110,7 @@ test.register_coroutine_test( mock_sensor:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -159,7 +159,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) test.register_coroutine_test( @@ -229,7 +229,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -251,7 +251,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -286,7 +286,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -321,7 +321,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_aeotec_multisensor_gen5.lua b/drivers/SmartThings/zwave-sensor/src/test/test_aeotec_multisensor_gen5.lua index b6ede32bd5..25bba0e7b8 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_aeotec_multisensor_gen5.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_aeotec_multisensor_gen5.lua @@ -98,7 +98,7 @@ test.register_coroutine_test( mock_sensor:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_aeotec_water_sensor.lua b/drivers/SmartThings/zwave-sensor/src/test/test_aeotec_water_sensor.lua index e38ce96f37..62ab74cfde 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_aeotec_water_sensor.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_aeotec_water_sensor.lua @@ -78,7 +78,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -97,7 +97,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -116,7 +116,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -138,7 +138,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -160,7 +160,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -182,7 +182,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -204,7 +204,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -223,7 +223,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -245,7 +245,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -267,7 +267,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -289,7 +289,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -311,7 +311,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_aeotec_water_sensor_7.lua b/drivers/SmartThings/zwave-sensor/src/test/test_aeotec_water_sensor_7.lua index 0f3dc972de..26e61fae14 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_aeotec_water_sensor_7.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_aeotec_water_sensor_7.lua @@ -52,7 +52,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -74,7 +74,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -96,7 +96,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -118,7 +118,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -140,7 +140,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -168,7 +168,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_sensor:generate_test_message("main", capabilities.tamperAlert.tamper.clear())) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_enerwave_motion_sensor.lua b/drivers/SmartThings/zwave-sensor/src/test/test_enerwave_motion_sensor.lua index 3559656e3a..73af4449dc 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_enerwave_motion_sensor.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_enerwave_motion_sensor.lua @@ -53,7 +53,7 @@ test.register_coroutine_test( mock_sensor:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -76,7 +76,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -98,7 +98,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_everpsring_sp817.lua b/drivers/SmartThings/zwave-sensor/src/test/test_everpsring_sp817.lua index a33f9b97ec..df57046912 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_everpsring_sp817.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_everpsring_sp817.lua @@ -51,7 +51,7 @@ test.register_coroutine_test( mock_sensor:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -88,7 +88,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_everspring_PIR_sensor.lua b/drivers/SmartThings/zwave-sensor/src/test/test_everspring_PIR_sensor.lua index 8479a5f74f..9efe546309 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_everspring_PIR_sensor.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_everspring_PIR_sensor.lua @@ -58,7 +58,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -81,7 +81,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -108,7 +108,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_sensor:generate_test_message("main", capabilities.tamperAlert.tamper.clear())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -130,7 +130,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -153,7 +153,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -203,7 +203,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_everspring_ST814.lua b/drivers/SmartThings/zwave-sensor/src/test/test_everspring_ST814.lua index 3c288c0be4..1bef4fb686 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_everspring_ST814.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_everspring_ST814.lua @@ -50,7 +50,7 @@ test.register_coroutine_test( mock_sensor:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_everspring_illuminance_sensor.lua b/drivers/SmartThings/zwave-sensor/src/test/test_everspring_illuminance_sensor.lua index ab124e8f80..dfce8285d9 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_everspring_illuminance_sensor.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_everspring_illuminance_sensor.lua @@ -54,7 +54,7 @@ test.register_coroutine_test( mock_sensor:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_everspring_motion_light_sensor.lua b/drivers/SmartThings/zwave-sensor/src/test/test_everspring_motion_light_sensor.lua index 0a31f97de5..0babb02dc1 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_everspring_motion_light_sensor.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_everspring_motion_light_sensor.lua @@ -66,7 +66,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_ezmultipli_multipurpose_sensor.lua b/drivers/SmartThings/zwave-sensor/src/test/test_ezmultipli_multipurpose_sensor.lua index fb2138c0d5..08289dd301 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_ezmultipli_multipurpose_sensor.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_ezmultipli_multipurpose_sensor.lua @@ -52,7 +52,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -81,7 +81,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -119,7 +119,7 @@ do )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -159,7 +159,7 @@ do )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -293,7 +293,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_door_window_sensor.lua b/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_door_window_sensor.lua index 05e306b6c7..386891a9cc 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_door_window_sensor.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_door_window_sensor.lua @@ -73,7 +73,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -97,7 +97,7 @@ test.register_coroutine_test( mock_fibaro_door_window_sensor:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -116,7 +116,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -138,7 +138,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -160,7 +160,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -183,7 +183,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -205,7 +205,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_door_window_sensor_1.lua b/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_door_window_sensor_1.lua index 6707dd7ae0..8e9c936237 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_door_window_sensor_1.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_door_window_sensor_1.lua @@ -121,7 +121,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -210,7 +210,7 @@ test.register_coroutine_test( mock_fibaro_door_window_sensor1:expect_metadata_update({provisioning_state = "PROVISIONED"}) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -229,7 +229,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -251,7 +251,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -273,7 +273,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -300,7 +300,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -327,7 +327,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -349,7 +349,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -370,7 +370,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -401,7 +401,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -431,7 +431,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_door_window_sensor_2.lua b/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_door_window_sensor_2.lua index 8fd23b208b..7a1ddb417e 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_door_window_sensor_2.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_door_window_sensor_2.lua @@ -59,7 +59,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -81,7 +81,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -103,7 +103,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -125,7 +125,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -147,7 +147,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -169,7 +169,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -191,7 +191,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -308,7 +308,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -349,7 +349,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -385,7 +385,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_door_window_sensor_with_temperature.lua b/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_door_window_sensor_with_temperature.lua index 4d3e6e0660..0b970eded6 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_door_window_sensor_with_temperature.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_door_window_sensor_with_temperature.lua @@ -85,7 +85,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -113,7 +113,7 @@ test.register_coroutine_test( mock_fibaro_door_window_sensor:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -132,7 +132,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -154,7 +154,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -176,7 +176,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -199,7 +199,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -221,7 +221,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -252,7 +252,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -282,7 +282,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -559,7 +559,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_flood_sensor.lua b/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_flood_sensor.lua index 0ac7e57418..7de8a345b3 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_flood_sensor.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_flood_sensor.lua @@ -54,7 +54,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -73,7 +73,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -94,7 +94,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -115,7 +115,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -145,7 +145,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -167,7 +167,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -189,7 +189,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -216,7 +216,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_sensor:generate_test_message("main", capabilities.tamperAlert.tamper.clear())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -243,7 +243,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_sensor:generate_test_message("main", capabilities.tamperAlert.tamper.clear())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -270,7 +270,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_sensor:generate_test_message("main", capabilities.tamperAlert.tamper.clear())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -297,7 +297,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_sensor:generate_test_message("main", capabilities.tamperAlert.tamper.clear())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -328,7 +328,7 @@ test.register_coroutine_test( mock_sensor:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_flood_sensor_zw5.lua b/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_flood_sensor_zw5.lua index 530d1c03bb..dc47194f8c 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_flood_sensor_zw5.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_flood_sensor_zw5.lua @@ -82,7 +82,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_motion_sensor.lua b/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_motion_sensor.lua index 3dbfd89bc7..3a2f5b3644 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_motion_sensor.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_motion_sensor.lua @@ -87,7 +87,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -106,7 +106,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -133,7 +133,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -155,7 +155,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -177,7 +177,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -199,7 +199,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -221,7 +221,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -244,7 +244,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -266,7 +266,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -288,7 +288,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -315,7 +315,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -346,7 +346,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -376,7 +376,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_motion_sensor_zw5.lua b/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_motion_sensor_zw5.lua index ac2022e069..22f9df61db 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_motion_sensor_zw5.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_fibaro_motion_sensor_zw5.lua @@ -69,7 +69,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -208,7 +208,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_firmware_version.lua b/drivers/SmartThings/zwave-sensor/src/test/test_firmware_version.lua index bf4c68d5bb..e85f290f11 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_firmware_version.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_firmware_version.lua @@ -86,7 +86,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -108,7 +108,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -124,7 +124,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_generic_sensor.lua b/drivers/SmartThings/zwave-sensor/src/test/test_generic_sensor.lua index 3496ebb6d5..9f8019e240 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_generic_sensor.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_generic_sensor.lua @@ -63,7 +63,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -86,7 +86,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -108,7 +108,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -131,7 +131,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -154,7 +154,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -176,7 +176,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -207,7 +207,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -238,7 +238,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -260,7 +260,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -283,7 +283,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -313,7 +313,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -344,7 +344,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -366,7 +366,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -388,7 +388,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -412,7 +412,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -456,7 +456,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -500,7 +500,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -522,7 +522,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -544,7 +544,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -571,7 +571,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -598,7 +598,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -692,7 +692,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -786,7 +786,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -808,7 +808,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -830,7 +830,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -852,7 +852,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -874,7 +874,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -896,7 +896,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -918,7 +918,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -940,7 +940,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -962,7 +962,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -984,7 +984,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1006,7 +1006,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1028,7 +1028,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1050,7 +1050,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1072,7 +1072,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1105,7 +1105,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -1127,7 +1127,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1149,7 +1149,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1171,7 +1171,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1199,7 +1199,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -1221,7 +1221,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1243,7 +1243,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1265,7 +1265,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1287,7 +1287,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1309,7 +1309,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1331,7 +1331,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1353,7 +1353,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1375,7 +1375,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1397,7 +1397,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1419,7 +1419,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1441,7 +1441,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1463,7 +1463,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1485,7 +1485,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1506,7 +1506,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1527,7 +1527,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1549,7 +1549,7 @@ test.register_coroutine_test( test.socket.zwave:__expect_send(zw_test_utils.zwave_test_build_send_command(mock_device, Battery:Get({}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1571,7 +1571,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1593,7 +1593,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_glentronics_water_leak_sensor.lua b/drivers/SmartThings/zwave-sensor/src/test/test_glentronics_water_leak_sensor.lua index 926558036b..52a3a50b9a 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_glentronics_water_leak_sensor.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_glentronics_water_leak_sensor.lua @@ -70,7 +70,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -95,7 +95,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -120,7 +120,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -145,7 +145,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -170,7 +170,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -196,7 +196,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -222,7 +222,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_homeseer_multi_sensor.lua b/drivers/SmartThings/zwave-sensor/src/test/test_homeseer_multi_sensor.lua index 743ffc5298..dd9101edf7 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_homeseer_multi_sensor.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_homeseer_multi_sensor.lua @@ -51,7 +51,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -70,7 +70,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -92,7 +92,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -137,7 +137,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) test.register_coroutine_test( @@ -168,7 +168,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) test.run_registered_tests() diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_no_wakeup_poll.lua b/drivers/SmartThings/zwave-sensor/src/test/test_no_wakeup_poll.lua index c88527f0cd..c9eb716c3b 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_no_wakeup_poll.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_no_wakeup_poll.lua @@ -100,7 +100,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_sensative_strip.lua b/drivers/SmartThings/zwave-sensor/src/test/test_sensative_strip.lua index fb9b519a42..0071f3f09a 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_sensative_strip.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_sensative_strip.lua @@ -61,7 +61,7 @@ test.register_coroutine_test( mock_sensor:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -72,7 +72,7 @@ test.register_coroutine_test( mock_sensor:expect_metadata_update({ profile = "illuminance-temperature" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -94,7 +94,7 @@ test.register_coroutine_test( test.socket.zwave:__queue_receive({mock_sensor.id, WakeUp:Notification({})}) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_smartthings_water_leak_sensor.lua b/drivers/SmartThings/zwave-sensor/src/test/test_smartthings_water_leak_sensor.lua index e80e28dbd9..cf7d08ebdf 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_smartthings_water_leak_sensor.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_smartthings_water_leak_sensor.lua @@ -59,7 +59,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -81,7 +81,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -103,7 +103,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -125,7 +125,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -147,7 +147,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -169,7 +169,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -191,7 +191,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -222,7 +222,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -253,7 +253,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -272,7 +272,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -291,7 +291,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -310,7 +310,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_v1_contact_event.lua b/drivers/SmartThings/zwave-sensor/src/test/test_v1_contact_event.lua index 4cfd906636..0db72f1b50 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_v1_contact_event.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_v1_contact_event.lua @@ -57,7 +57,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -84,7 +84,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -104,7 +104,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.tamperAlert.tamper.clear())) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_vision_motion_detector.lua b/drivers/SmartThings/zwave-sensor/src/test/test_vision_motion_detector.lua index 3cd16b6fa3..11d62dd11f 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_vision_motion_detector.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_vision_motion_detector.lua @@ -58,7 +58,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -80,7 +80,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -102,7 +102,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -124,7 +124,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -163,7 +163,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -187,7 +187,7 @@ test.register_coroutine_test( mock_sensor:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_zooz_4_in_1_sensor.lua b/drivers/SmartThings/zwave-sensor/src/test/test_zooz_4_in_1_sensor.lua index fde2d5ebfe..63b0b2bb8a 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_zooz_4_in_1_sensor.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_zooz_4_in_1_sensor.lua @@ -53,7 +53,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -76,7 +76,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -103,7 +103,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_sensor:generate_test_message("main", capabilities.tamperAlert.tamper.clear())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -125,7 +125,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -148,7 +148,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -169,7 +169,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -192,7 +192,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -214,7 +214,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -239,7 +239,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -260,7 +260,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_zwave_motion_light_sensor.lua b/drivers/SmartThings/zwave-sensor/src/test/test_zwave_motion_light_sensor.lua index 7a8adbeb10..5559a53c79 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_zwave_motion_light_sensor.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_zwave_motion_light_sensor.lua @@ -59,7 +59,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -86,7 +86,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -108,7 +108,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -129,7 +129,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -151,7 +151,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -173,7 +173,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -196,7 +196,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -218,7 +218,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -245,7 +245,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -292,7 +292,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -307,7 +307,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_zwave_motion_temp_light_sensor.lua b/drivers/SmartThings/zwave-sensor/src/test/test_zwave_motion_temp_light_sensor.lua index 8e463e7625..b6c70bdadb 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_zwave_motion_temp_light_sensor.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_zwave_motion_temp_light_sensor.lua @@ -55,7 +55,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -82,7 +82,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -104,7 +104,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -126,7 +126,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -148,7 +148,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -170,7 +170,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -192,7 +192,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -219,7 +219,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -247,7 +247,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_zwave_sensor.lua b/drivers/SmartThings/zwave-sensor/src/test/test_zwave_sensor.lua index 677204e5d1..29354370e4 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_zwave_sensor.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_zwave_sensor.lua @@ -131,7 +131,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -235,7 +235,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -272,7 +272,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -294,7 +294,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -316,7 +316,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -338,7 +338,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -359,7 +359,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -380,7 +380,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -411,7 +411,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -438,7 +438,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -460,7 +460,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -482,7 +482,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -504,7 +504,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -526,7 +526,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -548,7 +548,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -570,7 +570,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -602,7 +602,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -624,7 +624,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -646,7 +646,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -673,7 +673,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -700,7 +700,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -727,7 +727,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -749,7 +749,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -771,7 +771,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -794,7 +794,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -815,7 +815,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -836,7 +836,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_zwave_water_sensor.lua b/drivers/SmartThings/zwave-sensor/src/test/test_zwave_water_sensor.lua index 775130d87e..fa5f64bff0 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_zwave_water_sensor.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_zwave_water_sensor.lua @@ -57,7 +57,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -76,7 +76,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -95,7 +95,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -117,7 +117,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -139,7 +139,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -161,7 +161,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -183,7 +183,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -202,7 +202,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -224,7 +224,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -246,7 +246,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -268,7 +268,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -290,7 +290,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-sensor/src/timed-tamper-clear/init.lua b/drivers/SmartThings/zwave-sensor/src/timed-tamper-clear/init.lua index 8554dab28f..dd6cc672f4 100644 --- a/drivers/SmartThings/zwave-sensor/src/timed-tamper-clear/init.lua +++ b/drivers/SmartThings/zwave-sensor/src/timed-tamper-clear/init.lua @@ -22,6 +22,13 @@ local function handle_tamper_event(driver, device, cmd) device.thread:cancel_timer(tamper_timer) end device:set_field(TAMPER_TIMER, device.thread:call_with_delay(TAMPER_CLEAR, function() + -- The device can be removed while this timer is still pending. Once a device is + -- deleted its metatable is swapped so that all field/method lookups return nil + -- (see Device:deleted() in st.device), so guard against that here to avoid + -- "attempt to call a nil value (method 'emit_event_for_endpoint')" errors. + if device.id == nil then + return + end device:emit_event_for_endpoint(cmd.src_channel, capabilities.tamperAlert.tamper.clear()) device:set_field(TAMPER_TIMER, nil) end)) diff --git a/drivers/SmartThings/zwave-siren/src/test/test_aeon_siren.lua b/drivers/SmartThings/zwave-siren/src/test/test_aeon_siren.lua index 30b8333c5b..8e8137cc90 100644 --- a/drivers/SmartThings/zwave-siren/src/test/test_aeon_siren.lua +++ b/drivers/SmartThings/zwave-siren/src/test/test_aeon_siren.lua @@ -56,7 +56,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -82,7 +82,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -113,7 +113,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -144,7 +144,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -176,7 +176,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -207,7 +207,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -238,7 +238,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -265,7 +265,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -293,7 +293,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -322,7 +322,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-siren/src/test/test_aeotec_doorbell_siren.lua b/drivers/SmartThings/zwave-siren/src/test/test_aeotec_doorbell_siren.lua index 31fb57fed2..d58fbfc207 100644 --- a/drivers/SmartThings/zwave-siren/src/test/test_aeotec_doorbell_siren.lua +++ b/drivers/SmartThings/zwave-siren/src/test/test_aeotec_doorbell_siren.lua @@ -113,7 +113,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -151,7 +151,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -189,7 +189,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -227,7 +227,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -265,7 +265,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -303,7 +303,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -341,7 +341,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -379,7 +379,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -424,7 +424,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -469,7 +469,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -514,7 +514,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -559,7 +559,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -604,7 +604,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -649,7 +649,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -694,7 +694,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -739,7 +739,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -779,7 +779,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -819,7 +819,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -859,7 +859,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -899,7 +899,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -939,7 +939,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -979,7 +979,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1019,7 +1019,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1059,7 +1059,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1099,7 +1099,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1139,7 +1139,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1179,7 +1179,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1219,7 +1219,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1259,7 +1259,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1299,7 +1299,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1339,7 +1339,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1379,7 +1379,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1419,7 +1419,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1459,7 +1459,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1499,7 +1499,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1539,7 +1539,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1579,7 +1579,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1619,7 +1619,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1659,7 +1659,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1699,7 +1699,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1739,7 +1739,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1779,7 +1779,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1819,7 +1819,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1859,7 +1859,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1899,7 +1899,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1939,7 +1939,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1979,7 +1979,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2019,7 +2019,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2059,7 +2059,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2099,7 +2099,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2139,7 +2139,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2179,7 +2179,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2219,7 +2219,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2259,7 +2259,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2299,7 +2299,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2339,7 +2339,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2379,7 +2379,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2419,7 +2419,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2459,7 +2459,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2499,7 +2499,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2539,7 +2539,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2579,7 +2579,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2619,7 +2619,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2659,7 +2659,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2682,7 +2682,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -2705,7 +2705,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -2738,7 +2738,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2754,7 +2754,7 @@ test.register_coroutine_test( test.socket.device_lifecycle:__queue_receive(mock_siren:generate_info_changed({ preferences = _preferences})) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2779,7 +2779,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2793,7 +2793,7 @@ test.register_coroutine_test( test.socket.device_lifecycle:__queue_receive(mock_siren:generate_info_changed({ preferences = _preferences})) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2818,7 +2818,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2832,7 +2832,7 @@ test.register_coroutine_test( test.socket.device_lifecycle:__queue_receive(mock_siren:generate_info_changed({ preferences = _preferences})) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2860,7 +2860,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2888,7 +2888,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2916,7 +2916,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2944,7 +2944,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2972,7 +2972,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -3000,7 +3000,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -3036,7 +3036,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -3056,7 +3056,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-siren/src/test/test_ecolink_wireless_siren.lua b/drivers/SmartThings/zwave-siren/src/test/test_ecolink_wireless_siren.lua index c81ba1b262..ab6fab08a9 100644 --- a/drivers/SmartThings/zwave-siren/src/test/test_ecolink_wireless_siren.lua +++ b/drivers/SmartThings/zwave-siren/src/test/test_ecolink_wireless_siren.lua @@ -68,7 +68,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -106,7 +106,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -144,7 +144,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -172,7 +172,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -210,7 +210,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -248,7 +248,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -286,7 +286,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -313,7 +313,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) test.register_coroutine_test( @@ -347,7 +347,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -374,7 +374,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -400,7 +400,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -427,7 +427,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) test.register_coroutine_test( @@ -452,7 +452,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) test.register_coroutine_test( @@ -477,7 +477,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) test.register_coroutine_test( @@ -502,7 +502,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-siren/src/test/test_fortrezz_siren.lua b/drivers/SmartThings/zwave-siren/src/test/test_fortrezz_siren.lua index 61ae247d58..90a01396c8 100644 --- a/drivers/SmartThings/zwave-siren/src/test/test_fortrezz_siren.lua +++ b/drivers/SmartThings/zwave-siren/src/test/test_fortrezz_siren.lua @@ -61,7 +61,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_siren:generate_test_message("main", capabilities.switch.switch.on({}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -95,7 +95,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_siren:generate_test_message("main", capabilities.switch.switch.on({}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -128,7 +128,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_siren:generate_test_message("main", capabilities.switch.switch.on({}))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -161,7 +161,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_siren:generate_test_message("main", capabilities.switch.switch.off({}))) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-siren/src/test/test_philio_sound_siren.lua b/drivers/SmartThings/zwave-siren/src/test/test_philio_sound_siren.lua index 432de972dd..06255805f0 100644 --- a/drivers/SmartThings/zwave-siren/src/test/test_philio_sound_siren.lua +++ b/drivers/SmartThings/zwave-siren/src/test/test_philio_sound_siren.lua @@ -64,7 +64,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -95,7 +95,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -136,7 +136,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -168,7 +168,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -201,7 +201,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -224,7 +224,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -247,7 +247,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -281,7 +281,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -308,7 +308,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -333,7 +333,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -360,7 +360,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -387,7 +387,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -414,7 +414,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -441,7 +441,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -462,7 +462,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -484,7 +484,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -533,7 +533,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -558,7 +558,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-siren/src/test/test_utilitech_siren.lua b/drivers/SmartThings/zwave-siren/src/test/test_utilitech_siren.lua index 33801f1dbd..0632779570 100644 --- a/drivers/SmartThings/zwave-siren/src/test/test_utilitech_siren.lua +++ b/drivers/SmartThings/zwave-siren/src/test/test_utilitech_siren.lua @@ -43,7 +43,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -63,7 +63,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-siren/src/test/test_yale_siren.lua b/drivers/SmartThings/zwave-siren/src/test/test_yale_siren.lua index 275cc89ce9..517947dfef 100644 --- a/drivers/SmartThings/zwave-siren/src/test/test_yale_siren.lua +++ b/drivers/SmartThings/zwave-siren/src/test/test_yale_siren.lua @@ -54,7 +54,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -75,7 +75,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -113,7 +113,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -152,7 +152,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -190,7 +190,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -227,7 +227,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -263,7 +263,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -311,7 +311,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -331,7 +331,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-siren/src/test/test_zipato_siren.lua b/drivers/SmartThings/zwave-siren/src/test/test_zipato_siren.lua index 0d39f0f990..6c5672928b 100644 --- a/drivers/SmartThings/zwave-siren/src/test/test_zipato_siren.lua +++ b/drivers/SmartThings/zwave-siren/src/test/test_zipato_siren.lua @@ -63,7 +63,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -94,7 +94,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -114,7 +114,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -135,7 +135,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -156,7 +156,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-siren/src/test/test_zooz_zse50.lua b/drivers/SmartThings/zwave-siren/src/test/test_zooz_zse50.lua index 1454458687..c7d5723d64 100644 --- a/drivers/SmartThings/zwave-siren/src/test/test_zooz_zse50.lua +++ b/drivers/SmartThings/zwave-siren/src/test/test_zooz_zse50.lua @@ -66,7 +66,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -120,7 +120,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -148,7 +148,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -176,7 +176,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -198,7 +198,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -220,7 +220,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -242,7 +242,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -264,7 +264,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -296,7 +296,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -341,7 +341,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -372,7 +372,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -403,7 +403,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -434,7 +434,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -453,7 +453,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -472,7 +472,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -491,7 +491,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -516,7 +516,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -541,7 +541,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -566,7 +566,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -591,7 +591,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -616,7 +616,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -641,7 +641,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -663,7 +663,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -710,7 +710,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-siren/src/test/test_zwave_multifunctional-siren.lua b/drivers/SmartThings/zwave-siren/src/test/test_zwave_multifunctional-siren.lua index 61893d7dd6..27a2833d17 100644 --- a/drivers/SmartThings/zwave-siren/src/test/test_zwave_multifunctional-siren.lua +++ b/drivers/SmartThings/zwave-siren/src/test/test_zwave_multifunctional-siren.lua @@ -52,7 +52,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -74,7 +74,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -96,7 +96,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -118,7 +118,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -146,7 +146,7 @@ test.register_coroutine_test( mock_siren:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-siren/src/test/test_zwave_notification_siren.lua b/drivers/SmartThings/zwave-siren/src/test/test_zwave_notification_siren.lua index e80d79e338..9fa63cfcba 100644 --- a/drivers/SmartThings/zwave-siren/src/test/test_zwave_notification_siren.lua +++ b/drivers/SmartThings/zwave-siren/src/test/test_zwave_notification_siren.lua @@ -51,7 +51,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -78,7 +78,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -100,7 +100,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -127,7 +127,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-siren/src/test/test_zwave_siren.lua b/drivers/SmartThings/zwave-siren/src/test/test_zwave_siren.lua index 3e33929169..2311a1dafa 100644 --- a/drivers/SmartThings/zwave-siren/src/test/test_zwave_siren.lua +++ b/drivers/SmartThings/zwave-siren/src/test/test_zwave_siren.lua @@ -84,7 +84,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -110,7 +110,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -136,7 +136,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -162,7 +162,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -188,7 +188,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -214,7 +214,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -240,7 +240,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -266,7 +266,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -297,7 +297,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -328,7 +328,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -360,7 +360,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -391,7 +391,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -422,7 +422,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -463,7 +463,7 @@ test.register_coroutine_test( test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-siren/src/test/test_zwave_sound_sensor.lua b/drivers/SmartThings/zwave-siren/src/test/test_zwave_sound_sensor.lua index b796b1b9d0..716c05ac0d 100644 --- a/drivers/SmartThings/zwave-siren/src/test/test_zwave_sound_sensor.lua +++ b/drivers/SmartThings/zwave-siren/src/test/test_zwave_sound_sensor.lua @@ -50,7 +50,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -72,7 +72,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -91,7 +91,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-smoke-alarm/src/test/test_fibaro_co_sensor_zw5.lua b/drivers/SmartThings/zwave-smoke-alarm/src/test/test_fibaro_co_sensor_zw5.lua index e860e4608f..7031ffb88b 100644 --- a/drivers/SmartThings/zwave-smoke-alarm/src/test/test_fibaro_co_sensor_zw5.lua +++ b/drivers/SmartThings/zwave-smoke-alarm/src/test/test_fibaro_co_sensor_zw5.lua @@ -70,7 +70,7 @@ test.register_coroutine_test( mock_fibaro_CO_sensor:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -89,7 +89,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -117,7 +117,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -145,7 +145,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -172,7 +172,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -199,7 +199,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -226,7 +226,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -253,7 +253,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -279,7 +279,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -307,7 +307,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -334,7 +334,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -361,7 +361,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -392,7 +392,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -501,7 +501,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-smoke-alarm/src/test/test_fibaro_smoke_sensor.lua b/drivers/SmartThings/zwave-smoke-alarm/src/test/test_fibaro_smoke_sensor.lua index 39c79e0498..c877d18e47 100644 --- a/drivers/SmartThings/zwave-smoke-alarm/src/test/test_fibaro_smoke_sensor.lua +++ b/drivers/SmartThings/zwave-smoke-alarm/src/test/test_fibaro_smoke_sensor.lua @@ -150,7 +150,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -186,7 +186,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -209,7 +209,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-smoke-alarm/src/test/test_zwave_alarm_v1.lua b/drivers/SmartThings/zwave-smoke-alarm/src/test/test_zwave_alarm_v1.lua index bdeb10535f..af2588b959 100644 --- a/drivers/SmartThings/zwave-smoke-alarm/src/test/test_zwave_alarm_v1.lua +++ b/drivers/SmartThings/zwave-smoke-alarm/src/test/test_zwave_alarm_v1.lua @@ -54,7 +54,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -76,7 +76,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -98,7 +98,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -120,7 +120,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -165,7 +165,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -187,7 +187,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -209,7 +209,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-smoke-alarm/src/test/test_zwave_co_detector.lua b/drivers/SmartThings/zwave-smoke-alarm/src/test/test_zwave_co_detector.lua index 60710942bc..3bf9d563a1 100644 --- a/drivers/SmartThings/zwave-smoke-alarm/src/test/test_zwave_co_detector.lua +++ b/drivers/SmartThings/zwave-smoke-alarm/src/test/test_zwave_co_detector.lua @@ -55,7 +55,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -77,7 +77,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) test.register_message_test( @@ -98,7 +98,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -120,7 +120,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -142,7 +142,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -164,7 +164,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -181,7 +181,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-smoke-alarm/src/test/test_zwave_smoke_detector.lua b/drivers/SmartThings/zwave-smoke-alarm/src/test/test_zwave_smoke_detector.lua index c62dab7ec6..838527222b 100644 --- a/drivers/SmartThings/zwave-smoke-alarm/src/test/test_zwave_smoke_detector.lua +++ b/drivers/SmartThings/zwave-smoke-alarm/src/test/test_zwave_smoke_detector.lua @@ -56,7 +56,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -78,7 +78,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -100,7 +100,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -122,7 +122,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -144,7 +144,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -166,7 +166,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -188,7 +188,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -205,7 +205,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -253,7 +253,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -275,7 +275,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -297,7 +297,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -319,7 +319,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -341,7 +341,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -363,7 +363,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -407,7 +407,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/fingerprints.yml b/drivers/SmartThings/zwave-switch/fingerprints.yml index f606edf119..8719899d1d 100644 --- a/drivers/SmartThings/zwave-switch/fingerprints.yml +++ b/drivers/SmartThings/zwave-switch/fingerprints.yml @@ -885,6 +885,12 @@ zwaveManufacturer: productId: 0xFF97 productType: 0xFF01 deviceProfileName: switch-binary + - id: "0312/FF00/FF0C" + deviceLabel: Z-Wave Smart Plug + manufacturerId: 0x0312 + productId: 0xFF0C + productType: 0xFF00 + deviceProfileName: smartplug-binary - id: Evolve/RelaySwitch deviceLabel: Evolve Switch manufacturerId: 0x0113 diff --git a/drivers/SmartThings/zwave-switch/src/test/test_aeon_smart_strip.lua b/drivers/SmartThings/zwave-switch/src/test/test_aeon_smart_strip.lua index d0db48c559..86b5d5c539 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_aeon_smart_strip.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_aeon_smart_strip.lua @@ -152,7 +152,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -241,7 +241,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -292,7 +292,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -343,7 +343,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -377,7 +377,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -411,7 +411,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -445,7 +445,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -515,7 +515,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -549,7 +549,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -621,7 +621,7 @@ test.register_coroutine_test( mock_metering_switch:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -755,7 +755,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -889,7 +889,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -980,7 +980,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1071,7 +1071,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1162,7 +1162,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1253,7 +1253,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_aeotec_dimmer_switch.lua b/drivers/SmartThings/zwave-switch/src/test/test_aeotec_dimmer_switch.lua index ad9197c159..6829cd1c1b 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_aeotec_dimmer_switch.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_aeotec_dimmer_switch.lua @@ -60,7 +60,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -99,7 +99,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -139,7 +139,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -179,7 +179,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -223,7 +223,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -280,7 +280,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -312,7 +312,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -336,7 +336,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -405,7 +405,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -475,7 +475,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -510,7 +510,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_aeotec_dual_nano_switch_configuration.lua b/drivers/SmartThings/zwave-switch/src/test/test_aeotec_dual_nano_switch_configuration.lua index 6f35d6200c..d951926231 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_aeotec_dual_nano_switch_configuration.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_aeotec_dual_nano_switch_configuration.lua @@ -113,7 +113,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_aeotec_heavy_duty_switch.lua b/drivers/SmartThings/zwave-switch/src/test/test_aeotec_heavy_duty_switch.lua index 2d9b6e24c5..73228366f8 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_aeotec_heavy_duty_switch.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_aeotec_heavy_duty_switch.lua @@ -57,7 +57,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -81,7 +81,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -123,7 +123,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -136,7 +136,7 @@ test.register_coroutine_test( Meter:Get({ scale = Meter.scale.electric_meter.KILOWATT_HOURS }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -167,7 +167,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -193,7 +193,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -219,7 +219,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -246,7 +246,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -273,7 +273,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -300,7 +300,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -327,7 +327,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -354,7 +354,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -381,7 +381,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -408,7 +408,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -435,7 +435,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -462,7 +462,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -489,7 +489,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -516,7 +516,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_aeotec_metering_switch_configuration.lua b/drivers/SmartThings/zwave-switch/src/test/test_aeotec_metering_switch_configuration.lua index c26c0403e4..eb022e95b5 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_aeotec_metering_switch_configuration.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_aeotec_metering_switch_configuration.lua @@ -65,7 +65,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_aeotec_nano_dimmer.lua b/drivers/SmartThings/zwave-switch/src/test/test_aeotec_nano_dimmer.lua index 2c009b5ec7..7c86c0c830 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_aeotec_nano_dimmer.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_aeotec_nano_dimmer.lua @@ -84,7 +84,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -123,7 +123,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -163,7 +163,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -203,7 +203,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -247,7 +247,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -304,7 +304,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -336,7 +336,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -360,7 +360,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -429,7 +429,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -499,7 +499,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -534,7 +534,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_aeotec_nano_dimmer_preferences.lua b/drivers/SmartThings/zwave-switch/src/test/test_aeotec_nano_dimmer_preferences.lua index 5a349d80cb..2022dbf055 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_aeotec_nano_dimmer_preferences.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_aeotec_nano_dimmer_preferences.lua @@ -59,7 +59,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_aeotec_smart_switch.lua b/drivers/SmartThings/zwave-switch/src/test/test_aeotec_smart_switch.lua index c61e1835a8..507aa2484f 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_aeotec_smart_switch.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_aeotec_smart_switch.lua @@ -60,7 +60,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -90,7 +90,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_aeotec_smart_switch_7_eu.lua b/drivers/SmartThings/zwave-switch/src/test/test_aeotec_smart_switch_7_eu.lua index fcaed8070a..4cbfdea3a6 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_aeotec_smart_switch_7_eu.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_aeotec_smart_switch_7_eu.lua @@ -66,7 +66,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -96,7 +96,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -120,7 +120,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -144,7 +144,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -175,7 +175,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -222,7 +222,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_aeotec_smart_switch_7_us.lua b/drivers/SmartThings/zwave-switch/src/test/test_aeotec_smart_switch_7_us.lua index 51f7b504ca..47a222e06e 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_aeotec_smart_switch_7_us.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_aeotec_smart_switch_7_us.lua @@ -54,7 +54,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -84,7 +84,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -114,7 +114,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -138,7 +138,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -162,7 +162,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -193,7 +193,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_aeotec_smart_switch_gen5.lua b/drivers/SmartThings/zwave-switch/src/test/test_aeotec_smart_switch_gen5.lua index 565d6b57aa..4effe6c50a 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_aeotec_smart_switch_gen5.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_aeotec_smart_switch_gen5.lua @@ -55,7 +55,7 @@ test.register_coroutine_test( mock_switch:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_dawon_smart_plug.lua b/drivers/SmartThings/zwave-switch/src/test/test_dawon_smart_plug.lua index 6615af4a12..5270baa847 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_dawon_smart_plug.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_dawon_smart_plug.lua @@ -49,7 +49,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -71,7 +71,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_dawon_wall_smart_switch.lua b/drivers/SmartThings/zwave-switch/src/test/test_dawon_wall_smart_switch.lua index 3fe41b79db..1fe37d24ca 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_dawon_wall_smart_switch.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_dawon_wall_smart_switch.lua @@ -77,7 +77,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -106,7 +106,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -138,7 +138,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -170,7 +170,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -202,7 +202,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -234,7 +234,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -266,7 +266,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -298,7 +298,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -321,7 +321,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -385,7 +385,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_eaton_5_scene_keypad.lua b/drivers/SmartThings/zwave-switch/src/test/test_eaton_5_scene_keypad.lua index 29ff5d699e..9cbfd0b38b 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_eaton_5_scene_keypad.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_eaton_5_scene_keypad.lua @@ -76,7 +76,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -118,7 +118,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -147,7 +147,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -235,7 +235,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -273,7 +273,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -333,7 +333,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -381,7 +381,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -398,7 +398,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -458,7 +458,7 @@ test.register_coroutine_test( -- if group_id and scene_id are same, do nothing. end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -483,7 +483,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -501,7 +501,7 @@ test.register_coroutine_test( -- driver should do nothing. end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -521,7 +521,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -541,7 +541,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_eaton_accessory_dimmer.lua b/drivers/SmartThings/zwave-switch/src/test/test_eaton_accessory_dimmer.lua index 103f856373..863f6b5d91 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_eaton_accessory_dimmer.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_eaton_accessory_dimmer.lua @@ -44,7 +44,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -68,7 +68,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -95,7 +95,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -130,7 +130,7 @@ do } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -176,7 +176,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) end @@ -203,7 +203,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -229,7 +229,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -257,7 +257,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_eaton_anyplace_switch.lua b/drivers/SmartThings/zwave-switch/src/test/test_eaton_anyplace_switch.lua index 3c1fdfc9eb..79f6390aea 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_eaton_anyplace_switch.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_eaton_anyplace_switch.lua @@ -73,7 +73,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -119,7 +119,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -142,7 +142,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -165,7 +165,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -184,7 +184,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -203,7 +203,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_eaton_rf_dimmer.lua b/drivers/SmartThings/zwave-switch/src/test/test_eaton_rf_dimmer.lua index 10a784d8b4..5b1623758c 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_eaton_rf_dimmer.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_eaton_rf_dimmer.lua @@ -43,7 +43,7 @@ test.register_coroutine_test( mock_sensor:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_ecolink_switch.lua b/drivers/SmartThings/zwave-switch/src/test/test_ecolink_switch.lua index 51ad9b8299..e5ccfc170a 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_ecolink_switch.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_ecolink_switch.lua @@ -63,7 +63,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -94,7 +94,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -113,7 +113,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -145,7 +145,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -177,7 +177,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -217,7 +217,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -249,7 +249,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -274,7 +274,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -299,7 +299,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_fibaro_double_switch.lua b/drivers/SmartThings/zwave-switch/src/test/test_fibaro_double_switch.lua index 29e6b9566e..81705116e3 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_fibaro_double_switch.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_fibaro_double_switch.lua @@ -135,7 +135,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -187,7 +187,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) test.register_message_test( @@ -237,7 +237,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -288,7 +288,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -328,7 +328,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -368,7 +368,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -408,7 +408,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -448,7 +448,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -601,7 +601,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -653,7 +653,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_fibaro_single_switch.lua b/drivers/SmartThings/zwave-switch/src/test/test_fibaro_single_switch.lua index 4c8d058acf..3792254e03 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_fibaro_single_switch.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_fibaro_single_switch.lua @@ -55,7 +55,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -76,7 +76,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -109,7 +109,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -142,7 +142,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -175,7 +175,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -208,7 +208,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -238,7 +238,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -267,7 +267,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -290,7 +290,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -319,7 +319,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -342,7 +342,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -371,7 +371,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -394,7 +394,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -423,7 +423,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -446,7 +446,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -475,7 +475,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -497,7 +497,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -526,7 +526,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -548,7 +548,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -577,7 +577,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -691,7 +691,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_fibaro_wall_plug_eu.lua b/drivers/SmartThings/zwave-switch/src/test/test_fibaro_wall_plug_eu.lua index 669b01f1bd..f35d61d836 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_fibaro_wall_plug_eu.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_fibaro_wall_plug_eu.lua @@ -108,7 +108,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_fibaro_wall_plug_uk_configuration.lua b/drivers/SmartThings/zwave-switch/src/test/test_fibaro_wall_plug_uk_configuration.lua index a051ce72b2..c6ab67534f 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_fibaro_wall_plug_uk_configuration.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_fibaro_wall_plug_uk_configuration.lua @@ -57,7 +57,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_fibaro_wall_plug_us.lua b/drivers/SmartThings/zwave-switch/src/test/test_fibaro_wall_plug_us.lua index 2fafc237b2..0a49231bc0 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_fibaro_wall_plug_us.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_fibaro_wall_plug_us.lua @@ -71,7 +71,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -108,7 +108,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -142,7 +142,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -176,7 +176,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -210,7 +210,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -244,7 +244,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -258,7 +258,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -340,7 +340,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_fibaro_walli_dimmer_preferences.lua b/drivers/SmartThings/zwave-switch/src/test/test_fibaro_walli_dimmer_preferences.lua index 3dd35e66b9..cae11364c1 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_fibaro_walli_dimmer_preferences.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_fibaro_walli_dimmer_preferences.lua @@ -53,7 +53,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -77,7 +77,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -101,7 +101,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -125,7 +125,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -149,7 +149,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -174,7 +174,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -198,7 +198,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_fibaro_walli_double_switch.lua b/drivers/SmartThings/zwave-switch/src/test/test_fibaro_walli_double_switch.lua index 2ced0ef6a3..93d19204f4 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_fibaro_walli_double_switch.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_fibaro_walli_double_switch.lua @@ -117,7 +117,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -173,7 +173,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -220,7 +220,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -254,7 +254,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -310,7 +310,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -366,7 +366,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -413,7 +413,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -452,7 +452,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -522,7 +522,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -591,7 +591,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -658,7 +658,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -727,7 +727,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -771,7 +771,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -806,7 +806,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -841,7 +841,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_fibaro_walli_double_switch_preferences.lua b/drivers/SmartThings/zwave-switch/src/test/test_fibaro_walli_double_switch_preferences.lua index 1e2cfe45aa..9001400001 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_fibaro_walli_double_switch_preferences.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_fibaro_walli_double_switch_preferences.lua @@ -53,7 +53,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -73,7 +73,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -93,7 +93,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -113,7 +113,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -133,7 +133,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -153,7 +153,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_generic_zwave_device1.lua b/drivers/SmartThings/zwave-switch/src/test/test_generic_zwave_device1.lua index 5116eceada..a5865cd219 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_generic_zwave_device1.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_generic_zwave_device1.lua @@ -45,7 +45,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -71,7 +71,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -114,7 +114,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -144,7 +144,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -187,7 +187,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -216,7 +216,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -245,7 +245,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -275,7 +275,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_go_control_plug_in_switch_configuraton.lua b/drivers/SmartThings/zwave-switch/src/test/test_go_control_plug_in_switch_configuraton.lua index 4827c600d8..a83e2eddc1 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_go_control_plug_in_switch_configuraton.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_go_control_plug_in_switch_configuraton.lua @@ -49,7 +49,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_honeywell_dimmer.lua b/drivers/SmartThings/zwave-switch/src/test/test_honeywell_dimmer.lua index 66cbf38817..ed0c1bfed1 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_honeywell_dimmer.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_honeywell_dimmer.lua @@ -55,7 +55,7 @@ test.register_coroutine_test( mock_dimmer:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_inovelli_2_channel_smart_plug.lua b/drivers/SmartThings/zwave-switch/src/test/test_inovelli_2_channel_smart_plug.lua index 65ccf723b3..32de5e2715 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_inovelli_2_channel_smart_plug.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_inovelli_2_channel_smart_plug.lua @@ -97,7 +97,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -161,7 +161,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -204,7 +204,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -247,7 +247,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -290,7 +290,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -333,7 +333,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -405,7 +405,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -478,7 +478,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -538,7 +538,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -598,7 +598,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -662,7 +662,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -726,7 +726,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -774,7 +774,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -822,7 +822,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -862,7 +862,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -903,7 +903,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -943,7 +943,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -984,7 +984,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_inovelli_button.lua b/drivers/SmartThings/zwave-switch/src/test/test_inovelli_button.lua index 96668cfc24..8bf0b6f6f9 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_inovelli_button.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_inovelli_button.lua @@ -131,7 +131,7 @@ test.register_coroutine_test( end end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -159,7 +159,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -186,7 +186,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -213,7 +213,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_inovelli_dimmer.lua b/drivers/SmartThings/zwave-switch/src/test/test_inovelli_dimmer.lua index 0e71010aa3..bb62be473b 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_inovelli_dimmer.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_inovelli_dimmer.lua @@ -47,7 +47,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -73,7 +73,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -101,7 +101,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -136,7 +136,7 @@ do } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -169,7 +169,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -200,7 +200,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -233,7 +233,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) end diff --git a/drivers/SmartThings/zwave-switch/src/test/test_inovelli_dimmer_led.lua b/drivers/SmartThings/zwave-switch/src/test/test_inovelli_dimmer_led.lua index 48fde4f573..59588c0e52 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_inovelli_dimmer_led.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_inovelli_dimmer_led.lua @@ -99,7 +99,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -135,7 +135,7 @@ do } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_inovelli_dimmer_power_energy.lua b/drivers/SmartThings/zwave-switch/src/test/test_inovelli_dimmer_power_energy.lua index 4a3ab7f64a..dfdaf4ac54 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_inovelli_dimmer_power_energy.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_inovelli_dimmer_power_energy.lua @@ -70,7 +70,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -112,7 +112,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -136,7 +136,7 @@ do } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -162,7 +162,7 @@ do } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -200,7 +200,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -243,7 +243,7 @@ do } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -276,7 +276,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -307,7 +307,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -340,7 +340,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_inovelli_dimmer_preferences.lua b/drivers/SmartThings/zwave-switch/src/test/test_inovelli_dimmer_preferences.lua index 701fd6513a..a0c83ed6ae 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_inovelli_dimmer_preferences.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_inovelli_dimmer_preferences.lua @@ -56,7 +56,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -84,7 +84,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -112,7 +112,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -140,7 +140,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -169,7 +169,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_inovelli_dimmer_scenes.lua b/drivers/SmartThings/zwave-switch/src/test/test_inovelli_dimmer_scenes.lua index 81e4eff5c0..aa89df6bf2 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_inovelli_dimmer_scenes.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_inovelli_dimmer_scenes.lua @@ -59,7 +59,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -82,7 +82,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -105,7 +105,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -128,7 +128,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -151,7 +151,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -174,7 +174,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -197,7 +197,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -220,7 +220,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -243,7 +243,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -266,7 +266,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -289,7 +289,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_inovelli_vzw32_sn.lua b/drivers/SmartThings/zwave-switch/src/test/test_inovelli_vzw32_sn.lua index 5a9b2ccafd..cec88fe366 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_inovelli_vzw32_sn.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_inovelli_vzw32_sn.lua @@ -130,7 +130,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -159,7 +159,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -188,7 +188,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -222,7 +222,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -248,7 +248,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -274,7 +274,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -333,7 +333,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_inovelli_vzw32_sn_child.lua b/drivers/SmartThings/zwave-switch/src/test/test_inovelli_vzw32_sn_child.lua index 4fcdf9e65c..243bd08640 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_inovelli_vzw32_sn_child.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_inovelli_vzw32_sn_child.lua @@ -90,7 +90,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -145,7 +145,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -179,7 +179,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -238,7 +238,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -301,7 +301,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -344,7 +344,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_inovelli_vzw32_sn_preferences.lua b/drivers/SmartThings/zwave-switch/src/test/test_inovelli_vzw32_sn_preferences.lua index 3c3e9aa7b8..be6db7e82b 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_inovelli_vzw32_sn_preferences.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_inovelli_vzw32_sn_preferences.lua @@ -60,7 +60,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -86,7 +86,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -112,7 +112,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -138,7 +138,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -162,7 +162,7 @@ do }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_multi_metering_switch.lua b/drivers/SmartThings/zwave-switch/src/test/test_multi_metering_switch.lua index ad95d3edbb..3586b93aab 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_multi_metering_switch.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_multi_metering_switch.lua @@ -116,7 +116,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -168,7 +168,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -220,7 +220,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -248,7 +248,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -276,7 +276,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -304,7 +304,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -332,7 +332,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -381,7 +381,7 @@ test.register_coroutine_test( mock_parent_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -424,7 +424,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -467,7 +467,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -497,7 +497,7 @@ do } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -531,7 +531,7 @@ do } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -563,7 +563,7 @@ do } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -595,7 +595,7 @@ do } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -630,7 +630,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -663,7 +663,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -757,7 +757,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -774,7 +774,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_multichannel_device.lua b/drivers/SmartThings/zwave-switch/src/test/test_multichannel_device.lua index 6c835ff893..c16703f52b 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_multichannel_device.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_multichannel_device.lua @@ -169,7 +169,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -206,7 +206,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -243,7 +243,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -280,7 +280,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -330,7 +330,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -375,7 +375,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -420,7 +420,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -470,7 +470,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -520,7 +520,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -565,7 +565,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -610,7 +610,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -660,7 +660,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -703,7 +703,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -746,7 +746,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -789,7 +789,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -832,7 +832,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -888,7 +888,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -931,7 +931,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -987,7 +987,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1057,7 +1057,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1099,7 +1099,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -1141,7 +1141,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -1183,7 +1183,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -1229,7 +1229,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1283,7 +1283,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1312,7 +1312,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1341,7 +1341,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1375,7 +1375,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1409,7 +1409,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1533,7 +1533,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1657,7 +1657,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1786,7 +1786,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1815,7 +1815,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1844,7 +1844,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1873,7 +1873,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1902,7 +1902,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1931,7 +1931,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1960,7 +1960,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1989,7 +1989,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2018,7 +2018,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2047,7 +2047,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2076,7 +2076,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2105,7 +2105,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2134,7 +2134,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2172,7 +2172,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -2201,7 +2201,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2231,7 +2231,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2281,7 +2281,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -2337,7 +2337,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -2465,7 +2465,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -2509,7 +2509,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -2531,7 +2531,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2550,7 +2550,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2572,7 +2572,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2591,7 +2591,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2613,7 +2613,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2632,7 +2632,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2654,7 +2654,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -2673,7 +2673,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_popp_outdoor_plug_configuration.lua b/drivers/SmartThings/zwave-switch/src/test/test_popp_outdoor_plug_configuration.lua index 8586267722..b972f5c936 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_popp_outdoor_plug_configuration.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_popp_outdoor_plug_configuration.lua @@ -49,7 +49,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_qubino_din_dimmer.lua b/drivers/SmartThings/zwave-switch/src/test/test_qubino_din_dimmer.lua index 151b6b416e..8688cd7ec4 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_qubino_din_dimmer.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_qubino_din_dimmer.lua @@ -70,7 +70,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -125,7 +125,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -165,7 +165,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -206,7 +206,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -250,7 +250,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -307,7 +307,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -339,7 +339,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -363,7 +363,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -382,7 +382,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.temperatureMeasurement.temperature({ value = 21.5, unit = 'C' }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -451,7 +451,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -521,7 +521,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -555,7 +555,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_qubino_din_dimmer_preferences.lua b/drivers/SmartThings/zwave-switch/src/test/test_qubino_din_dimmer_preferences.lua index 3a2ef76aa2..86e3f8460b 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_qubino_din_dimmer_preferences.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_qubino_din_dimmer_preferences.lua @@ -56,7 +56,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -80,7 +80,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -104,7 +104,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -128,7 +128,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -152,7 +152,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -177,7 +177,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -201,7 +201,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_qubino_flush_1_relay_preferences.lua b/drivers/SmartThings/zwave-switch/src/test/test_qubino_flush_1_relay_preferences.lua index 959bb2068d..2c1d6f337b 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_qubino_flush_1_relay_preferences.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_qubino_flush_1_relay_preferences.lua @@ -48,7 +48,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -72,7 +72,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -96,7 +96,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -120,7 +120,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -144,7 +144,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_qubino_flush_1d_relay_preferences.lua b/drivers/SmartThings/zwave-switch/src/test/test_qubino_flush_1d_relay_preferences.lua index 89b03dae43..f67ac02a67 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_qubino_flush_1d_relay_preferences.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_qubino_flush_1d_relay_preferences.lua @@ -48,7 +48,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -72,7 +72,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -96,7 +96,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_qubino_flush_2_relay.lua b/drivers/SmartThings/zwave-switch/src/test/test_qubino_flush_2_relay.lua index 53e8744577..646370e760 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_qubino_flush_2_relay.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_qubino_flush_2_relay.lua @@ -106,7 +106,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -138,7 +138,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -159,7 +159,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -187,7 +187,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -215,7 +215,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -240,7 +240,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -265,7 +265,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -292,7 +292,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -319,7 +319,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -354,7 +354,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -389,7 +389,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -418,7 +418,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -460,7 +460,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -502,7 +502,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -544,7 +544,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -586,7 +586,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -639,7 +639,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_qubino_flush_2_relay_preferences.lua b/drivers/SmartThings/zwave-switch/src/test/test_qubino_flush_2_relay_preferences.lua index b894310832..e050946859 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_qubino_flush_2_relay_preferences.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_qubino_flush_2_relay_preferences.lua @@ -48,7 +48,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -72,7 +72,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -96,7 +96,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -120,7 +120,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -144,7 +144,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_qubino_flush_dimmer.lua b/drivers/SmartThings/zwave-switch/src/test/test_qubino_flush_dimmer.lua index 42e01fe944..7352331b05 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_qubino_flush_dimmer.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_qubino_flush_dimmer.lua @@ -61,7 +61,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -116,7 +116,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -156,7 +156,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -197,7 +197,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -241,7 +241,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -298,7 +298,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -330,7 +330,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -354,7 +354,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -371,7 +371,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.temperatureMeasurement.temperature({ value = 21.5, unit = 'C' }))) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -440,7 +440,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -510,7 +510,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -544,7 +544,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_qubino_flush_dimmer_0_10V_preferences.lua b/drivers/SmartThings/zwave-switch/src/test/test_qubino_flush_dimmer_0_10V_preferences.lua index 7256e3579a..7dad04cd8c 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_qubino_flush_dimmer_0_10V_preferences.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_qubino_flush_dimmer_0_10V_preferences.lua @@ -52,7 +52,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -76,7 +76,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -100,7 +100,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -124,7 +124,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -148,7 +148,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -176,7 +176,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -204,7 +204,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_qubino_flush_dimmer_preferences.lua b/drivers/SmartThings/zwave-switch/src/test/test_qubino_flush_dimmer_preferences.lua index 347995922e..95c994a637 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_qubino_flush_dimmer_preferences.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_qubino_flush_dimmer_preferences.lua @@ -51,7 +51,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -75,7 +75,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -99,7 +99,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -123,7 +123,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -147,7 +147,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -171,7 +171,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -195,7 +195,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -220,7 +220,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -244,7 +244,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_qubino_mini_dimmer_preferences.lua b/drivers/SmartThings/zwave-switch/src/test/test_qubino_mini_dimmer_preferences.lua index c1c4f31f0b..d510e9cfed 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_qubino_mini_dimmer_preferences.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_qubino_mini_dimmer_preferences.lua @@ -51,7 +51,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -75,7 +75,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -99,7 +99,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -123,7 +123,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -147,7 +147,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -172,7 +172,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -196,7 +196,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -220,7 +220,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_qubino_temperature_sensor_with_power.lua b/drivers/SmartThings/zwave-switch/src/test/test_qubino_temperature_sensor_with_power.lua index 2614927458..0606989b4d 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_qubino_temperature_sensor_with_power.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_qubino_temperature_sensor_with_power.lua @@ -59,7 +59,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -99,7 +99,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -140,7 +140,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -172,7 +172,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -196,7 +196,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -221,7 +221,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -290,7 +290,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -360,7 +360,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -404,7 +404,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_qubino_temperature_sensor_without_power.lua b/drivers/SmartThings/zwave-switch/src/test/test_qubino_temperature_sensor_without_power.lua index c13617986b..7a2c7ea56b 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_qubino_temperature_sensor_without_power.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_qubino_temperature_sensor_without_power.lua @@ -60,7 +60,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -92,7 +92,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -117,7 +117,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -170,7 +170,7 @@ test.register_coroutine_test( mock_device:expect_native_attr_handler_registration("switch", "switch") end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -224,7 +224,7 @@ test.register_coroutine_test( mock_device:expect_native_attr_handler_registration("switch", "switch") end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -268,7 +268,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_shelly_multi_metering_switch.lua b/drivers/SmartThings/zwave-switch/src/test/test_shelly_multi_metering_switch.lua index 0d3759c314..28165e645c 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_shelly_multi_metering_switch.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_shelly_multi_metering_switch.lua @@ -115,7 +115,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -167,7 +167,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -219,7 +219,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -247,7 +247,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -275,7 +275,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -303,7 +303,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -331,7 +331,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -374,7 +374,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -417,7 +417,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -447,7 +447,7 @@ do } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -481,7 +481,7 @@ do } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -513,7 +513,7 @@ do } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -545,7 +545,7 @@ do } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -580,7 +580,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -613,7 +613,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -707,7 +707,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -724,7 +724,7 @@ test.register_coroutine_test( }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_wyfy_touch.lua b/drivers/SmartThings/zwave-switch/src/test/test_wyfy_touch.lua index c7288aafaf..a09be9a417 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_wyfy_touch.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_wyfy_touch.lua @@ -71,7 +71,7 @@ test.register_coroutine_test( mock_parent_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -99,7 +99,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -127,7 +127,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -155,7 +155,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -183,7 +183,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -216,7 +216,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -249,7 +249,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -283,7 +283,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -316,7 +316,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -350,7 +350,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -369,7 +369,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_wyfy_touch_configuration.lua b/drivers/SmartThings/zwave-switch/src/test/test_wyfy_touch_configuration.lua index fbf70da972..fcd724acab 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_wyfy_touch_configuration.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_wyfy_touch_configuration.lua @@ -48,7 +48,7 @@ test.register_coroutine_test( mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_zooz_double_plug.lua b/drivers/SmartThings/zwave-switch/src/test/test_zooz_double_plug.lua index 7826e3d4e4..7725238086 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_zooz_double_plug.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_zooz_double_plug.lua @@ -73,7 +73,7 @@ test.register_coroutine_test( mock_parent:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -124,7 +124,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -174,7 +174,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -201,7 +201,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -229,7 +229,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -256,7 +256,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -284,7 +284,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -326,7 +326,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -368,7 +368,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -410,7 +410,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -452,7 +452,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -476,7 +476,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -500,7 +500,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -532,7 +532,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -564,7 +564,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_zooz_power_strip.lua b/drivers/SmartThings/zwave-switch/src/test/test_zooz_power_strip.lua index 8ffb5f93f6..15ef4f227d 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_zooz_power_strip.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_zooz_power_strip.lua @@ -85,7 +85,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -124,7 +124,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -163,7 +163,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -202,7 +202,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -241,7 +241,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -280,7 +280,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -319,7 +319,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -359,7 +359,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -399,7 +399,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -439,7 +439,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -483,7 +483,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -526,7 +526,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -569,7 +569,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -612,7 +612,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -655,7 +655,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -698,7 +698,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -741,7 +741,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -784,7 +784,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -827,7 +827,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -870,7 +870,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -932,7 +932,7 @@ test.register_coroutine_test( test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.switch.switch.off())) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1011,7 +1011,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -1090,7 +1090,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -1126,7 +1126,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -1162,7 +1162,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -1198,7 +1198,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -1234,7 +1234,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -1270,7 +1270,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -1306,7 +1306,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -1342,7 +1342,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -1378,7 +1378,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -1414,7 +1414,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -1450,7 +1450,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_zooz_zen_30_dimmer_relay.lua b/drivers/SmartThings/zwave-switch/src/test/test_zooz_zen_30_dimmer_relay.lua index b42d511166..40105722ac 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_zooz_zen_30_dimmer_relay.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_zooz_zen_30_dimmer_relay.lua @@ -94,7 +94,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -114,7 +114,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -146,7 +146,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -178,7 +178,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -218,7 +218,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -263,7 +263,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -312,7 +312,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -348,7 +348,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -380,7 +380,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -412,7 +412,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -443,7 +443,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -474,7 +474,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -505,7 +505,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -536,7 +536,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -572,7 +572,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -621,7 +621,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -648,7 +648,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -675,7 +675,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -702,7 +702,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -729,7 +729,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -756,7 +756,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -783,7 +783,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -810,7 +810,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -837,7 +837,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -864,7 +864,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -891,7 +891,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -918,7 +918,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -945,7 +945,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -972,7 +972,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -999,7 +999,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1026,7 +1026,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1053,7 +1053,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1080,7 +1080,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1107,7 +1107,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1129,7 +1129,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1157,7 +1157,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1185,7 +1185,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1224,7 +1224,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1272,7 +1272,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -1291,7 +1291,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_zooz_zen_30_dimmer_relay_preferences.lua b/drivers/SmartThings/zwave-switch/src/test/test_zooz_zen_30_dimmer_relay_preferences.lua index b021a25aa4..ab3923bb2a 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_zooz_zen_30_dimmer_relay_preferences.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_zooz_zen_30_dimmer_relay_preferences.lua @@ -79,7 +79,7 @@ do test.wait_for_events() end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_zwave_dimmer_power_energy.lua b/drivers/SmartThings/zwave-switch/src/test/test_zwave_dimmer_power_energy.lua index cd47374f82..efb6bd1ee2 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_zwave_dimmer_power_energy.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_zwave_dimmer_power_energy.lua @@ -72,7 +72,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -113,7 +113,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -157,7 +157,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -214,7 +214,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -246,7 +246,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -270,7 +270,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -339,7 +339,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -408,7 +408,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -441,7 +441,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_zwave_dual_switch.lua b/drivers/SmartThings/zwave-switch/src/test/test_zwave_dual_switch.lua index 16b15348ce..989bc0f054 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_zwave_dual_switch.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_zwave_dual_switch.lua @@ -82,7 +82,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -116,7 +116,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -150,7 +150,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -184,7 +184,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -218,7 +218,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -252,7 +252,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -286,7 +286,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -320,7 +320,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -360,7 +360,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -400,7 +400,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -440,7 +440,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -480,7 +480,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -520,7 +520,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -560,7 +560,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -600,7 +600,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -640,7 +640,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -664,7 +664,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -688,7 +688,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_zwave_dual_switch_migration.lua b/drivers/SmartThings/zwave-switch/src/test/test_zwave_dual_switch_migration.lua index d11dd78b8c..ef2e4997b2 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_zwave_dual_switch_migration.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_zwave_dual_switch_migration.lua @@ -74,7 +74,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -101,7 +101,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_zwave_switch.lua b/drivers/SmartThings/zwave-switch/src/test/test_zwave_switch.lua index 15fbe8b065..7c8da1f4ef 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_zwave_switch.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_zwave_switch.lua @@ -78,7 +78,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -105,7 +105,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -129,7 +129,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -155,7 +155,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -178,7 +178,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -204,7 +204,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -238,7 +238,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -272,7 +272,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -306,7 +306,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -340,7 +340,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_zwave_switch_battery.lua b/drivers/SmartThings/zwave-switch/src/test/test_zwave_switch_battery.lua index 608d92a052..ad20f7a864 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_zwave_switch_battery.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_zwave_switch_battery.lua @@ -45,7 +45,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -76,7 +76,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -110,7 +110,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_zwave_switch_electric_meter.lua b/drivers/SmartThings/zwave-switch/src/test/test_zwave_switch_electric_meter.lua index 5ec6b0a340..e008f82e94 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_zwave_switch_electric_meter.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_zwave_switch_electric_meter.lua @@ -57,7 +57,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -79,7 +79,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -118,7 +118,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -160,7 +160,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_zwave_switch_energy_meter.lua b/drivers/SmartThings/zwave-switch/src/test/test_zwave_switch_energy_meter.lua index f1b382ee67..ad3597766c 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_zwave_switch_energy_meter.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_zwave_switch_energy_meter.lua @@ -63,7 +63,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -85,7 +85,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -116,7 +116,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -150,7 +150,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -162,7 +162,7 @@ test.register_coroutine_test( test.socket.zwave:__expect_send(zw_test_utils.zwave_test_build_send_command( mock_switch, Meter:Get({scale = Meter.scale.electric_meter.KILOWATT_HOURS}))) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_zwave_switch_level.lua b/drivers/SmartThings/zwave-switch/src/test/test_zwave_switch_level.lua index 1841b7c97e..53b09297a0 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_zwave_switch_level.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_zwave_switch_level.lua @@ -46,7 +46,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -72,7 +72,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-switch/src/test/test_zwave_switch_power_meter.lua b/drivers/SmartThings/zwave-switch/src/test/test_zwave_switch_power_meter.lua index 7ea67ed56d..fef5989b44 100644 --- a/drivers/SmartThings/zwave-switch/src/test/test_zwave_switch_power_meter.lua +++ b/drivers/SmartThings/zwave-switch/src/test/test_zwave_switch_power_meter.lua @@ -68,7 +68,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -85,7 +85,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -116,7 +116,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -150,7 +150,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-thermostat/src/test/test_aeotec_radiator_thermostat.lua b/drivers/SmartThings/zwave-thermostat/src/test/test_aeotec_radiator_thermostat.lua index 341926c301..9bb950ffca 100644 --- a/drivers/SmartThings/zwave-thermostat/src/test/test_aeotec_radiator_thermostat.lua +++ b/drivers/SmartThings/zwave-thermostat/src/test/test_aeotec_radiator_thermostat.lua @@ -95,7 +95,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -114,7 +114,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -133,7 +133,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -164,7 +164,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -184,7 +184,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -207,7 +207,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -235,7 +235,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -268,7 +268,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-thermostat/src/test/test_ct100_thermostat.lua b/drivers/SmartThings/zwave-thermostat/src/test/test_ct100_thermostat.lua index 29645b580d..dce072706c 100644 --- a/drivers/SmartThings/zwave-thermostat/src/test/test_ct100_thermostat.lua +++ b/drivers/SmartThings/zwave-thermostat/src/test/test_ct100_thermostat.lua @@ -137,7 +137,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -165,7 +165,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -193,7 +193,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -221,7 +221,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -280,7 +280,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -339,7 +339,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -404,7 +404,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -473,7 +473,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -499,7 +499,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -524,7 +524,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-thermostat/src/test/test_fibaro_heat_controller.lua b/drivers/SmartThings/zwave-thermostat/src/test/test_fibaro_heat_controller.lua index eee99d0445..8f5f9011e1 100644 --- a/drivers/SmartThings/zwave-thermostat/src/test/test_fibaro_heat_controller.lua +++ b/drivers/SmartThings/zwave-thermostat/src/test/test_fibaro_heat_controller.lua @@ -116,7 +116,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -174,7 +174,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -193,7 +193,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -216,7 +216,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -235,7 +235,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -266,7 +266,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -286,7 +286,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -309,7 +309,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -355,7 +355,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -383,7 +383,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -416,7 +416,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-thermostat/src/test/test_popp_radiator_thermostat.lua b/drivers/SmartThings/zwave-thermostat/src/test/test_popp_radiator_thermostat.lua index 76b6dcc423..2c74e4c5be 100644 --- a/drivers/SmartThings/zwave-thermostat/src/test/test_popp_radiator_thermostat.lua +++ b/drivers/SmartThings/zwave-thermostat/src/test/test_popp_radiator_thermostat.lua @@ -62,7 +62,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -81,7 +81,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -112,7 +112,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -135,7 +135,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -159,7 +159,7 @@ test.register_coroutine_test( test.mock_time.advance_time(200) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -203,7 +203,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-thermostat/src/test/test_qubino_flush_thermostat.lua b/drivers/SmartThings/zwave-thermostat/src/test/test_qubino_flush_thermostat.lua index d2cc7cd938..a1842ae574 100644 --- a/drivers/SmartThings/zwave-thermostat/src/test/test_qubino_flush_thermostat.lua +++ b/drivers/SmartThings/zwave-thermostat/src/test/test_qubino_flush_thermostat.lua @@ -123,7 +123,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -146,7 +146,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -172,7 +172,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -193,7 +193,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -213,7 +213,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -240,7 +240,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -267,7 +267,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -324,7 +324,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -376,7 +376,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -404,7 +404,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -437,7 +437,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -465,7 +465,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -487,7 +487,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -517,7 +517,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -570,7 +570,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-thermostat/src/test/test_stelpro_ki_thermostat.lua b/drivers/SmartThings/zwave-thermostat/src/test/test_stelpro_ki_thermostat.lua index 2af3f3e24c..bb4043f969 100644 --- a/drivers/SmartThings/zwave-thermostat/src/test/test_stelpro_ki_thermostat.lua +++ b/drivers/SmartThings/zwave-thermostat/src/test/test_stelpro_ki_thermostat.lua @@ -68,7 +68,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -107,7 +107,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -146,7 +146,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -190,7 +190,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -234,7 +234,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -273,7 +273,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -312,7 +312,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -330,7 +330,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -351,7 +351,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -377,7 +377,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-thermostat/src/test/test_thermostat_heating_battery.lua b/drivers/SmartThings/zwave-thermostat/src/test/test_thermostat_heating_battery.lua index bf6fc0e42e..70ec5c90d2 100644 --- a/drivers/SmartThings/zwave-thermostat/src/test/test_thermostat_heating_battery.lua +++ b/drivers/SmartThings/zwave-thermostat/src/test/test_thermostat_heating_battery.lua @@ -104,7 +104,7 @@ test.register_coroutine_test( do_initial_setup() end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -123,7 +123,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -155,7 +155,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -217,7 +217,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -239,7 +239,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -271,7 +271,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -303,7 +303,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -332,7 +332,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -425,7 +425,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -539,7 +539,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -642,7 +642,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -728,7 +728,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -770,7 +770,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -810,7 +810,7 @@ test.register_coroutine_test( end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-thermostat/src/test/test_zwave_thermostat.lua b/drivers/SmartThings/zwave-thermostat/src/test/test_zwave_thermostat.lua index 900331c254..f4d0a6c811 100644 --- a/drivers/SmartThings/zwave-thermostat/src/test/test_zwave_thermostat.lua +++ b/drivers/SmartThings/zwave-thermostat/src/test/test_zwave_thermostat.lua @@ -144,7 +144,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -163,7 +163,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -182,7 +182,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -201,7 +201,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -226,7 +226,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -250,7 +250,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -281,7 +281,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 15 } ) @@ -304,7 +304,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -324,7 +324,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -344,7 +344,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -367,7 +367,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -390,7 +390,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -418,7 +418,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -446,7 +446,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -474,7 +474,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -502,7 +502,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -530,7 +530,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -558,7 +558,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -591,7 +591,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -645,7 +645,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -698,7 +698,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -753,7 +753,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-valve/src/test/test_inverse.valve.lua b/drivers/SmartThings/zwave-valve/src/test/test_inverse.valve.lua index 801a1608eb..7e53d6e943 100644 --- a/drivers/SmartThings/zwave-valve/src/test/test_inverse.valve.lua +++ b/drivers/SmartThings/zwave-valve/src/test/test_inverse.valve.lua @@ -49,7 +49,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -70,7 +70,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -91,7 +91,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -112,7 +112,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -145,7 +145,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -178,7 +178,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-valve/src/test/test_zwave_valve.lua b/drivers/SmartThings/zwave-valve/src/test/test_zwave_valve.lua index 3743f62fd5..1b689e6903 100644 --- a/drivers/SmartThings/zwave-valve/src/test/test_zwave_valve.lua +++ b/drivers/SmartThings/zwave-valve/src/test/test_zwave_valve.lua @@ -71,7 +71,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -90,7 +90,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -121,7 +121,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -152,7 +152,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -185,7 +185,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -218,7 +218,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -251,7 +251,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -284,7 +284,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-virtual-momentary-switch/src/test/test_zwave_virtual_momentary_switch.lua b/drivers/SmartThings/zwave-virtual-momentary-switch/src/test/test_zwave_virtual_momentary_switch.lua index e496b5a629..0971b8653e 100644 --- a/drivers/SmartThings/zwave-virtual-momentary-switch/src/test/test_zwave_virtual_momentary_switch.lua +++ b/drivers/SmartThings/zwave-virtual-momentary-switch/src/test/test_zwave_virtual_momentary_switch.lua @@ -67,7 +67,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -86,7 +86,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -113,7 +113,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -136,7 +136,7 @@ test.register_message_test( }, { inner_block_ordering = "relaxed", - min_api_version = 17 + min_api_version = 14 } ) @@ -186,7 +186,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -236,7 +236,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -266,7 +266,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-window-treatment/src/test/test_fibaro_roller_shutter.lua b/drivers/SmartThings/zwave-window-treatment/src/test/test_fibaro_roller_shutter.lua index ffeb175b43..85567ad47d 100644 --- a/drivers/SmartThings/zwave-window-treatment/src/test/test_fibaro_roller_shutter.lua +++ b/drivers/SmartThings/zwave-window-treatment/src/test/test_fibaro_roller_shutter.lua @@ -68,7 +68,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -94,7 +94,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -120,7 +120,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -153,7 +153,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -186,7 +186,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -219,7 +219,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -253,7 +253,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -287,7 +287,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -309,7 +309,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -343,7 +343,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -377,7 +377,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -405,7 +405,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -431,7 +431,7 @@ test.register_coroutine_test( assert(mock_fibaro_roller_shutter:get_field("calibration") == "done", "Calibration should be done") end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -456,7 +456,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -483,7 +483,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -510,7 +510,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -537,7 +537,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -564,7 +564,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -591,7 +591,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -618,7 +618,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -645,7 +645,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -672,7 +672,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -699,7 +699,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -726,7 +726,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -753,7 +753,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -780,7 +780,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -807,7 +807,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -834,7 +834,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -851,7 +851,7 @@ test.register_coroutine_test( mock_fibaro_roller_shutter_venetian:expect_metadata_update({ profile = "fibaro-roller-shutter" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -867,7 +867,7 @@ test.register_coroutine_test( mock_fibaro_roller_shutter_venetian:expect_metadata_update({ profile = "fibaro-roller-shutter-venetian" }) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-window-treatment/src/test/test_qubino_flush_shutter.lua b/drivers/SmartThings/zwave-window-treatment/src/test/test_qubino_flush_shutter.lua index 4127e8f7c4..9208b2d198 100644 --- a/drivers/SmartThings/zwave-window-treatment/src/test/test_qubino_flush_shutter.lua +++ b/drivers/SmartThings/zwave-window-treatment/src/test/test_qubino_flush_shutter.lua @@ -76,7 +76,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -109,7 +109,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -142,7 +142,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -175,7 +175,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -208,7 +208,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -230,7 +230,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -264,7 +264,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -297,7 +297,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -325,7 +325,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -358,7 +358,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -383,7 +383,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -410,7 +410,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -437,7 +437,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -464,7 +464,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -491,7 +491,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -518,7 +518,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -563,7 +563,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -582,7 +582,7 @@ test.register_coroutine_test( mock_qubino_flush_shutter:expect_metadata_update({ profile = "qubino-flush-shutter-venetian" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -601,7 +601,7 @@ test.register_coroutine_test( mock_qubino_flush_shutter:expect_metadata_update({ profile = "qubino-flush-shutter" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -623,7 +623,7 @@ test.register_coroutine_test( assert(targetValue == mock_qubino_flush_shutter.transient_store.shade_target, "driver should chache correct level value") end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -653,7 +653,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -686,7 +686,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -713,7 +713,7 @@ test.register_message_test( } }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -739,7 +739,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 15 } ) @@ -772,7 +772,7 @@ do ) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/SmartThings/zwave-window-treatment/src/test/test_zwave_aeotec_nano_shutter.lua b/drivers/SmartThings/zwave-window-treatment/src/test/test_zwave_aeotec_nano_shutter.lua index 8f6442b0ee..b2b968750c 100644 --- a/drivers/SmartThings/zwave-window-treatment/src/test/test_zwave_aeotec_nano_shutter.lua +++ b/drivers/SmartThings/zwave-window-treatment/src/test/test_zwave_aeotec_nano_shutter.lua @@ -48,7 +48,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -69,7 +69,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -102,7 +102,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -141,7 +141,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -170,7 +170,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -199,7 +199,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -240,7 +240,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -287,7 +287,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -301,7 +301,7 @@ test.register_coroutine_test( mock_window_button:expect_metadata_update({ provisioning_state = "PROVISIONED" }) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -334,7 +334,7 @@ test.register_message_test( }, }, { - min_api_version = 17 + min_api_version = 14 } ) @@ -349,7 +349,7 @@ test.register_coroutine_test( ) end, { - min_api_version = 17 + min_api_version = 14 } ) @@ -369,7 +369,7 @@ test.register_coroutine_test( )) end, { - min_api_version = 17 + min_api_version = 14 } ) diff --git a/drivers/Unofficial/tuya-zigbee/fingerprints.yml b/drivers/Unofficial/tuya-zigbee/fingerprints.yml index 7ee7460696..5c77617d1d 100644 --- a/drivers/Unofficial/tuya-zigbee/fingerprints.yml +++ b/drivers/Unofficial/tuya-zigbee/fingerprints.yml @@ -43,4 +43,9 @@ zigbeeManufacturer: deviceLabel: Tuya Switch 1 manufacturer: _TZE204_h2rctifa model: TS0601 - deviceProfileName: basic-switch \ No newline at end of file + deviceProfileName: basic-switch + - id: _TZE284_fziifcxj/TS0601 + deviceLabel: Tuya Thermostat + manufacturer: _TZE284_fziifcxj + model: TS0601 + deviceProfileName: thermostat diff --git a/drivers/Unofficial/tuya-zigbee/profiles/thermostat.yml b/drivers/Unofficial/tuya-zigbee/profiles/thermostat.yml new file mode 100644 index 0000000000..66ecb5661b --- /dev/null +++ b/drivers/Unofficial/tuya-zigbee/profiles/thermostat.yml @@ -0,0 +1,24 @@ +name: thermostat +components: + - id: main + capabilities: + - id: temperatureMeasurement + version: 1 + - id: thermostatHeatingSetpoint + version: 1 + config: + values: + - key: "heatingSetpoint.value" + range: [5, 30] + step: 0.5 + - id: thermostatMode + version: 1 + config: + values: + - key: "thermostatMode.value" + - id: battery + version: 1 + - id: refresh + version: 1 + categories: + - name: Thermostat diff --git a/drivers/Unofficial/tuya-zigbee/profiles/window-treatment-reverse.yml b/drivers/Unofficial/tuya-zigbee/profiles/window-treatment-reverse.yml index 9712eb6849..d0f47cdafd 100644 --- a/drivers/Unofficial/tuya-zigbee/profiles/window-treatment-reverse.yml +++ b/drivers/Unofficial/tuya-zigbee/profiles/window-treatment-reverse.yml @@ -6,6 +6,8 @@ components: version: 1 - id: windowShadeLevel version: 1 + - id: statelessWindowShadeLevelStep + version: 1 - id: windowShadePreset version: 1 - id: firmwareUpdate diff --git a/drivers/Unofficial/tuya-zigbee/src/curtain/init.lua b/drivers/Unofficial/tuya-zigbee/src/curtain/init.lua index 03c34cac65..284486e88b 100644 --- a/drivers/Unofficial/tuya-zigbee/src/curtain/init.lua +++ b/drivers/Unofficial/tuya-zigbee/src/curtain/init.lua @@ -23,6 +23,14 @@ local packet_id = 0 local PRESET_LEVEL = 50 local PRESET_LEVEL_KEY = "_presetLevel" +-- When the curtain is moving, LATEST_TARGET_LEVEL is used to store the latest target position value, +-- which will be cleared after 3 seconds timeout +local LATEST_TARGET_LEVEL = "_latestTargetLevel" +-- Field name for the timer that clears the target position after timeout +local TARGET_LEVEL_TIME_OUT = "_targetLevelTimeOut" +-- Timeout for the stateless step to accumulate +local TARGET_LEVEL_TIME_OUT_SECONDS = 15 + local FINGERPRINTS = { { mfr = "_TZE284_nladmfvf", model = "TS0601"} } @@ -153,6 +161,36 @@ local function tuya_cluster_handler(driver, device, zb_rx) end end +local function handle_step_shade_level(driver, device, command) + local step = command.args.stepSize or command.args[1] or (command.positional_args and command.positional_args.stepSize) + + -- When LATEST_TARGET_LEVEL is empty, it means the curtain motor is not moving, + -- and capabilities.windowShadeLevel.shadeLevel is used as the reference for position offset calculation; + -- when LATEST_TARGET_LEVEL is not empty, it means the curtain motor is moving, + -- and LATEST_TARGET_LEVEL is used as the reference for position offset calculation to obtain a more accurate position calculation. + local latest_target_level = device:get_field(LATEST_TARGET_LEVEL) + local current_level = latest_target_level or + device:get_latest_state("main", capabilities.windowShadeLevel.ID, + capabilities.windowShadeLevel.shadeLevel.NAME) or 0 + + local target_level = utils.clamp_value(current_level + step, 0, 100) + target_level = utils.round(target_level) + -- Cancel any previous timer and set a 15 second timeout timer to ensure target_level is cleared + -- This is to prevent the stateless step from accumulating indefinitely, while ensuring that a single + -- "scroll" action can accumulate multiple steps within a short time frame + if device:get_field(TARGET_LEVEL_TIME_OUT) then + device.thread:cancel_timer(device:get_field(TARGET_LEVEL_TIME_OUT)) + end + local timer = device.thread:call_with_delay(TARGET_LEVEL_TIME_OUT_SECONDS, function(d) + device:set_field(LATEST_TARGET_LEVEL, nil) + end) + device:set_field(TARGET_LEVEL_TIME_OUT, timer) + device:set_field(LATEST_TARGET_LEVEL, target_level) + + local new_command = { args = { shadeLevel = target_level }, component = command.component } + window_shade_level(driver, device, new_command) +end + local tuya_curtain_driver = { NAME = "tuya curtain", lifecycle_handlers = { @@ -170,6 +208,9 @@ local tuya_curtain_driver = { [capabilities.windowShadeLevel.ID] = { [capabilities.windowShadeLevel.commands.setShadeLevel.NAME] = window_shade_level }, + [capabilities.statelessWindowShadeLevelStep.ID] = { + [capabilities.statelessWindowShadeLevelStep.commands.stepShadeLevel.NAME] = handle_step_shade_level + }, [capabilities.windowShadePreset.ID] = { [capabilities.windowShadePreset.commands.presetPosition.NAME] = window_shade_preset, [capabilities.windowShadePreset.commands.setPresetPosition.NAME] = set_preset_position_cmd diff --git a/drivers/Unofficial/tuya-zigbee/src/init.lua b/drivers/Unofficial/tuya-zigbee/src/init.lua index 8fb452abb2..6313132933 100644 --- a/drivers/Unofficial/tuya-zigbee/src/init.lua +++ b/drivers/Unofficial/tuya-zigbee/src/init.lua @@ -26,7 +26,8 @@ local unofficial_tuya_driver_template = { require("curtain"), require("motion-sensor"), require("smoke-detector"), - require("switch") + require("switch"), + require("thermostat") }, health_check = false, } diff --git a/drivers/Unofficial/tuya-zigbee/src/test/test_tuya_curtain.lua b/drivers/Unofficial/tuya-zigbee/src/test/test_tuya_curtain.lua index ca09608347..23f96507ca 100644 --- a/drivers/Unofficial/tuya-zigbee/src/test/test_tuya_curtain.lua +++ b/drivers/Unofficial/tuya-zigbee/src/test/test_tuya_curtain.lua @@ -59,7 +59,10 @@ test.register_coroutine_test( test.socket.zigbee:__expect_send({ mock_simple_device.id, zigbee_test_utils.build_bind_request(mock_simple_device, zigbee_test_utils.mock_hub_eui, Basic.ID) }) test.socket.zigbee:__expect_send({ mock_simple_device.id, Basic.attributes.ApplicationVersion:configure_reporting(mock_simple_device, 30, 300, 1) }) mock_simple_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) - end + end, + { + min_api_version = 17 + } ) test.register_coroutine_test( @@ -89,7 +92,10 @@ test.register_coroutine_test( tuya_utils.build_send_tuya_command(mock_simple_device, '\x05', tuya_utils.DP_TYPE_ENUM, '\x00', 1) } ) - end + end, + { + min_api_version = 17 + } ) test.register_coroutine_test( @@ -131,7 +137,10 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_simple_device:generate_test_message("main", capabilities.windowShadePreset.supportedCommands({"presetPosition", "setPresetPosition"}, {visibility = {displayed=false}})) ) - end + end, + { + min_api_version = 17 + } ) test.register_message_test( @@ -152,7 +161,10 @@ test.register_message_test( direction = "send", message = mock_simple_device:generate_test_message("main", capabilities.windowShade.windowShade.opening()) } - } + }, + { + min_api_version = 17 + } ) test.register_message_test( @@ -173,7 +185,10 @@ test.register_message_test( direction = "send", message = mock_simple_device:generate_test_message("main", capabilities.windowShade.windowShade.closing()) } - } + }, + { + min_api_version = 17 + } ) test.register_message_test( @@ -189,7 +204,10 @@ test.register_message_test( direction = "send", message = { mock_simple_device.id, tuya_utils.build_send_tuya_command(mock_simple_device, '\x01', tuya_utils.DP_TYPE_ENUM, '\x01', 0) } } - } + }, + { + min_api_version = 17 + } ) test.register_message_test( @@ -205,7 +223,10 @@ test.register_message_test( direction = "send", message = { mock_simple_device.id, tuya_utils.build_send_tuya_command(mock_simple_device, '\x02', tuya_utils.DP_TYPE_VALUE, '\x00\x00\x00\x3c', 0) } } - } + }, + { + min_api_version = 17 + } ) test.register_message_test( @@ -221,7 +242,10 @@ test.register_message_test( direction = "send", message = { mock_simple_device.id, tuya_utils.build_send_tuya_command(mock_simple_device, '\x02', tuya_utils.DP_TYPE_VALUE, '\x00\x00\x00\x32', 0) } } - } + }, + { + min_api_version = 17 + } ) test.register_message_test( @@ -242,6 +266,191 @@ test.register_message_test( direction = "send", message = mock_simple_device:generate_test_message("main", capabilities.windowShade.windowShade("partially open")) } - } + }, + { + min_api_version = 17 + } ) + +test.register_message_test( + "Handle Window Shade step level command - step up", + { + { + channel = "capability", + direction = "receive", + message = { mock_simple_device.id, { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { 10 }, stepSize = 10 } } + }, + { + channel = "zigbee", + direction = "send", + -- For _TZE284_nladmfvf, level is inverted: 100 - 10 = 90 (0x5A) + message = { mock_simple_device.id, tuya_utils.build_send_tuya_command(mock_simple_device, '\x02', tuya_utils.DP_TYPE_VALUE, '\x00\x00\x00\x5a', 0) } + } + }, + { + min_api_version = 17 + } +) + +test.register_message_test( + "Handle Window Shade step level command - step down", + { + { + channel = "capability", + direction = "receive", + message = { mock_simple_device.id, { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { -10 }, stepSize = -10 } } + }, + { + channel = "zigbee", + direction = "send", + -- For _TZE284_nladmfvf, level is inverted: 100 - 0 = 100 (0x64), but clamped to 0 so 100 - 0 = 100 + message = { mock_simple_device.id, tuya_utils.build_send_tuya_command(mock_simple_device, '\x02', tuya_utils.DP_TYPE_VALUE, '\x00\x00\x00\x64', 0) } + } + }, + { + min_api_version = 17 + } +) + +test.register_coroutine_test( + "Handle Window Shade step level command - step up from current level", + function() + -- First, simulate a current shade level of 40 + test.socket.zigbee:__queue_receive({ + mock_simple_device.id, + tuya_utils.build_test_attr_report(mock_simple_device, '\x03', tuya_utils.DP_TYPE_VALUE, '\x00\x00\x00\x28', 0x01) + }) + test.socket.capability:__expect_send( + mock_simple_device:generate_test_message("main", capabilities.windowShadeLevel.shadeLevel(40)) + ) + test.socket.capability:__expect_send( + mock_simple_device:generate_test_message("main", capabilities.windowShade.windowShade("partially open")) + ) + test.wait_for_events() + + -- Then send step command with stepSize 20, should result in level 60 + -- For _TZE284_nladmfvf, level is inverted: 100 - 60 = 40 (0x28) + test.socket.capability:__queue_receive({ + mock_simple_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { 20 }, stepSize = 20 } + }) + test.socket.zigbee:__expect_send({ + mock_simple_device.id, + tuya_utils.build_send_tuya_command(mock_simple_device, '\x02', tuya_utils.DP_TYPE_VALUE, '\x00\x00\x00\x28', 0) + }) + end, + { + min_api_version = 17 + } +) + +test.register_coroutine_test( + "Handle Window Shade step level command - step up clamped to 100", + function() + -- First, simulate a current shade level of 90 + test.socket.zigbee:__queue_receive({ + mock_simple_device.id, + tuya_utils.build_test_attr_report(mock_simple_device, '\x03', tuya_utils.DP_TYPE_VALUE, '\x00\x00\x00\x5a', 0x01) + }) + test.socket.capability:__expect_send( + mock_simple_device:generate_test_message("main", capabilities.windowShadeLevel.shadeLevel(90)) + ) + test.socket.capability:__expect_send( + mock_simple_device:generate_test_message("main", capabilities.windowShade.windowShade("partially open")) + ) + test.wait_for_events() + + -- Then send step command with stepSize 20, should be clamped to 100 + -- For _TZE284_nladmfvf, level is inverted: 100 - 100 = 0 (0x00) + test.socket.capability:__queue_receive({ + mock_simple_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { 20 }, stepSize = 20 } + }) + test.socket.zigbee:__expect_send({ + mock_simple_device.id, + tuya_utils.build_send_tuya_command(mock_simple_device, '\x02', tuya_utils.DP_TYPE_VALUE, '\x00\x00\x00\x00', 0) + }) + end, + { + min_api_version = 17 + } +) + +test.register_coroutine_test( + "Handle Window Shade step level command - step down clamped to 0", + function() + -- First, simulate a current shade level of 10 + test.socket.zigbee:__queue_receive({ + mock_simple_device.id, + tuya_utils.build_test_attr_report(mock_simple_device, '\x03', tuya_utils.DP_TYPE_VALUE, '\x00\x00\x00\x0a', 0x01) + }) + test.socket.capability:__expect_send( + mock_simple_device:generate_test_message("main", capabilities.windowShadeLevel.shadeLevel(10)) + ) + test.socket.capability:__expect_send( + mock_simple_device:generate_test_message("main", capabilities.windowShade.windowShade("partially open")) + ) + test.wait_for_events() + + -- Then send step command with stepSize -20, should be clamped to 0 + -- For _TZE284_nladmfvf, level is inverted: 100 - 0 = 100 (0x64) + test.socket.capability:__queue_receive({ + mock_simple_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { -20 }, stepSize = -20 } + }) + test.socket.zigbee:__expect_send({ + mock_simple_device.id, + tuya_utils.build_send_tuya_command(mock_simple_device, '\x02', tuya_utils.DP_TYPE_VALUE, '\x00\x00\x00\x64', 0) + }) + end, + { + min_api_version = 17 + } +) + +test.register_coroutine_test( + "Handle Window Shade step level command - uses latest_target_level when available", + function() + -- First, simulate a current shade level of 40 + test.socket.zigbee:__queue_receive({ + mock_simple_device.id, + tuya_utils.build_test_attr_report(mock_simple_device, '\x03', tuya_utils.DP_TYPE_VALUE, '\x00\x00\x00\x28', 0x01) + }) + test.socket.capability:__expect_send( + mock_simple_device:generate_test_message("main", capabilities.windowShadeLevel.shadeLevel(40)) + ) + test.socket.capability:__expect_send( + mock_simple_device:generate_test_message("main", capabilities.windowShade.windowShade("partially open")) + ) + test.wait_for_events() + + -- Send first step command to set latest_target_level to 50 + -- For _TZE284_nladmfvf, level is inverted: 100 - 50 = 50 (0x32) + test.socket.capability:__queue_receive({ + mock_simple_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { 10 }, stepSize = 10 } + }) + test.socket.zigbee:__expect_send({ + mock_simple_device.id, + tuya_utils.build_send_tuya_command(mock_simple_device, '\x02', tuya_utils.DP_TYPE_VALUE, '\x00\x00\x00\x32', 0) + }) + test.wait_for_events() + + -- Send second step command before timeout - should use latest_target_level (50) as base + -- Target = 50 + 10 = 60, For _TZE284_nladmfvf: 100 - 60 = 40 (0x28) + -- Packet ID is 1 because it was incremented after the first step command + test.socket.capability:__queue_receive({ + mock_simple_device.id, + { capability = "statelessWindowShadeLevelStep", component = "main", command = "stepShadeLevel", args = { 10 }, stepSize = 10 } + }) + test.socket.zigbee:__expect_send({ + mock_simple_device.id, + tuya_utils.build_send_tuya_command(mock_simple_device, '\x02', tuya_utils.DP_TYPE_VALUE, '\x00\x00\x00\x28', 1) + }) + end, + { + min_api_version = 17 + } +) + test.run_registered_tests() diff --git a/drivers/Unofficial/tuya-zigbee/src/test/test_tuya_switch.lua b/drivers/Unofficial/tuya-zigbee/src/test/test_tuya_switch.lua index 97537c36ad..da6c87843a 100644 --- a/drivers/Unofficial/tuya-zigbee/src/test/test_tuya_switch.lua +++ b/drivers/Unofficial/tuya-zigbee/src/test/test_tuya_switch.lua @@ -254,6 +254,9 @@ test.register_message_test( direction = "send", message = { mock_parent_device.id, tuya_utils.build_send_tuya_command(mock_parent_device, '\x02', tuya_utils.DP_TYPE_BOOL, '\x01', 0) } } + }, + { + min_api_version = 17 } ) @@ -270,6 +273,9 @@ test.register_message_test( direction = "send", message = { mock_parent_device.id, tuya_utils.build_send_tuya_command(mock_parent_device, '\x03', tuya_utils.DP_TYPE_BOOL, '\x01', 0) } } + }, + { + min_api_version = 17 } ) @@ -286,6 +292,9 @@ test.register_message_test( direction = "send", message = { mock_parent_device.id, tuya_utils.build_send_tuya_command(mock_parent_device, '\x04', tuya_utils.DP_TYPE_BOOL, '\x01', 0) } } + }, + { + min_api_version = 17 } ) @@ -302,6 +311,9 @@ test.register_message_test( direction = "send", message = { mock_parent_device.id, tuya_utils.build_send_tuya_command(mock_parent_device, '\x05', tuya_utils.DP_TYPE_BOOL, '\x01', 0) } } + }, + { + min_api_version = 17 } ) @@ -318,6 +330,9 @@ test.register_message_test( direction = "send", message = { mock_parent_device.id, tuya_utils.build_send_tuya_command(mock_parent_device, '\x06', tuya_utils.DP_TYPE_BOOL, '\x01', 0) } } + }, + { + min_api_version = 17 } ) @@ -334,6 +349,9 @@ test.register_message_test( direction = "send", message = { mock_parent_device.id, tuya_utils.build_send_tuya_command(mock_parent_device, '\x01', tuya_utils.DP_TYPE_BOOL, '\x00', 0) } } + }, + { + min_api_version = 17 } ) @@ -350,6 +368,9 @@ test.register_message_test( direction = "send", message = { mock_parent_device.id, tuya_utils.build_send_tuya_command(mock_parent_device, '\x02', tuya_utils.DP_TYPE_BOOL, '\x00', 0) } } + }, + { + min_api_version = 17 } ) @@ -366,6 +387,9 @@ test.register_message_test( direction = "send", message = { mock_parent_device.id, tuya_utils.build_send_tuya_command(mock_parent_device, '\x03', tuya_utils.DP_TYPE_BOOL, '\x00', 0) } } + }, + { + min_api_version = 17 } ) @@ -382,6 +406,9 @@ test.register_message_test( direction = "send", message = { mock_parent_device.id, tuya_utils.build_send_tuya_command(mock_parent_device, '\x04', tuya_utils.DP_TYPE_BOOL, '\x00', 0) } } + }, + { + min_api_version = 17 } ) @@ -398,6 +425,9 @@ test.register_message_test( direction = "send", message = { mock_parent_device.id, tuya_utils.build_send_tuya_command(mock_parent_device, '\x05', tuya_utils.DP_TYPE_BOOL, '\x00', 0) } } + }, + { + min_api_version = 17 } ) @@ -414,6 +444,9 @@ test.register_message_test( direction = "send", message = { mock_parent_device.id, tuya_utils.build_send_tuya_command(mock_parent_device, '\x06', tuya_utils.DP_TYPE_BOOL, '\x00', 0) } } + }, + { + min_api_version = 17 } ) @@ -460,4 +493,4 @@ test.register_coroutine_test( end ) -test.run_registered_tests() \ No newline at end of file +test.run_registered_tests() diff --git a/drivers/Unofficial/tuya-zigbee/src/test/test_tuya_thermostat.lua b/drivers/Unofficial/tuya-zigbee/src/test/test_tuya_thermostat.lua new file mode 100644 index 0000000000..6198f22f94 --- /dev/null +++ b/drivers/Unofficial/tuya-zigbee/src/test/test_tuya_thermostat.lua @@ -0,0 +1,557 @@ +-- Copyright 2026 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + +-- Mock out globals +local test = require "integration_test" +local t_utils = require "integration_test.utils" +local zigbee_test_utils = require "integration_test.zigbee_test_utils" +local capabilities = require "st.capabilities" +local clusters = require "st.zigbee.zcl.clusters" +local tuya_utils = require "tuya_utils" + +local Basic = clusters.Basic + +local mock_simple_device = test.mock_device.build_test_zigbee_device( + { + profile = t_utils.get_profile_definition("thermostat.yml"), + zigbee_endpoints = { + [1] = { + id = 1, + manufacturer = "_TZE284_fziifcxj", + model = "TS0601", + server_clusters = { 0xEF00 } + } + } + } +) + +zigbee_test_utils.prepare_zigbee_env_info() + +local function test_init() + test.mock_device.add_test_device(mock_simple_device) +end + +test.set_test_init_function(test_init) + +test.register_coroutine_test( + "Handle doConfigure lifecycle event", + function() + test.socket.zigbee:__set_channel_ordering("relaxed") + test.socket.device_lifecycle:__queue_receive({ mock_simple_device.id, "doConfigure" }) + test.socket.zigbee:__expect_send({ mock_simple_device.id, tuya_utils.build_tuya_magic_spell_message(mock_simple_device) }) + test.socket.zigbee:__expect_send({ mock_simple_device.id, Basic.attributes.ApplicationVersion:configure_reporting(mock_simple_device, 30, 300, 1) }) + test.socket.zigbee:__expect_send({ mock_simple_device.id, zigbee_test_utils.build_bind_request(mock_simple_device, zigbee_test_utils.mock_hub_eui, Basic.ID) }) + mock_simple_device:expect_metadata_update({ provisioning_state = "PROVISIONED" }) + end, + {} +) + +test.register_coroutine_test( + "Handle added lifecycle event", + function() + test.socket.device_lifecycle:__queue_receive({ mock_simple_device.id, "added" }) + + test.socket.capability:__expect_send( + mock_simple_device:generate_test_message( + "main", + capabilities.thermostatMode.supportedThermostatModes( + { + capabilities.thermostatMode.thermostatMode.antifreezing.NAME, + capabilities.thermostatMode.thermostatMode.auto.NAME, + capabilities.thermostatMode.thermostatMode.comfort.NAME, + capabilities.thermostatMode.thermostatMode.eco.NAME, + capabilities.thermostatMode.thermostatMode.off.NAME, + capabilities.thermostatMode.thermostatMode.on.NAME, + }, + { + visibility = { displayed = false } + } + ) + ) + ) + + test.socket.capability:__expect_send( + mock_simple_device:generate_test_message( + "main", + capabilities.thermostatHeatingSetpoint.heatingSetpoint({value = 15.0, unit = "C"}) + ) + ) + + test.socket.capability:__expect_send( + mock_simple_device:generate_test_message( + "main", + capabilities.temperatureMeasurement.temperature({value = 20.0, unit = "C"}) + ) + ) + + test.socket.capability:__expect_send( + mock_simple_device:generate_test_message( + "main", + capabilities.thermostatMode.thermostatMode.auto() + ) + ) + + test.socket.capability:__expect_send( + mock_simple_device:generate_test_message( + "main", + capabilities.battery.battery(100) + ) + ) + end, + {} +) + +test.register_message_test( + "Handle thermostatHeatingSetpoint setHeatingSetpoint", + { + { + channel = "capability", + direction = "receive", + message = { + mock_simple_device.id, + { + capability = "thermostatHeatingSetpoint", + component = "main", + command = "setHeatingSetpoint", + args = {12.5} + } + } + }, + { + channel = "zigbee", + direction = "send", + message = { + mock_simple_device.id, + tuya_utils.build_send_tuya_command( + mock_simple_device, + "\x04", + tuya_utils.DP_TYPE_VALUE, + "\x00\x00\x00\x7D", + 0x00 + ) + } + } + }, + {} +) + +test.register_message_test( + "Handle thermostatMode setThermostatMode (auto)", + { + { + channel = "capability", + direction = "receive", + message = { + mock_simple_device.id, + { + capability = "thermostatMode", + component = "main", + command = "setThermostatMode", + args = {"auto"} + } + } + }, + { + channel = "zigbee", + direction = "send", + message = { + mock_simple_device.id, + tuya_utils.build_send_tuya_command( + mock_simple_device, + "\x02", + tuya_utils.DP_TYPE_ENUM, + "\x00", + 0x00 + ) + } + } + }, + { + min_api_version = 17 + } +) + +test.register_message_test( + "Handle thermostatMode setThermostatMode (off)", + { + { + channel = "capability", + direction = "receive", + message = { + mock_simple_device.id, + { + capability = "thermostatMode", + component = "main", + command = "setThermostatMode", + args = {"off"} + } + } + }, + { + channel = "zigbee", + direction = "send", + message = { + mock_simple_device.id, + tuya_utils.build_send_tuya_command( + mock_simple_device, + "\x02", + tuya_utils.DP_TYPE_ENUM, + "\x01", + 0x00 + ) + } + } + }, + { + min_api_version = 17 + } +) + +test.register_message_test( + "Handle thermostatMode setThermostatMode (on)", + { + { + channel = "capability", + direction = "receive", + message = { + mock_simple_device.id, + { + capability = "thermostatMode", + component = "main", + command = "setThermostatMode", + args = {"on"} + } + } + }, + { + channel = "zigbee", + direction = "send", + message = { + mock_simple_device.id, + tuya_utils.build_send_tuya_command( + mock_simple_device, + "\x02", + tuya_utils.DP_TYPE_ENUM, + "\x02", + 0x00 + ) + } + } + }, + { + min_api_version = 17 + } +) + +test.register_message_test( + "Handle thermostatMode setThermostatMode (comfort)", + { + { + channel = "capability", + direction = "receive", + message = { + mock_simple_device.id, + { + capability = "thermostatMode", + component = "main", + command = "setThermostatMode", + args = {"comfort"} + } + } + }, + { + channel = "zigbee", + direction = "send", + message = { + mock_simple_device.id, + tuya_utils.build_send_tuya_command( + mock_simple_device, + "\x02", + tuya_utils.DP_TYPE_ENUM, + "\x03", + 0x00 + ) + } + } + }, + { + min_api_version = 17 + } +) + +test.register_message_test( + "Handle thermostatMode setThermostatMode (eco)", + { + { + channel = "capability", + direction = "receive", + message = { + mock_simple_device.id, + { + capability = "thermostatMode", + component = "main", + command = "setThermostatMode", + args = {"eco"} + } + } + }, + { + channel = "zigbee", + direction = "send", + message = { + mock_simple_device.id, + tuya_utils.build_send_tuya_command( + mock_simple_device, + "\x02", + tuya_utils.DP_TYPE_ENUM, + "\x04", + 0x00 + ) + } + } + }, + { + min_api_version = 17 + } +) + +test.register_message_test( + "Handle thermostatMode setThermostatMode (antifreezing)", + { + { + channel = "capability", + direction = "receive", + message = { + mock_simple_device.id, + { + capability = "thermostatMode", + component = "main", + command = "setThermostatMode", + args = {"antifreezing"} + } + } + }, + { + channel = "zigbee", + direction = "send", + message = { + mock_simple_device.id, + tuya_utils.build_send_tuya_command( + mock_simple_device, + "\x02", + tuya_utils.DP_TYPE_ENUM, + "\x05", + 0x00 + ) + } + } + }, + { + min_api_version = 17 + } +) + +test.register_message_test( + "Handle tuya cluster message report (heatingSetpoint)", + { + { + channel = "zigbee", + direction = "receive", + message = { + mock_simple_device.id, + tuya_utils.build_test_attr_report( + mock_simple_device, + "\x04", + tuya_utils.DP_TYPE_VALUE, + "\x00\x00\x00\x7D", + 0x01 + ) + } + }, + { + channel = "capability", + direction = "send", + message = mock_simple_device:generate_test_message( + "main", + capabilities.thermostatHeatingSetpoint.heatingSetpoint({value = 12.5, unit = "C"}) + ) + } + }, + {} +) + +test.register_message_test( + "Handle tuya cluster message report (setThermostatMode, auto)", + { + { + channel = "zigbee", + direction = "receive", + message = { + mock_simple_device.id, + tuya_utils.build_test_attr_report( + mock_simple_device, + "\x02", + tuya_utils.DP_TYPE_ENUM, + "\x00", + 0x01 + ) + } + }, + { + channel = "capability", + direction = "send", + message = mock_simple_device:generate_test_message( + "main", + capabilities.thermostatMode.thermostatMode.auto() + ) + } + }, + {} +) + +test.register_message_test( + "Handle tuya cluster message report (setThermostatMode, off)", + { + { + channel = "zigbee", + direction = "receive", + message = { + mock_simple_device.id, + tuya_utils.build_test_attr_report( + mock_simple_device, + "\x02", + tuya_utils.DP_TYPE_ENUM, + "\x01", + 0x01 + ) + } + }, + { + channel = "capability", + direction = "send", + message = mock_simple_device:generate_test_message( + "main", + capabilities.thermostatMode.thermostatMode.off() + ) + } + }, + {} +) + +test.register_message_test( + "Handle tuya cluster message report (setThermostatMode, on)", + { + { + channel = "zigbee", + direction = "receive", + message = { + mock_simple_device.id, + tuya_utils.build_test_attr_report( + mock_simple_device, + "\x02", + tuya_utils.DP_TYPE_ENUM, + "\x02", + 0x01 + ) + } + }, + { + channel = "capability", + direction = "send", + message = mock_simple_device:generate_test_message( + "main", + capabilities.thermostatMode.thermostatMode.on() + ) + } + }, + {} +) + +test.register_message_test( + "Handle tuya cluster message report (setThermostatMode, comfort)", + { + { + channel = "zigbee", + direction = "receive", + message = { + mock_simple_device.id, + tuya_utils.build_test_attr_report( + mock_simple_device, + "\x02", + tuya_utils.DP_TYPE_ENUM, + "\x03", + 0x01 + ) + } + }, + { + channel = "capability", + direction = "send", + message = mock_simple_device:generate_test_message( + "main", + capabilities.thermostatMode.thermostatMode.comfort() + ) + } + }, + {} +) + +test.register_message_test( + "Handle tuya cluster message report (setThermostatMode, eco)", + { + { + channel = "zigbee", + direction = "receive", + message = { + mock_simple_device.id, + tuya_utils.build_test_attr_report( + mock_simple_device, + "\x02", + tuya_utils.DP_TYPE_ENUM, + "\x04", + 0x01 + ) + } + }, + { + channel = "capability", + direction = "send", + message = mock_simple_device:generate_test_message( + "main", + capabilities.thermostatMode.thermostatMode.eco() + ) + } + }, + {} +) + +test.register_message_test( + "Handle tuya cluster message report (setThermostatMode, antifreezing)", + { + { + channel = "zigbee", + direction = "receive", + message = { + mock_simple_device.id, + tuya_utils.build_test_attr_report( + mock_simple_device, + "\x02", + tuya_utils.DP_TYPE_ENUM, + "\x05", + 0x01 + ) + } + }, + { + channel = "capability", + direction = "send", + message = mock_simple_device:generate_test_message( + "main", + capabilities.thermostatMode.thermostatMode.antifreezing() + ) + } + }, + {} +) + +test.run_registered_tests() diff --git a/drivers/Unofficial/tuya-zigbee/src/thermostat/init.lua b/drivers/Unofficial/tuya-zigbee/src/thermostat/init.lua new file mode 100644 index 0000000000..2179fb28a4 --- /dev/null +++ b/drivers/Unofficial/tuya-zigbee/src/thermostat/init.lua @@ -0,0 +1,187 @@ +-- Copyright 2026 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + +local capabilities = require "st.capabilities" +local defaults = require "st.zigbee.defaults" +local device_management = require "st.zigbee.device_management" +local clusters = require "st.zigbee.zcl.clusters" +local tuya_utils = require "tuya_utils" +local Basic = clusters.Basic +local packet_id = 0 + +local FINGERPRINTS = { + { mfr = "_TZE284_fziifcxj", model = "TS0601"} +} + +local function is_tuya_thermostat(opts, driver, device) + for _, fingerprint in ipairs(FINGERPRINTS) do + if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then + return true + end + end + return false +end + +local function device_added(self, device) + device:emit_event(capabilities.thermostatMode.supportedThermostatModes({ + capabilities.thermostatMode.thermostatMode.antifreezing.NAME, + capabilities.thermostatMode.thermostatMode.auto.NAME, + capabilities.thermostatMode.thermostatMode.comfort.NAME, + capabilities.thermostatMode.thermostatMode.eco.NAME, + capabilities.thermostatMode.thermostatMode.off.NAME, + capabilities.thermostatMode.thermostatMode.on.NAME, + }, { visibility = { displayed = false } })) + device:emit_event(capabilities.thermostatHeatingSetpoint.heatingSetpoint({value = 15.0, unit = "C"})) + device:emit_event(capabilities.temperatureMeasurement.temperature({value = 20.0, unit = "C"})) + device:emit_event(capabilities.thermostatMode.thermostatMode.auto()) + device:emit_event(capabilities.battery.battery(100)) +end + +local function do_configure(driver, device) + -- configure ApplicationVersion to keep device online, tuya hub also uses this attribute + tuya_utils.send_magic_spell(device) + device:send(Basic.attributes.ApplicationVersion:configure_reporting(device, 30, 300, 1)) + device:send(device_management.build_bind_request( + device, + Basic.ID, + driver.environment_info.hub_zigbee_eui + )) +end + +local function increase_packet_id(pid) + return (pid + 1) % 65536 +end + +local function do_refresh(driver, device) + device.log.info("do_refresh called") +end + +local MODE_MAP = { + [capabilities.thermostatMode.thermostatMode.auto.NAME] = "\x00", + [capabilities.thermostatMode.thermostatMode.off.NAME] = "\x01", + [capabilities.thermostatMode.thermostatMode.on.NAME] = "\x02", + [capabilities.thermostatMode.thermostatMode.comfort.NAME] = "\x03", + [capabilities.thermostatMode.thermostatMode.eco.NAME] = "\x04", + [capabilities.thermostatMode.thermostatMode.antifreezing.NAME] = "\x05", +} + +local function set_thermostat_mode(driver, device, command) + local mode_value = MODE_MAP[command.args.mode] + if mode_value ~= nil then + tuya_utils.send_tuya_command(device, "\x02", tuya_utils.DP_TYPE_ENUM, mode_value, packet_id) + packet_id = increase_packet_id(packet_id) + end +end + +local function set_heating_setpoint(driver, device, command) + local value = command.args.setpoint + local setpoint_raw = math.floor(value * 10 + 0.5) + tuya_utils.send_tuya_command( + device, + "\x04", + tuya_utils.DP_TYPE_VALUE, + string.pack(">I4", setpoint_raw), + packet_id + ) + packet_id = increase_packet_id(packet_id) +end + +local function tuya_cluster_handler(driver, device, zb_rx) + local event + local raw = zb_rx.body.zcl_body.body_bytes + local dp = raw:byte(3) + local dp_type = raw:byte(4) + local dp_data_len = string.unpack(">I2", raw:sub(5, 6)) + local dp_data = raw:sub(7, 6 + dp_data_len) + + if dp == 0x04 then -- Target temperature + if dp_type == 0x02 and dp_data_len >= 4 then -- value + local target_temp_raw = string.unpack(">I4", dp_data:sub(1, 4)) + local target_temp = target_temp_raw / 10.0 + event = capabilities.thermostatHeatingSetpoint.heatingSetpoint({ + value = target_temp, + unit = "C" + }) + end + + elseif dp == 0x05 then -- Current temperature + if dp_type == 0x02 and dp_data_len >= 4 then -- value + local temp_raw = string.unpack(">I4", dp_data:sub(1, 4)) + local temp = temp_raw / 10.0 + event = capabilities.temperatureMeasurement.temperature({ + value = temp, + unit = "C" + }) + end + + elseif dp == 0x02 then -- Thermostat mode + if dp_type == 0x04 and dp_data_len >= 1 then -- enum + local mode = dp_data:byte(1) + if mode == 0x00 then -- auto + event = capabilities.thermostatMode.thermostatMode.auto() + elseif mode == 0x01 then -- off + event = capabilities.thermostatMode.thermostatMode.off() + elseif mode == 0x02 then -- on + event = capabilities.thermostatMode.thermostatMode.on() + elseif mode == 0x03 then -- comfort + event = capabilities.thermostatMode.thermostatMode.comfort() + elseif mode == 0x04 then -- eco + event = capabilities.thermostatMode.thermostatMode.eco() + elseif mode == 0x05 then -- antifreezing + event = capabilities.thermostatMode.thermostatMode.antifreezing() + end + end + + elseif dp == 0x06 then -- Battery level + if dp_type == 0x02 and dp_data_len >= 4 then -- value + local battery_level = string.unpack(">I4", dp_data:sub(1, 4)) + event = capabilities.battery.battery(battery_level) + end + end + + if event ~= nil then + device:emit_event(event) + end +end + +local tuya_thermostat_driver = { + NAME = "tuya thermostat", + supported_capabilities = { + capabilities.temperatureMeasurement, + capabilities.thermostatHeatingSetpoint, + capabilities.thermostatMode, + capabilities.battery, + capabilities.refresh + }, + zigbee_handlers = { + cluster = { + [tuya_utils.TUYA_PRIVATE_CLUSTER] = { + [tuya_utils.TUYA_PRIVATE_CMD_REPORT] = tuya_cluster_handler, + [tuya_utils.TUYA_PRIVATE_CMD_RESPONSE] = tuya_cluster_handler, + } + } + }, + capability_handlers = { + [capabilities.thermostatMode.ID] = { + [capabilities.thermostatMode.commands.setThermostatMode.NAME] = set_thermostat_mode, + }, + [capabilities.thermostatHeatingSetpoint.ID] = { + [capabilities.thermostatHeatingSetpoint.commands.setHeatingSetpoint.NAME] = set_heating_setpoint, + }, + [capabilities.refresh.ID] = { + [capabilities.refresh.commands.refresh.NAME] = do_refresh, + }, + }, + lifecycle_handlers = { + added = device_added, + doConfigure = do_configure + }, + can_handle = is_tuya_thermostat +} + +defaults.register_for_default_handlers( + tuya_thermostat_driver, + tuya_thermostat_driver.supported_capabilities, + {} +) +return tuya_thermostat_driver diff --git a/tools/run_driver_tests_p.py b/tools/run_driver_tests_p.py index d19bf46716..c8387dcb1c 100644 --- a/tools/run_driver_tests_p.py +++ b/tools/run_driver_tests_p.py @@ -63,6 +63,12 @@ def run_test(test_file): else: successes += 1 test_cases.append(test_case) + if error and error != "" and len(test_cases) == 0: + failure_output += "\t{} ERROR: test file failed to run\n".format(test_suite_name) + error_case = junit_xml.TestCase("(file error) {}".format(test_suite_name)) + error_case.add_error_info("ERROR", error) + test_cases.append(error_case) + failures += 1 test_suite.test_cases = test_cases return (test_suite, successes, failures, failure_output)