Skip to content

Commit

Permalink
Merge pull request #1201 from SmartThingsCommunity/bugfix/thermostat-…
Browse files Browse the repository at this point in the history
…battery-check

Fix the battery check in matter-thermostat, look for feature map
  • Loading branch information
samadDotDev authored Feb 2, 2024
2 parents e2bd207 + 38a14eb commit df71c0a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion drivers/SmartThings/matter-thermostat/src/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ local function do_configure(driver, device)
local thermo_eps = device:get_endpoints(clusters.Thermostat.ID)
local fan_eps = device:get_endpoints(clusters.FanControl.ID)
local humidity_eps = device:get_endpoints(clusters.RelativeHumidityMeasurement.ID)
local battery_eps = device:get_endpoints(clusters.PowerSource.ID)
local battery_eps = device:get_endpoints(clusters.PowerSource.ID, {feature_bitmap = clusters.PowerSource.types.PowerSourceFeature.BATTERY})
local profile_name = "thermostat"
--Note: we have not encountered thermostats with multiple endpoints that support the Thermostat cluster
if #thermo_eps == 1 then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ local mock_device = test.mock_device.build_test_matter_device({
endpoint_id = 1,
clusters = {
{cluster_id = clusters.FanControl.ID, cluster_type = "SERVER"},
{cluster_id = clusters.PowerSource.ID, cluster_type = "SERVER"},
{cluster_id = clusters.PowerSource.ID, cluster_type = "SERVER", feature_map = clusters.PowerSource.types.PowerSourceFeature.BATTERY},
{
cluster_id = clusters.Thermostat.ID,
cluster_revision=5,
Expand Down Expand Up @@ -70,7 +70,7 @@ local mock_device_simple = test.mock_device.build_test_matter_device({
{
endpoint_id = 1,
clusters = {
{cluster_id = clusters.PowerSource.ID, cluster_type = "SERVER"},
{cluster_id = clusters.PowerSource.ID, cluster_type = "SERVER", feature_map = clusters.PowerSource.types.PowerSourceFeature.BATTERY},
{
cluster_id = clusters.Thermostat.ID,
cluster_revision=5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ local mock_device = test.mock_device.build_test_matter_device({
cluster_type="SERVER",
feature_map=35, -- Heat, Cool, and Auto features.
},
{cluster_id = clusters.PowerSource.ID, cluster_type = "SERVER"},
{cluster_id = clusters.PowerSource.ID, cluster_type = "SERVER", feature_map = clusters.PowerSource.types.PowerSourceFeature.BATTERY},
}
}
}
Expand Down

0 comments on commit df71c0a

Please sign in to comment.