Continuing the discussion from Help needed: st.zigbee.cluster_base understanding:
After addressing my custom capabilities in my test script correctly with test_utils.load_capability_definition_from_package()
and running the test I got this error:
PS Q:\repos\smartthings_edge_drivers\popp-smart-thermostat\src> lua54 .\test\sample_test.lua
Running test "Check all preferences via infoChanged" (1 of 1)
-------------------------------------------------------------
Received unexpected error: .\init.lua:271: Capability preparestream40760.heatMode version 1 definition not found
stack traceback:
[C]: in function 'error'
...gs_edge_drivers\lua_libs-api_v0\st\capabilities\init.lua:101: in metamethod 'index'
.\init.lua:271: in main chunk
[C]: in function 'require'
[C]: in function 'xpcall'
...s_edge_drivers\lua_libs-api_v0\integration_test\init.lua:213: in upvalue 'run_configured_test'
...s_edge_drivers\lua_libs-api_v0\integration_test\init.lua:325: in function 'integration_test.run_registered_tests'
.\test\sample_test.lua:50: in main chunk
[C]: in ?
FAILED
Passed 0 of 1 tests
So it’s complaining about the capability_handler … here is my init.lua snippet:
-- definition
local HeatingMode = capabilities["preparestream40760.heatMode"]
...
-- capability handlers
local driver = {
supported_capabilities = {
...
HeatingMode
},
zigbee_handlers = {
attr = {
[PowerConfiguration.ID] = {
[PowerConfiguration.attributes.BatteryVoltage.ID] = battery_voltage_handler
},
[Thermostat.ID] = {
[Thermostat.attributes.ControlSequenceOfOperation.ID] = supported_thermostat_modes_handler
}
}
},
capability_handlers = {
...
[HeatingMode.ID] = {
[HeatingMode.commands.setSetpointMode.NAME] = common.heat_cmd_handler
}
},
lifecycle_handlers = {
added = device_added,
init = device_init,
doConfigure = do_configure,
infoChanged = info_changed,
driverSwitched = driver_switched,
removed = device_removed
}
}
Any idea?
Against the device itself it works like a charm.
Thank you in advance