Skip to content

Commit

Permalink
fixup! Utilize AttributeList in matter-thermo profile selection
Browse files Browse the repository at this point in the history
  • Loading branch information
cjswedes committed Oct 24, 2023
1 parent 7c876f1 commit 8180329
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/SmartThings/matter-thermostat/src/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ local function attr_list_handler(driver, device, ib, response)
for _, attr_id in ipairs (ib.data.elements or {}) do
if attr_id.value == clusters.Thermostat.attributes.ThermostatRunningState.ID then
local new_profile = string.gsub(device:get_field("profile_name"), "-nostate", "")
device:set_field("profile_name", new_profile)
device.log.info(string.format("Updating device profile to %s.", new_profile))
device:try_update_metadata({ profile = new_profile })
return
Expand Down

0 comments on commit 8180329

Please sign in to comment.