Skip to content

Commit

Permalink
Merge branch 'main' into matter-switch-add-profile-for-button-plug-de…
Browse files Browse the repository at this point in the history
…vice
  • Loading branch information
nickolas-deboom authored Dec 9, 2024
2 parents 30c2255 + 34a1afe commit e418979
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 5 deletions.
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
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
2 changes: 1 addition & 1 deletion drivers/SmartThings/zigbee-switch/src/preferences.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ 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
Expand Down
2 changes: 1 addition & 1 deletion drivers/SmartThings/zwave-sensor/src/preferences.lua
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ 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 new_parameter_value = preferences.to_numeric_value(device.preferences[id])
device:send(Configuration:Set({parameter_number = prefs[id].parameter_number, size = prefs[id].size, configuration_value = new_parameter_value}))
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ local fibaro_smoke_sensor = {
},
NAME = "fibaro smoke sensor",
can_handle = can_handle_fibaro_smoke_sensor,
health_check = false,
}

return fibaro_smoke_sensor
2 changes: 1 addition & 1 deletion drivers/SmartThings/zwave-smoke-alarm/src/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ local preferencesMap = require "preferences"
local function update_preferences(self, device, args)
local preferences = preferencesMap.get_device_parameters(device)
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 preferences and preferences[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 preferences and preferences[id]) then
local new_parameter_value = preferencesMap.to_numeric_value(device.preferences[id])
device:send(Configuration:Set({parameter_number = preferences[id].parameter_number, size = preferences[id].size, configuration_value = new_parameter_value}))
end
Expand Down

0 comments on commit e418979

Please sign in to comment.