Skip to content

Commit

Permalink
Merge pull request #1760 from SmartThingsCommunity/beta-hotfix/Nov-18-24
Browse files Browse the repository at this point in the history
Attempt # 2 Cherry Pick to Beta before Production Release Nov 18
  • Loading branch information
lelandblue authored Nov 18, 2024
2 parents 045a2d8 + baff9fa commit 199a940
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 109 deletions.
6 changes: 6 additions & 0 deletions drivers/SmartThings/matter-sensor/fingerprints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ matterManufacturer:
vendorId: 0x115F
productId: 0x2003
deviceProfileName: motion-illuminance-battery
#Elko
- id: "5170/4098"
deviceLabel: RFWD-100/MT
vendorId: 0x1432
productId: 0x1002
deviceProfileName: contact-battery
#Eve
- id: "Eve Motion"
deviceLabel: Eve Motion
Expand Down
28 changes: 27 additions & 1 deletion drivers/SmartThings/matter-switch/fingerprints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,22 @@ matterManufacturer:
vendorId: 0x1426
productId: 0x0003
deviceProfileName: plug-binary
#Elko
- id: "5170/4096"
deviceLabel: RFSAI-62B-SL/MT
vendorId: 0x1432
productId: 0x1000
deviceProfileName: switch-binary
- id: "5170/4097"
deviceLabel: RFGB-40B(W)/MT
vendorId: 0x1432
productId: 0x1001
deviceProfileName: 4-button-battery
- id: "5170/4099"
deviceLabel: RFWB-40G/MT
vendorId: 0x1432
productId: 0x1003
deviceProfileName: 4-button-battery
#Eve
- id: "Eve/Energy/US"
deviceLabel: Eve Energy
Expand Down Expand Up @@ -58,7 +74,6 @@ matterManufacturer:
vendorId: 0x130A
productId: 0x005D
deviceProfileName: switch-binary

#GE
- id: "4921/177"
deviceLabel: Cync Full Color 2 Inch Wafer
Expand Down Expand Up @@ -180,6 +195,11 @@ matterManufacturer:
vendorId: 0x1339
productId: 0x006B
deviceProfileName: light-color-level-2000K-7000K
- id: "4921/125"
deviceLabel: Cync Paddle Dimmer
vendorId: 0x1339
productId: 0x007D
deviceProfileName: switch-level
- id: "4921/108"
deviceLabel: Cync Reveal Full Color BR30
vendorId: 0x1339
Expand Down Expand Up @@ -506,6 +526,12 @@ matterManufacturer:
vendorId: 0x1396
productId: 0x1000
deviceProfileName: light-color-level-1800K-6500K
#U-Tec
- id: "5247/3"
deviceLabel: U-tec Smart Matter Plug
vendorId: 0x147F
productId: 0x0003
deviceProfileName: plug-binary
#WiZ
- id: "WiZ A19"
deviceLabel: WiZ A19
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,20 @@ local function do_refresh(driver, device, command) -- should be deleted when v46
end
end

-- Do not use native handlers due to unique component to endpoint mapping
local function switch_on_handler(driver, device, cmd)
switchDefaults.capability_handlers[capabilities.switch.commands.on](driver, device, cmd, false)
end

local function switch_off_handler(driver, device, cmd)
switchDefaults.capability_handlers[capabilities.switch.commands.off](driver, device, cmd, false)
end

local function set_level_handler(driver, device, cmd)
local defaults = require "st.zwave.defaults.switchLevel"
defaults.capability_handlers[capabilities.switchLevel.commands.setLevel](driver, device, cmd, false)
end

