@@ -59,6 +59,7 @@ local subscribed_attributes = {
5959 clusters .RvcCleanMode .attributes .CurrentMode
6060 },
6161 [capabilities .robotCleanerOperatingState .ID ] = {
62+ clusters .RvcOperationalState .attributes .OperationalStateList ,
6263 clusters .RvcOperationalState .attributes .OperationalState ,
6364 clusters .RvcOperationalState .attributes .OperationalError
6465 },
@@ -367,6 +368,18 @@ local function rvc_operational_error_attr_handler(driver, device, ib, response)
367368 end
368369end
369370
371+ local function rvc_operational_state_list_attr_handler (driver , device , ib , response )
372+ local supportedOperatingState = {}
373+ for _ , state in ipairs (ib .data .elements ) do
374+ if OPERATING_STATE_MAP [state .elements .operational_state_id .value ] ~= nil then
375+ table.insert (supportedOperatingState , OPERATING_STATE_MAP [state .elements .operational_state_id .value ].NAME )
376+ end
377+ end
378+ device :emit_event_for_endpoint (ib .endpoint_id , capabilities .robotCleanerOperatingState .supportedOperatingStates (
379+ supportedOperatingState , {visibility = {displayed = false }}
380+ ))
381+ end
382+
370383local function handle_rvc_operational_state_accepted_command_list (driver , device , ib , response )
371384 device .log .info (" handle_rvc_operational_state_accepted_command_list" )
372385 local OP_COMMAND_MAP = {
@@ -599,6 +612,7 @@ local matter_rvc_driver = {
599612 [clusters .RvcCleanMode .attributes .CurrentMode .ID ] = clean_mode_current_mode_handler ,
600613 },
601614 [clusters .RvcOperationalState .ID ] = {
615+ [clusters .RvcOperationalState .attributes .OperationalStateList .ID ] = rvc_operational_state_list_attr_handler ,
602616 [clusters .RvcOperationalState .attributes .OperationalState .ID ] = rvc_operational_state_attr_handler ,
603617 [clusters .RvcOperationalState .attributes .OperationalError .ID ] = rvc_operational_error_attr_handler ,
604618 [clusters .RvcOperationalState .attributes .AcceptedCommandList .ID ] = handle_rvc_operational_state_accepted_command_list ,
0 commit comments