Skip to content

Commit

Permalink
Merge pull request SmartThingsCommunity#1675 from SmartThingsCommunit…
Browse files Browse the repository at this point in the history
…y/CHAD-14121-sensor-sensitivity-fix

Matter Sensor: add BooleanStateConfiguration in embedded cluster utils
  • Loading branch information
ctowns authored Oct 14, 2024
2 parents b40e398 + a2472cb commit 05a4ed3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions drivers/SmartThings/matter-sensor/src/embedded-cluster-utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ end

local embedded_cluster_utils = {}

local embedded_clusters = {
local embedded_clusters_api_10 = {
[clusters.AirQuality.ID] = clusters.AirQuality,
[clusters.CarbonMonoxideConcentrationMeasurement.ID] = clusters.CarbonMonoxideConcentrationMeasurement,
[clusters.CarbonDioxideConcentrationMeasurement.ID] = clusters.CarbonDioxideConcentrationMeasurement,
Expand All @@ -39,11 +39,16 @@ local embedded_clusters = {
[clusters.SmokeCoAlarm.ID] = clusters.SmokeCoAlarm,
}

local embedded_clusters_api_11 = {
[clusters.BooleanStateConfiguration.ID] = clusters.BooleanStateConfiguration
}

function embedded_cluster_utils.get_endpoints(device, cluster_id, opts)
-- If using older lua libs and need to check for an embedded cluster feature,
-- we must use the embedded cluster definitions here
if version.api < 10 and embedded_clusters[cluster_id] ~= nil then
local embedded_cluster = embedded_clusters[cluster_id]
if version.api < 10 and embedded_clusters_api_10[cluster_id] ~= nil or
version.api < 11 and embedded_clusters_api_11[cluster_id] ~= nil then
local embedded_cluster = embedded_clusters_api_10[cluster_id] or embedded_clusters_api_11[cluster_id]
local opts = opts or {}
if utils.table_size(opts) > 1 then
device.log.warn_with({hub_logs = true}, "Invalid options for get_endpoints")
Expand Down

0 comments on commit 05a4ed3

Please sign in to comment.