From 8459605477b22976a6af2d71814dea7e322ef0c4 Mon Sep 17 00:00:00 2001 From: Cooper Towns Date: Tue, 9 Jul 2024 15:29:12 -0500 Subject: [PATCH] Matter Sensor: resubscribe on profile switch Resubscribe whenever there is a profile switch so that new attributes can be subscribed to if the new profile includes new capabilities. --- .../SmartThings/matter-sensor/src/smoke-co-alarm/init.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/SmartThings/matter-sensor/src/smoke-co-alarm/init.lua b/drivers/SmartThings/matter-sensor/src/smoke-co-alarm/init.lua index 5139cab624..015cb88be2 100644 --- a/drivers/SmartThings/matter-sensor/src/smoke-co-alarm/init.lua +++ b/drivers/SmartThings/matter-sensor/src/smoke-co-alarm/init.lua @@ -129,6 +129,11 @@ local function info_changed(self, device, event, args) end end end + + -- resubscribe to new attributes as needed if a profile switch occured + if device.profile.id ~= args.old_st_store.profile.id then + device:subscribe() + end end -- Matter Handlers --