Skip to content

Revert "Roll back health check changes for staged release." #2257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ local zigbee_carbon_monoxide_driver_template = {
capabilities.battery,
},
ias_zone_configuration_method = constants.IAS_ZONE_CONFIGURE_TYPE.AUTO_ENROLL_RESPONSE,
sub_drivers = { require("ClimaxTechnology") }
sub_drivers = { require("ClimaxTechnology") },
health_check = false,
}

defaults.register_for_default_handlers(zigbee_carbon_monoxide_driver_template,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ local mock_device = test.mock_device.build_test_zigbee_device(

zigbee_test_utils.prepare_zigbee_env_info()
local function test_init()
test.mock_device.add_test_device(mock_device)
zigbee_test_utils.init_noop_health_check_timer()
end
test.mock_device.add_test_device(mock_device)end
test.set_test_init_function(test_init)

test.register_message_test(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ local mock_device = test.mock_device.build_test_zigbee_device(

zigbee_test_utils.prepare_zigbee_env_info()
local function test_init()
test.mock_device.add_test_device(mock_device)
zigbee_test_utils.init_noop_health_check_timer()
end
test.mock_device.add_test_device(mock_device)end
test.set_test_init_function(test_init)

test.register_message_test(
Expand Down
3 changes: 2 additions & 1 deletion drivers/SmartThings/zigbee-fan/src/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ local zigbee_fan_driver = {
},
lifecycle_handlers = {
init = device_init
}
},
health_check = false,
}

defaults.register_for_default_handlers(zigbee_fan_driver,zigbee_fan_driver.supported_capabilities)
Expand Down
4 changes: 1 addition & 3 deletions drivers/SmartThings/zigbee-fan/src/test/test_fan_light.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ local mock_base_device = test.mock_device.build_test_zigbee_device(
zigbee_test_utils.prepare_zigbee_env_info()

local function test_init()
test.mock_device.add_test_device(mock_base_device)
zigbee_test_utils.init_noop_health_check_timer()
end
test.mock_device.add_test_device(mock_base_device)end
test.set_test_init_function(test_init)

-- create test commands
Expand Down
3 changes: 2 additions & 1 deletion drivers/SmartThings/zigbee-humidity-sensor/src/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ local zigbee_humidity_driver = {
require("centralite-sensor"),
require("heiman-sensor"),
require("frient-sensor")
}
},
health_check = false,
}

defaults.register_for_default_handlers(zigbee_humidity_driver, zigbee_humidity_driver.supported_capabilities)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ local mock_device = test.mock_device.build_test_zigbee_device(

zigbee_test_utils.prepare_zigbee_env_info()
local function test_init()
test.mock_device.add_test_device(mock_device)
zigbee_test_utils.init_noop_health_check_timer()
end
test.mock_device.add_test_device(mock_device)end

test.set_test_init_function(test_init)

Expand Down
3 changes: 2 additions & 1 deletion drivers/SmartThings/zigbee-illuminance-sensor/src/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ local zigbee_illuminance_driver = {
},
sub_drivers = {
require("aqara")
}
},
health_check = false,
}

defaults.register_for_default_handlers(zigbee_illuminance_driver, zigbee_illuminance_driver.supported_capabilities)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ local mock_device = test.mock_device.build_test_zigbee_device(

zigbee_test_utils.prepare_zigbee_env_info()
local function test_init()
test.mock_device.add_test_device(mock_device)
zigbee_test_utils.init_noop_health_check_timer()
end
test.mock_device.add_test_device(mock_device)end

test.set_test_init_function(test_init)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ local mock_device = test.mock_device.build_test_zigbee_device(

zigbee_test_utils.prepare_zigbee_env_info()
local function test_init()
test.mock_device.add_test_device(mock_device)
zigbee_test_utils.init_noop_health_check_timer()
end
test.mock_device.add_test_device(mock_device)end

test.set_test_init_function(test_init)

Expand Down
3 changes: 2 additions & 1 deletion drivers/SmartThings/zigbee-power-meter/src/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ local zigbee_power_meter_driver_template = {
lifecycle_handlers = {
init = device_init,
doConfigure = do_configure,
}
},
health_check = false,
}

defaults.register_for_default_handlers(zigbee_power_meter_driver_template, zigbee_power_meter_driver_template.supported_capabilities)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ local mock_device = test.mock_device.build_test_zigbee_device(

zigbee_test_utils.prepare_zigbee_env_info()
local function test_init()
test.mock_device.add_test_device(mock_device)
zigbee_test_utils.init_noop_health_check_timer()
end
test.mock_device.add_test_device(mock_device)end

test.set_test_init_function(test_init)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ local mock_device = test.mock_device.build_test_zigbee_device(

zigbee_test_utils.prepare_zigbee_env_info()
local function test_init()
test.mock_device.add_test_device(mock_device)
zigbee_test_utils.init_noop_health_check_timer()
end
test.mock_device.add_test_device(mock_device)end

test.set_test_init_function(test_init)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ local mock_device = test.mock_device.build_test_zigbee_device(

zigbee_test_utils.prepare_zigbee_env_info()
local function test_init()
test.mock_device.add_test_device(mock_device)
zigbee_test_utils.init_noop_health_check_timer()
end
test.mock_device.add_test_device(mock_device)end

test.set_test_init_function(test_init)

Expand Down
3 changes: 2 additions & 1 deletion drivers/SmartThings/zigbee-presence-sensor/src/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ local zigbee_presence_driver = {
sub_drivers = {
require("aqara"),
require("arrival-sensor-v1")
}
},
health_check = false,
}

defaults.register_for_default_handlers(zigbee_presence_driver, zigbee_presence_driver.supported_capabilities)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ local add_device = function()
end

local function test_init()
test.mock_device.add_test_device(mock_simple_device)
zigbee_test_utils.init_noop_health_check_timer()
end
test.mock_device.add_test_device(mock_simple_device)end

test.set_test_init_function(test_init)

Expand Down Expand Up @@ -193,9 +191,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()
zigbee_test_utils.init_noop_health_check_timer()
end
test_init = function() end
}
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ local mock_simple_device = test.mock_device.build_test_zigbee_device(
zigbee_test_utils.prepare_zigbee_env_info()

local function test_init()
test.mock_device.add_test_device(mock_simple_device)
zigbee_test_utils.init_noop_health_check_timer()
end
test.mock_device.add_test_device(mock_simple_device)end

local function build_config_response_msg(cluster, status)
local addr_header = messages.AddressHeader(
Expand Down Expand Up @@ -201,9 +199,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()
zigbee_test_utils.init_noop_health_check_timer()
end
test_init = function() end
}
)

Expand Down
1 change: 1 addition & 0 deletions drivers/SmartThings/zigbee-range-extender/src/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ local zigbee_range_driver_template = {
[capabilities.refresh.commands.refresh.NAME] = do_refresh,
}
},
health_check = false,
}

local zigbee_range_extender_driver = ZigbeeDriver("zigbee-range-extender", zigbee_range_driver_template)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

-- Mock out globals
local test = require "integration_test"
local zigbee_test_utils = require "integration_test.zigbee_test_utils"
local clusters = require "st.zigbee.zcl.clusters"
local t_utils = require "integration_test.utils"
local Basic = clusters.Basic
Expand All @@ -24,9 +23,7 @@ local mock_device = test.mock_device.build_test_zigbee_device(
)

local function test_init()
test.mock_device.add_test_device(mock_device)
zigbee_test_utils.init_noop_health_check_timer()
test.timer.__create_and_queue_test_time_advance_timer(600, "interval", "health_check")
test.mock_device.add_test_device(mock_device) test.timer.__create_and_queue_test_time_advance_timer(600, "interval", "health_check")
end

test.set_test_init_function(test_init)
Expand All @@ -45,17 +42,17 @@ test.register_coroutine_test(
end
)

test.register_coroutine_test(
"Health check should check all relevant attributes",
function()
test.socket.device_lifecycle:__queue_receive({ mock_device.id, "added" })
test.wait_for_events()

test.mock_time.advance_time(50000)
test.socket.zigbee:__set_channel_ordering("relaxed")
test.socket.zigbee:__expect_send({ mock_device.id, Basic.attributes.ZCLVersion:read(mock_device) })
test.wait_for_events()
end
)
-- test.register_coroutine_test(
-- "Health check should check all relevant attributes",
-- function()
-- test.socket.device_lifecycle:__queue_receive({ mock_device.id, "added" })
-- test.wait_for_events()

-- test.mock_time.advance_time(50000)
-- test.socket.zigbee:__set_channel_ordering("relaxed")
-- test.socket.zigbee:__expect_send({ mock_device.id, Basic.attributes.ZCLVersion:read(mock_device) })
-- test.wait_for_events()
-- end
-- )

test.run_registered_tests()
3 changes: 2 additions & 1 deletion drivers/SmartThings/zigbee-siren/src/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ local zigbee_siren_driver_template = {
data_type = IASZone.attributes.ZoneStatus.base_type
}
}
}
},
health_check = false,
}

defaults.register_for_default_handlers(zigbee_siren_driver_template, zigbee_siren_driver_template.supported_capabilities)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ local mock_device = test.mock_device.build_test_zigbee_device(

zigbee_test_utils.prepare_zigbee_env_info()
local function test_init()
test.mock_device.add_test_device(mock_device)
zigbee_test_utils.init_noop_health_check_timer()
end
test.mock_device.add_test_device(mock_device)end

test.set_test_init_function(test_init)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ local mock_device = test.mock_device.build_test_zigbee_device(

zigbee_test_utils.prepare_zigbee_env_info()
local function test_init()
test.mock_device.add_test_device(mock_device)
zigbee_test_utils.init_noop_health_check_timer()
end
test.mock_device.add_test_device(mock_device)end

test.set_test_init_function(test_init)

Expand Down
1 change: 1 addition & 0 deletions drivers/SmartThings/zigbee-watering-kit/src/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ local zigbee_water_driver_template = {
sub_drivers = {
require("thirdreality")
},
health_check = false,
}

defaults.register_for_default_handlers(zigbee_water_driver_template, zigbee_water_driver_template.supported_capabilities)
Expand Down
Loading