Skip to content

Commit

Permalink
Merge branch 'main' into CHAD-13851-support-color-mode-attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
nickolas-deboom authored Dec 5, 2024
2 parents a809cd9 + 22590e2 commit d59def6
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 3 deletions.
3 changes: 2 additions & 1 deletion drivers/Aqara/aqara-presence-sensor/src/fp2/api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ local log = require "log"
local json = require "st.json"
local RestClient = require "lunchbox.rest"
local utils = require "utils"
local st_utils = require "st.utils"

local fp2_api = {}
fp2_api.__index = fp2_api
Expand Down Expand Up @@ -48,7 +49,7 @@ function fp2_api.new_device_manager(device_ip, bridge_info, socket_builder)

return setmetatable(
{
headers = ADDITIONAL_HEADERS,
headers = st_utils.deep_copy(ADDITIONAL_HEADERS),
socket_builder = socket_builder,
base_url = base_url,
}, fp2_api
Expand Down
11 changes: 11 additions & 0 deletions drivers/SmartThings/matter-switch/fingerprints.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
matterManufacturer:
#Aqara
- id: "4447/6145"
deviceLabel: Aqara LED Bulb T2 RGB CCT
vendorId: 0x115F
productId: 0x1801
deviceProfileName: light-color-level
- id: "4447/6146"
deviceLabel: Aqara LED Bulb T2 CCT
vendorId: 0x115F
productId: 0x1802
deviceProfileName: light-level-colorTemperature-2700K-6500K
#Chengdu
- id: "5218/8197"
deviceLabel: Magic Cube DS001
Expand Down
5 changes: 5 additions & 0 deletions drivers/SmartThings/matter-window-covering/fingerprints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ matterManufacturer:
vendorId: 0x139C
productId: 0xFF15
deviceProfileName: window-covering
- id: "5020/64050"
deviceLabel: Zemismart ZM02 Smart Curtain
vendorId: 0x139C
productId: 0xFA32
deviceProfileName: window-covering
- id: "5020/64017"
deviceLabel: Zemismart ZM25C Smart Curtain
vendorId: 0x139C
Expand Down
6 changes: 4 additions & 2 deletions drivers/SmartThings/virtual-switch/src/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ local capabilities = require "st.capabilities"
local Driver = require "st.driver"

local function force_state_change(device)
if device.preferences["certifiedpreferences.forceStateChange"] then
if device.preferences == nil or device.preferences["certifiedpreferences.forceStateChange"] == nil then
return {state_change = true}
else
elseif not device.preferences["certifiedpreferences.forceStateChange"] then
return nil
else
return {state_change = true}
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@ local mock_simple_device = test.mock_device.build_test_generic_device(
}
)

local mock_device_no_prefs = test.mock_device.build_test_generic_device(
{
profile = t_utils.get_profile_definition("virtual-dimmer-switch.yml"),
}
)

local function test_init()
test.mock_device.add_test_device(mock_simple_device)
test.mock_device.add_test_device(mock_device_no_prefs)
end

test.set_test_init_function(test_init)
Expand Down Expand Up @@ -53,6 +60,22 @@ test.register_message_test(
}
)

test.register_message_test(
"Reported on off status should be handled: on",
{
{
channel = "capability",
direction = "receive",
message = { mock_device_no_prefs.id, { capability = "switch", component = "main", command = "on", args = {}}}
},
{
channel = "capability",
direction = "send",
message = mock_device_no_prefs:generate_test_message("main", capabilities.switch.switch.on({state_change=true}))
}
}
)

test.register_message_test(
"Reported on off status should be handled: off",
{
Expand Down
2 changes: 2 additions & 0 deletions tools/localizations/cn.csv
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,6 @@ Aqara Wireless Mini Switch T1,Aqara 无线开关 T1
"WallHero Switch (8 Way)",八位智能开关/场景面板
"WallHero Outlet",智能墙面五孔插座
"WallHero Remote Control (4-Inch)",语音场景(4寸)面板
"Zemismart ZM02 Smart Curtain",Zemismart ZM02 智能窗帘
"Zemismart ZM25C Smart Curtain",Zemismart ZM25C 智能窗帘

0 comments on commit d59def6

Please sign in to comment.