Skip to content
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 @@ -17,7 +17,7 @@ local capabilities = require "st.capabilities"
local zw = require "st.zwave"
local zw_test_utils = require "integration_test.zwave_test_utils"
local Battery = (require "st.zwave.CommandClass.Battery")({ version=1 })
local CentralScene = (require "st.zwave.CommandClass.CentralScene")({ version=1 })
local CentralScene = (require "st.zwave.CommandClass.CentralScene")({ version=3 })
local SceneActivation = (require "st.zwave.CommandClass.SceneActivation")({ version = 1 })
local Configuration = (require "st.zwave.CommandClass.Configuration")({ version = 4 })
local Association = (require "st.zwave.CommandClass.Association")({ version = 1 })
Expand Down Expand Up @@ -719,6 +719,28 @@ test.register_coroutine_test(
Battery:Get({})
)
)

test.wait_for_events()
test.socket.zwave:__queue_receive({
mock_fibaro_keyfob_button.id,
CentralScene:Notification(
{
key_attributes = CentralScene.key_attributes.KEY_PRESSED_3_TIMES, scene_number=1, sequence_number=8, slow_refresh=true
}
)
})
test.socket.capability:__expect_send(
mock_fibaro_keyfob_button:generate_test_message(
"main",
capabilities.button.button.pushed_3x({ state_change = true })
)
)
test.socket.capability:__expect_send(
mock_fibaro_keyfob_button:generate_test_message(
"button1",
capabilities.button.button.pushed_3x({ state_change = true })
)
)
end
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ local cc = require "st.zwave.CommandClass"
local CentralScene = (require "st.zwave.CommandClass.CentralScene")({ version=1 })
--- @type st.zwave.CommandClass.SceneActivation
local SceneActivation = (require "st.zwave.CommandClass.SceneActivation")({ version=1 })
local log = require "log"
local utils = require "st.utils"

local ZWAVE_MULTI_BUTTON_FINGERPRINTS = {
{mfr = 0x010F, prod = 0x1001, model = 0x1000}, -- Fibaro KeyFob EU
Expand Down Expand Up @@ -67,7 +69,11 @@ local function central_scene_notification_handler(self, device, cmd)
capabilities.button.supportedButtonValues.NAME,
{capabilities.button.button.pushed.NAME, capabilities.button.button.held.NAME} -- default value
)
log.debug("COMPONENT: "..device:endpoint_to_component(cmd.args.scene_number))
log.debug("SUPPORTED EVENTS: " .. utils.stringify_table(supportedEvents))
for _, event_name in pairs(supportedEvents) do
log.debug("EVENT_NAME: " .. event_name)
log.debug("EVENT VALUE: " .. event.value.value)
if event.value.value == event_name then
device:emit_event_for_endpoint(cmd.args.scene_number, event)
device:emit_event(event)
Expand Down
Loading