File tree Expand file tree Collapse file tree 1 file changed +4
-14
lines changed
drivers/SmartThings/matter-thermostat/src Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -501,24 +501,14 @@ local function device_init(driver, device)
501
501
end
502
502
503
503
local function info_changed (driver , device , event , args )
504
- -- Note this is needed because device:subscribe() does not recalculate
505
- -- the subscribed attributes each time it is run, that only happens at init.
506
- -- This will change in the 0.48.x release of the lua libs.
507
- for cap_id , attributes in pairs (subscribed_attributes ) do
508
- if device :supports_capability_by_id (cap_id ) then
509
- for _ , attr in ipairs (attributes ) do
510
- device :add_subscribed_attribute (attr )
511
- end
512
- end
504
+ if device :get_field (SUPPORTED_COMPONENT_CAPABILITIES ) then
505
+ -- re-up subscription with new capabilities using the modular supports_capability override
506
+ device :extend_device (" supports_capability_by_id" , supports_capability_by_id_modular )
513
507
end
514
508
515
509
if device .profile .id ~= args .old_st_store .profile .id then
516
- if device :get_field (SUPPORTED_COMPONENT_CAPABILITIES ) then
517
- -- re-up subscription with new capabilities using the modular supports_capability override
518
- device :extend_device (" supports_capability_by_id" , supports_capability_by_id_modular )
519
- end
510
+ device :subscribe ()
520
511
end
521
- device :subscribe ()
522
512
schedule_polls_for_cumulative_energy_imported (device )
523
513
end
524
514
You can’t perform that action at this time.
0 commit comments