local function meter_report_handler(driver, device, cmd)
-- We got a meter report from the root node, so refresh all children
-- endpoint 0 should have its reports dropped
Expand Down Expand Up @@ -161,7 +175,14 @@ local multi_metering_switch = {
},
[capabilities.energyMeter.ID] = {
[capabilities.energyMeter.commands.resetEnergyMeter.NAME] = reset
}
},
[capabilities.switch.ID] = {
[capabilities.switch.commands.on.NAME] = switch_on_handler,
[capabilities.switch.commands.off.NAME] = switch_off_handler,
},
[capabilities.switchLevel.ID] = {
[capabilities.switchLevel.commands.setLevel.NAME] = set_level_handler,
},
},
zwave_handlers = {
[cc.METER] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,6 @@ test.register_message_test(
{ capability = "switch", command = "on", component = "main", args = {} }
}
},
{
channel = "devices",
direction = "send",
message = {
"register_native_capability_cmd_handler",
{ device_uuid = mock_parent_device.id, capability_id = "switch", capability_cmd_id = "on" }
}
},
{
channel = "zwave",
direction = "send",
Expand All @@ -270,14 +262,6 @@ test.register_message_test(
{ capability = "switch", command = "on", component = "main", args = {} }
}
},
{
channel = "devices",
direction = "send",
message = {
"register_native_capability_cmd_handler",
{ device_uuid = mock_child_device.id, capability_id = "switch", capability_cmd_id = "on" }
}
},
{
channel = "zwave",
direction = "send",
Expand All @@ -303,14 +287,6 @@ test.register_message_test(
{ capability = "switch", command = "off", component = "main", args = {} }
}
},
{
channel = "devices",
direction = "send",
message = {
"register_native_capability_cmd_handler",
{ device_uuid = mock_parent_device.id, capability_id = "switch", capability_cmd_id = "off" }
}
},
{
channel = "zwave",
direction = "send",
Expand All @@ -336,14 +312,6 @@ test.register_message_test(
{ capability = "switch", command = "off", component = "main", args = {} }
}
},
{
channel = "devices",
direction = "send",
message = {
"register_native_capability_cmd_handler",
{ device_uuid = mock_child_device.id, capability_id = "switch", capability_cmd_id = "off" }
}
},
{
channel = "zwave",
direction = "send",
Expand Down Expand Up @@ -606,7 +574,6 @@ test.register_coroutine_test(
mock_parent_device.id,
{ capability = "switch", command = "off", component = "main", args = {} }
})
mock_parent_device:expect_native_cmd_handler_registration("switch", "off")
test.socket.zwave:__expect_send(
zw_test_utils.zwave_test_build_send_command(
mock_parent_device,
Expand Down Expand Up @@ -637,7 +604,6 @@ test.register_coroutine_test(
mock_child_device.id,
{ capability = "switch", command = "off", component = "main", args = {} }
})
mock_child_device:expect_native_cmd_handler_registration("switch", "off")
test.socket.zwave:__expect_send(
zw_test_utils.zwave_test_build_send_command(
mock_parent_device,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,6 @@ test.register_message_test(
{ capability = "switch", command = "on", component = "main", args = {} }
}
},
{
channel = "devices",
direction = "send",
message = {
"register_native_capability_cmd_handler",
{ device_uuid = mock_parent_device.id, capability_id = "switch", capability_cmd_id = "on" }
}
},
{
channel = "zwave",
direction = "send",
Expand All @@ -269,14 +261,6 @@ test.register_message_test(
{ capability = "switch", command = "on", component = "main", args = {} }
}
},
{
channel = "devices",
direction = "send",
message = {
"register_native_capability_cmd_handler",
{ device_uuid = mock_child_device.id, capability_id = "switch", capability_cmd_id = "on" }
}
},
{
channel = "zwave",
direction = "send",
Expand All @@ -302,14 +286,6 @@ test.register_message_test(
{ capability = "switch", command = "off", component = "main", args = {} }
}
},
{
channel = "devices",
direction = "send",
message = {
"register_native_capability_cmd_handler",
{ device_uuid = mock_parent_device.id, capability_id = "switch", capability_cmd_id = "off" }
}
},
{
channel = "zwave",
direction = "send",
Expand All @@ -335,14 +311,6 @@ test.register_message_test(
{ capability = "switch", command = "off", component = "main", args = {} }
}
},
{
channel = "devices",
direction = "send",
message = {
"register_native_capability_cmd_handler",
{ device_uuid = mock_child_device.id, capability_id = "switch", capability_cmd_id = "off" }
}
},
{
channel = "zwave",
direction = "send",
Expand Down Expand Up @@ -559,7 +527,6 @@ test.register_coroutine_test(
mock_parent_device.id,
{ capability = "switch", command = "off", component = "main", args = {} }
})
mock_parent_device:expect_native_cmd_handler_registration("switch", "off")
test.socket.zwave:__expect_send(
zw_test_utils.zwave_test_build_send_command(
mock_parent_device,
Expand Down Expand Up @@ -590,7 +557,6 @@ test.register_coroutine_test(
mock_child_device.id,
{ capability = "switch", command = "off", component = "main", args = {} }
})
mock_child_device:expect_native_cmd_handler_registration("switch", "off")
test.socket.zwave:__expect_send(
zw_test_utils.zwave_test_build_send_command(
mock_parent_device,
Expand Down
34 changes: 0 additions & 34 deletions drivers/SmartThings/zwave-switch/src/test/test_wyfy_touch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,6 @@ test.register_message_test(
{ capability = "switch", command = "on", component = "main", args = {} }
}
},
{
channel = "devices",
direction = "send",
message = {
"register_native_capability_cmd_handler",
{ device_uuid = mock_parent_device.id, capability_id = "switch", capability_cmd_id = "on" }
}
},
{
channel = "zwave",
direction = "send",
Expand All @@ -127,14 +119,6 @@ test.register_message_test(
{ capability = "switch", command = "on", component = "main", args = {} }
}
},
{
channel = "devices",
direction = "send",
message = {
"register_native_capability_cmd_handler",
{ device_uuid = mock_child_device.id, capability_id = "switch", capability_cmd_id = "on" }
}
},
{
channel = "zwave",
direction = "send",
Expand All @@ -160,14 +144,6 @@ test.register_message_test(
{ capability = "switch", command = "off", component = "main", args = {} }
}
},
{
channel = "devices",
direction = "send",
message = {
"register_native_capability_cmd_handler",
{ device_uuid = mock_parent_device.id, capability_id = "switch", capability_cmd_id = "off" }
}
},
{
channel = "zwave",
direction = "send",
Expand All @@ -193,14 +169,6 @@ test.register_message_test(
{ capability = "switch", command = "off", component = "main", args = {} }
}
},
{
channel = "devices",
direction = "send",
message = {
"register_native_capability_cmd_handler",
{ device_uuid = mock_child_device.id, capability_id = "switch", capability_cmd_id = "off" }
}
},
{
channel = "zwave",
direction = "send",
Expand Down Expand Up @@ -283,7 +251,6 @@ test.register_coroutine_test(
mock_parent_device.id,
{ capability = "switch", command = "off", component = "main", args = {} }
})
mock_parent_device:expect_native_cmd_handler_registration("switch", "off")

test.socket.zwave:__expect_send(
zw_test_utils.zwave_test_build_send_command(
Expand Down Expand Up @@ -315,7 +282,6 @@ test.register_coroutine_test(
mock_child_device.id,
{ capability = "switch", command = "off", component = "main", args = {} }
})
mock_child_device:expect_native_cmd_handler_registration("switch", "off")
test.socket.zwave:__expect_send(
zw_test_utils.zwave_test_build_send_command(
mock_parent_device,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,6 @@ test.register_coroutine_test(
mock_parent.id,
{ capability = "switch", component = "main", command = "on", args = {} }
})
mock_parent:expect_native_cmd_handler_registration("switch", "on")

test.socket.zwave:__expect_send(
zw_test_utils.zwave_test_build_send_command(
Expand Down Expand Up @@ -505,7 +504,6 @@ test.register_coroutine_test(
mock_child.id,
{ capability = "switch", component = "main", command = "on", args = {} }
})
mock_child:expect_native_cmd_handler_registration("switch", "on")

test.socket.zwave:__expect_send(
zw_test_utils.zwave_test_build_send_command(
Expand Down Expand Up @@ -543,7 +541,6 @@ test.register_coroutine_test(
mock_parent.id,
{ capability = "switch", component = "main", command = "off", args = {} }
})
mock_parent:expect_native_cmd_handler_registration("switch", "off")

test.socket.zwave:__expect_send(
zw_test_utils.zwave_test_build_send_command(
Expand Down Expand Up @@ -581,7 +578,6 @@ test.register_coroutine_test(
mock_child.id,
{ capability = "switch", component = "main", command = "off", args = {} }
})
mock_child:expect_native_cmd_handler_registration("switch", "off")

test.socket.zwave:__expect_send(
zw_test_utils.zwave_test_build_send_command(
Expand Down
Loading

0 comments on commit 199a940

Please sign in to comment.