Skip to content
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

rolling up main to beta #1811

Merged
merged 22 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f44090f
Matter Thermostat: check for nil in temp attribute handler
ctowns Dec 3, 2024
46bff8d
Add shinasystem's full buttons switch for wwst (#1748)
shinasys Dec 3, 2024
ff3a213
New Device (Matter Switch) Cync Reveal Full Color A21 (#1788)
lelandblue Dec 3, 2024
e355080
Add fingerprints for TOTEM S50V/S93/W31V and sort fingerprints for TO…
FrankSpringfield Dec 4, 2024
f10d8b1
Fix for virtual switch regression
greens Dec 4, 2024
76da639
New Devices (Matter Switch + Matter Sensor) 1 Heiman Co Sensor and 2 …
lelandblue Dec 4, 2024
08aecf3
fp2: copy additional header (#1793)
hdlee27 Dec 5, 2024
c5b1b7d
Add Zemismart ZM02 multiple language support (#1785)
iris-wy Dec 5, 2024
8cee6ed
Add Zemismart Zm02 Curtian Motor (#1784)
iris-wy Dec 5, 2024
ab626b6
new-devices-Aqara-T2-bulbs (#1781)
lelandblue Dec 5, 2024
22590e2
Merge pull request #1795 from SmartThingsCommunity/bugfix/virtual_swi…
greens Dec 5, 2024
9074077
CHAD-12279 Some zigbee locks reporting invalid lockStates
greens Dec 5, 2024
43bdeb7
CHAD-12274 fixes occasional null pointer
greens Dec 5, 2024
802a03a
STSE-3372: fix Aqara dimmer blinking (#1774)
Kwang-Hui Dec 5, 2024
7afec24
Merge pull request #1801 from SmartThingsCommunity/bugfix/CHAD-12274
greens Dec 6, 2024
abe0ee1
Merge pull request #1800 from SmartThingsCommunity/bugfix/CHAD-12279
greens Dec 6, 2024
3a3295a
Merge pull request #1792 from SmartThingsCommunity/bugfix/matter-ther…
ctowns Dec 6, 2024
a310a2d
Remove health_check functionality from zigbee-smoke-detector
cjswedes Dec 9, 2024
34a1afe
Merge pull request #1805 from SmartThingsCommunity/feature/remove-hea…
cjswedes Dec 9, 2024
f8f29b9
Adding profile for plug/button device (#1806)
nickolas-deboom Dec 9, 2024
c49efcc
Translation: make translation deploy tolerant of extra newlines
greens Dec 9, 2024
5f9650e
Merge pull request #1808 from SmartThingsCommunity/bugfix/translation…
greens Dec 9, 2024
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
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
5 changes: 5 additions & 0 deletions drivers/SmartThings/matter-sensor/fingerprints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ matterManufacturer:
vendorId: 0x120B
productId: 0x1003
deviceProfileName: smoke
- id: "4619/4103"
deviceLabel: Smart co sensor
vendorId: 0x120B
productId: 0x1007
deviceProfileName: co
# Legrand
- id: "Legrand/Netatmo/Smart-2-in-1-Sensor"
deviceLabel: Netatmo Smart 2-in-1 Sensor
Expand Down
26 changes: 26 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 Expand Up @@ -165,6 +176,11 @@ matterManufacturer:
vendorId: 0x1339
productId: 0x007B
deviceProfileName: light-color-level-2000K-7000K
- id: "4921/109"
deviceLabel: Cync Reveal Full Color A21
vendorId: 0x1339
productId: 0x006D
deviceProfileName: light-color-level-2000K-7000K
- id: "4921/111"
deviceLabel: Cync Outdoor Plug
vendorId: 0x1339
Expand Down Expand Up @@ -2354,6 +2370,11 @@ matterManufacturer:
vendorId: 0x139C
productId: 0xD003
deviceProfileName: light-color-level
- id: "5020/43784"
deviceLabel: Zemismart WiFi Smart Switch
vendorId: 0x139C
productId: 0xAB08
deviceProfileName: switch-binary
- id: "5020/43825"
deviceLabel: Zemismart WiFi Smart Switch
vendorId: 0x139C
Expand All @@ -2369,6 +2390,11 @@ matterManufacturer:
vendorId: 0x139C
productId: 0xAB01
deviceProfileName: switch-binary
- id: "5020/43843"
deviceLabel: Zemismart WiFi Smart Switch
vendorId: 0x139C
productId: 0xAB43
deviceProfileName: switch-binary
#TUO
- id: "5150/1"
deviceLabel: "TUO Smart Button"
Expand Down
18 changes: 18 additions & 0 deletions drivers/SmartThings/matter-switch/profiles/plug-button.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: plug-button
components:
- id: main
capabilities:
- id: switch
version: 1
- id: firmwareUpdate
version: 1
- id: refresh
version: 1
categories:
- name: SmartPlug
- id: button
capabilities:
- id: button
version: 1
categories:
- name: RemoteController
3 changes: 3 additions & 0 deletions drivers/SmartThings/matter-thermostat/src/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,9 @@ end

local function temp_event_handler(attribute)
return function(driver, device, ib, response)
if ib.data.value == nil then
return
end
local unit = "C"

-- Only emit the capability for RPC version >= 5, since unit conversion for
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
23 changes: 19 additions & 4 deletions drivers/SmartThings/zigbee-lock/fingerprints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,16 @@ zigbeeManufacturer:
manufacturer: TOTEM
model: P30
deviceProfileName: lock-battery
- id: TOTEM/P70
deviceLabel: TOTEM Door Lock
manufacturer: TOTEM
model: P70
deviceProfileName: lock-battery
- id: TOTEM/P90
deviceLabel: TOTEM Door Lock
manufacturer: TOTEM
model: P90
deviceProfileName: lock-battery
- id: TOTEM/Q30
deviceLabel: TOTEM Door Lock
manufacturer: TOTEM
Expand All @@ -165,15 +175,20 @@ zigbeeManufacturer:
manufacturer: TOTEM
model: R71
deviceProfileName: lock-battery
- id: TOTEM/P70
- id: TOTEM/S50V
deviceLabel: TOTEM Door Lock
manufacturer: TOTEM
model: P70
model: S50V
deviceProfileName: lock-battery
- id: TOTEM/P90
- id: TOTEM/S93
deviceLabel: TOTEM Door Lock
manufacturer: TOTEM
model: P90
model: S93
deviceProfileName: lock-battery
- id: TOTEM/W31V
deviceLabel: TOTEM Door Lock
manufacturer: TOTEM
model: W31V
deviceProfileName: lock-battery
zigbeeGeneric:
- id: "genericLock"
Expand Down
4 changes: 2 additions & 2 deletions drivers/SmartThings/zigbee-lock/src/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,11 @@ local lock_state_handler = function(driver, device, value, zb_rx)
local delay = device:get_field(DELAY_LOCK_EVENT) or 100
if (delay < MAX_DELAY) then
device.thread:call_with_delay(delay+.5, function ()
device:emit_event_for_endpoint(zb_rx.address_header.src_endpoint.value, LOCK_STATE[value.value])
device:emit_event_for_endpoint(zb_rx.address_header.src_endpoint.value, LOCK_STATE[value.value] or attr.unknown())
end)
else
device:set_field(DELAY_LOCK_EVENT, socket.gettime())
device:emit_event_for_endpoint(zb_rx.address_header.src_endpoint.value, LOCK_STATE[value.value])
device:emit_event_for_endpoint(zb_rx.address_header.src_endpoint.value, LOCK_STATE[value.value] or attr.unknown())
end
end

Expand Down
10 changes: 10 additions & 0 deletions drivers/SmartThings/zigbee-switch/fingerprints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,16 @@ zigbeeManufacturer:
manufacturer: ShinaSystem
model: SQM300Z3
deviceProfileName: basic-switch
- id: ShinaSystem/SQM300Z4
deviceLabel: SiHAS Switch 1
manufacturer: ShinaSystem
model: SQM300Z4
deviceProfileName: basic-switch
- id: ShinaSystem/SQM300Z6
deviceLabel: SiHAS Switch 1
manufacturer: ShinaSystem
model: SQM300Z6
deviceProfileName: basic-switch
- id: Samsung/SAMSUNG-ITM-Z-002
deviceLabel: Samsung Light
manufacturer: Samsung Electronics
Expand Down
12 changes: 8 additions & 4 deletions drivers/SmartThings/zigbee-switch/src/aqara-light/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ local clusters = require "st.zigbee.zcl.clusters"
local cluster_base = require "st.zigbee.cluster_base"
local data_types = require "st.zigbee.data_types"
local capabilities = require "st.capabilities"
local preferences = require "preferences"

local OnOff = clusters.OnOff
local Level = clusters.Level
Expand Down Expand Up @@ -32,13 +33,15 @@ local function do_refresh(self, device)
device:send(ColorControl.attributes.ColorTemperatureMireds:read(device))
end

local function do_configure(self, device)
device:configure()
local function device_added(driver, device, event)
device:send(cluster_base.write_manufacturer_specific_attribute(device,
PRIVATE_CLUSTER_ID, PRIVATE_ATTRIBUTE_ID, MFG_CODE, data_types.Uint8, 1)) -- private
end

local function do_configure(self, device)
device:configure()

device:send(Level.attributes.OnTransitionTime:write(device, 0))
device:send(Level.attributes.OffTransitionTime:write(device, 0))
preferences.sync_preferences(self, device)
device:send(ColorControl.commands.MoveToColorTemperature(device, 200, 0x0000))

do_refresh(self, device)
Expand All @@ -54,6 +57,7 @@ end
local aqara_light_handler = {
NAME = "Aqara Light Handler",
lifecycle_handlers = {
added = device_added,
doConfigure = do_configure
},
capability_handlers = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ local MULTI_SWITCH_NO_MASTER_FINGERPRINTS = {
{ mfr = "ShinaSystem", model = "SBM300Z6", children = 5 },
{ mfr = "ShinaSystem", model = "SQM300Z2", children = 1 },
{ mfr = "ShinaSystem", model = "SQM300Z3", children = 2 },
{ mfr = "ShinaSystem", model = "SQM300Z4", children = 3 },
{ mfr = "ShinaSystem", model = "SQM300Z6", children = 5 },
{ model = "E220-KR2N0Z0-HA", children = 1 },
{ model = "E220-KR3N0Z0-HA", children = 2 },
{ model = "E220-KR4N0Z0-HA", children = 3 },
Expand Down
14 changes: 13 additions & 1 deletion drivers/SmartThings/zigbee-switch/src/preferences.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,19 @@ preferences.update_preferences = function(driver, device, args)
local prefs = preferences.get_device_parameters(device)
if prefs ~= nil then
for id, value in pairs(device.preferences) do
if not (args and args.old_st_store) or (args.old_st_store.preferences[id] ~= value and prefs and prefs[id]) then
if not (args and args.old_st_store and args.old_st_store.preferences) or (args.old_st_store.preferences[id] ~= value and prefs and prefs[id]) then
local message = prefs[id](device, value)
device:send(message)
end
end
end
end

preferences.sync_preferences = function(driver, device)
local prefs = preferences.get_device_parameters(device)
if prefs ~= nil then
for id, value in pairs(device.preferences) do
if prefs and prefs[id] then
local message = prefs[id](device, value)
device:send(message)
end
Expand Down
21 changes: 12 additions & 9 deletions drivers/SmartThings/zigbee-switch/src/test/test_aqara_led_bulb.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,24 @@ end

test.set_test_init_function(test_init)

test.register_coroutine_test(
"Handle added lifecycle",
function()
test.socket.zigbee:__set_channel_ordering("relaxed")
test.socket.device_lifecycle:__queue_receive({ mock_device.id, "added" })

test.socket.zigbee:__expect_send({
mock_device.id, cluster_base.write_manufacturer_specific_attribute(mock_device, PRIVATE_CLUSTER_ID,
PRIVATE_ATTRIBUTE_ID, MFG_CODE, data_types.Uint8, 1) })
end
)

test.register_coroutine_test(
"Configure should configure all necessary attributes and refresh device",
function()
test.socket.device_lifecycle:__queue_receive({ mock_device.id, "doConfigure" })
test.socket.zigbee:__set_channel_ordering("relaxed")

test.socket.zigbee:__expect_send(
{
mock_device.id,
cluster_base.write_manufacturer_specific_attribute(mock_device, PRIVATE_CLUSTER_ID, PRIVATE_ATTRIBUTE_ID
, MFG_CODE, data_types.Uint8, 1)
}
)
test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.OnTransitionTime:write(mock_device, 0) })
test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.OffTransitionTime:write(mock_device, 0) })
test.socket.zigbee:__expect_send(
{
mock_device.id,
Expand Down
21 changes: 14 additions & 7 deletions drivers/SmartThings/zigbee-switch/src/test/test_aqara_light.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ local TURN_OFF_INDICATOR_ATTRIBUTE_ID = 0x0203
local mock_device = test.mock_device.build_test_zigbee_device(
{
profile = t_utils.get_profile_definition("aqara-light.yml"),
preferences = { ["stse.lightFadeInTimeInSec"] = 0, ["stse.lightFadeOutTimeInSec"] = 0 },
fingerprinted_endpoint_id = 0x01,
zigbee_endpoints = {
[1] = {
Expand All @@ -53,21 +54,27 @@ end

test.set_test_init_function(test_init)

test.register_coroutine_test(
"Handle added lifecycle",
function()
test.socket.zigbee:__set_channel_ordering("relaxed")
test.socket.device_lifecycle:__queue_receive({ mock_device.id, "added" })

test.socket.zigbee:__expect_send({
mock_device.id, cluster_base.write_manufacturer_specific_attribute(mock_device, PRIVATE_CLUSTER_ID,
PRIVATE_ATTRIBUTE_ID, MFG_CODE, data_types.Uint8, 1) })
end
)

test.register_coroutine_test(
"Configure should configure all necessary attributes and refresh device",
function()
test.socket.device_lifecycle:__queue_receive({ mock_device.id, "doConfigure" })
test.socket.zigbee:__set_channel_ordering("relaxed")

test.socket.zigbee:__expect_send(
{
mock_device.id,
cluster_base.write_manufacturer_specific_attribute(mock_device, PRIVATE_CLUSTER_ID, PRIVATE_ATTRIBUTE_ID
, MFG_CODE, data_types.Uint8, 1)
}
)
test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.OnTransitionTime:write(mock_device, 0) })
test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.OffTransitionTime:write(mock_device, 0) })

test.socket.zigbee:__expect_send(
{
mock_device.id,
Expand Down
Loading
Loading