Skip to content

Commit 388bea7

Browse files
committed
Update supportedCommands attribute
Signed-off-by: Hunsup Jung <[email protected]>
1 parent 57c5892 commit 388bea7

File tree

1 file changed

+10
-0
lines changed
  • drivers/SmartThings/matter-rvc/src

1 file changed

+10
-0
lines changed

drivers/SmartThings/matter-rvc/src/init.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@ local function do_configure(driver, device)
117117
device:send(clusters.RvcOperationalState.attributes.AcceptedCommandList:read())
118118
end
119119

120+
local function driver_switched(driver, device)
121+
match_profile(driver, device)
122+
device:set_field(SERVICE_AREA_PROFILED, true, { persist = true })
123+
device:send(clusters.RvcOperationalState.attributes.AcceptedCommandList:read())
124+
end
125+
120126
local function info_changed(driver, device, event, args)
121127
if device.profile.id ~= args.old_st_store.profile.id then
122128
device:subscribe()
@@ -392,6 +398,9 @@ local function handle_rvc_operational_state_accepted_command_list(driver, device
392398
table.insert(supportedOperatingStateCommands, OP_COMMAND_MAP[attr.value].NAME)
393399
end
394400
device:set_field(OPERATING_STATE_SUPPORTED_COMMANDS, supportedOperatingStateCommands, { persist = true })
401+
device:emit_event_for_endpoint(ib.endpoint_id, capabilities.robotCleanerOperatingState.supportedCommands(
402+
supportedOperatingStateCommands, {visibility = {displayed = false}}
403+
))
395404

396405
-- Get current run mode, current tag, current operating state
397406
local current_run_mode = device:get_field(CURRENT_RUN_MODE)
@@ -600,6 +609,7 @@ local matter_rvc_driver = {
600609
init = device_init,
601610
doConfigure = do_configure,
602611
infoChanged = info_changed,
612+
driverSwitched = driver_switched
603613
},
604614
matter_handlers = {
605615
attr = {

0 commit comments

Comments
 (0)