Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update supported mode for every operation #1803

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions drivers/SmartThings/matter-rvc/fingerprints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ matterManufacturer:
deviceLabel: Matter RVC
vendorId: 0x10e1
productId: 0x1025
deviceProfileName: rvc
deviceProfileName: rvc-clean-mode

matterGeneric:
- id: "matter/rvc"
deviceLabel: Matter RVC
deviceTypes:
- id: 0x0074
deviceProfileName: rvc
deviceProfileName: rvc-clean-mode
120 changes: 120 additions & 0 deletions drivers/SmartThings/matter-rvc/profiles/rvc-clean-mode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: rvc-clean-mode
components:
- id: main
label: Main
capabilities:
- id: robotCleanerOperatingState
version: 1
- id: firmwareUpdate
version: 1
- id: refresh
version: 1
categories:
- name: RobotCleaner
- id: runMode
label: Run mode
capabilities:
- id: mode
version: 1
categories:
- name: RobotCleaner
- id: cleanMode
label: Clean mode
capabilities:
- id: mode
version: 1
categories:
- name: RobotCleaner
deviceConfig:
dashboard:
states:
- component: main
capability: robotCleanerOperatingState
version: 1
detailView:
- component: main
capability: robotCleanerOperatingState
version: 1
- component: runMode
capability: mode
version: 1
patch:
- op: replace
path: /0/list/command/supportedValues
value: supportedArguments.value
- component: cleanMode
capability: mode
version: 1
patch:
- op: replace
path: /0/list/command/supportedValues
value: supportedArguments.value
- component: main
capability: refresh
version: 1
- component: main
capability: firmwareUpdate
version: 1
automation:
conditions:
- component: runMode
capability: mode
version: 1
patch:
- op: replace
path: /0/displayType
value: dynamicList
- op: add
path: /0/dynamicList
value:
value: mode.value
supportedValues:
value: supportedModes.value
- op: remove
path: /0/list
- component: cleanMode
capability: mode
version: 1
patch:
- op: replace
path: /0/displayType
value: dynamicList
- op: add
path: /0/dynamicList
value:
value: mode.value
supportedValues:
value: supportedModes.value
- op: remove
path: /0/list
actions:
- component: runMode
capability: mode
version: 1
patch:
- op: replace
path: /0/displayType
value: dynamicList
- op: add
path: /0/dynamicList
value:
command: setMode
supportedValues:
value: supportedModes.value
- op: remove
path: /0/list
- component: cleanMode
capability: mode
version: 1
patch:
- op: replace
path: /0/displayType
value: dynamicList
- op: add
path: /0/dynamicList
value:
command: setMode
supportedValues:
value: supportedModes.value
- op: remove
path: /0/list
66 changes: 56 additions & 10 deletions drivers/SmartThings/matter-rvc/profiles/rvc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,59 @@ components:
version: 1
categories:
- name: RobotCleaner
- id: cleanMode
label: Clean mode
capabilities:
- id: mode
version: 1
categories:
- name: RobotCleaner
metadata:
mnmn: SmartThingsEdge
vid: generic-rvc
deviceConfig:
dashboard:
states:
- component: main
capability: robotCleanerOperatingState
version: 1
detailView:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @HunsupJung I'm not super familiar with this profile handling. what is this supposed to be doing for the device card?

- component: main
capability: robotCleanerOperatingState
version: 1
- component: runMode
capability: mode
version: 1
patch:
- op: replace
path: /0/list/command/supportedValues
value: supportedArguments.value
- component: main
capability: refresh
version: 1
- component: main
capability: firmwareUpdate
version: 1
automation:
conditions:
- component: runMode
capability: mode
version: 1
patch:
- op: replace
path: /0/displayType
value: dynamicList
- op: add
path: /0/dynamicList
value:
value: mode.value
supportedValues:
value: supportedModes.value
- op: remove
path: /0/list
actions:
- component: runMode
capability: mode
version: 1
patch:
- op: replace
path: /0/displayType
value: dynamicList
- op: add
path: /0/dynamicList
value:
command: setMode
supportedValues:
value: supportedModes.value
- op: remove
path: /0/list
Original file line number Diff line number Diff line change
@@ -1,31 +1,6 @@
















local data_types = require "st.matter.data_types"
local UintABC = require "st.matter.data_types.base_defs.UintABC"










local ErrorStateEnum = {}
local new_mt = UintABC.new_mt({NAME = "ErrorStateEnum", ID = data_types.name_to_id_map["Uint8"]}, 1)
new_mt.__index.pretty_print = function(self)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,6 @@
















local data_types = require "st.matter.data_types"
local StructureABC = require "st.matter.data_types.base_defs.StructureABC"






local ErrorStateStruct = {}
local new_mt = StructureABC.new_mt({NAME = "ErrorStateStruct", ID = data_types.name_to_id_map["Structure"]})

Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,6 @@
















local data_types = require "st.matter.data_types"
local UintABC = require "st.matter.data_types.base_defs.UintABC"










local OperationalStateEnum = {}
local new_mt = UintABC.new_mt({NAME = "OperationalStateEnum", ID = data_types.name_to_id_map["Uint8"]}, 1)
new_mt.__index.pretty_print = function(self)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,6 @@
















local data_types = require "st.matter.data_types"
local StructureABC = require "st.matter.data_types.base_defs.StructureABC"





local OperationalStateStruct = {}
local new_mt = StructureABC.new_mt({NAME = "OperationalStateStruct", ID = data_types.name_to_id_map["Structure"]})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ end
setmetatable(RvcCleanModeClientCommands, command_mt)

return RvcCleanModeClientCommands

1 change: 0 additions & 1 deletion drivers/SmartThings/matter-rvc/src/RvcCleanMode/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,3 @@ setmetatable(RvcCleanMode.commands, command_helper_mt)
setmetatable(RvcCleanMode, {__index = cluster_base})

return RvcCleanMode

Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,3 @@ end

setmetatable(CurrentMode, {__call = CurrentMode.new_value, __index = CurrentMode.base_type})
return CurrentMode

Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,3 @@ end

setmetatable(SupportedModes, {__call = SupportedModes.new_value, __index = SupportedModes.base_type})
return SupportedModes

Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@ end
setmetatable(RvcCleanModeServerAttributes, attr_mt)

return RvcCleanModeServerAttributes

Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,3 @@ end
setmetatable(ChangeToMode, {__call = ChangeToMode.init})

return ChangeToMode

Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ end
setmetatable(RvcCleanModeServerCommands, command_mt)

return RvcCleanModeServerCommands

Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,3 @@ end
setmetatable(Feature, new_mt)

return Feature

Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,3 @@ end
setmetatable(ModeOptionStruct, new_mt)

return ModeOptionStruct

Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@ end
setmetatable(ModeTag, new_mt)

return ModeTag

Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,3 @@ end
setmetatable(ModeTagStruct, new_mt)

return ModeTagStruct

Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ end
setmetatable(StatusCode, new_mt)

return StatusCode

Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ local RvcCleanModeTypes = {}
setmetatable(RvcCleanModeTypes, types_mt)

return RvcCleanModeTypes

Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,3 @@ setmetatable(RvcOperationalState.events, event_helper_mt)
setmetatable(RvcOperationalState, {__index = cluster_base})

return RvcOperationalState

Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,3 @@ end

setmetatable(OperationalError, {__call = OperationalError.new_value, __index = OperationalError.base_type})
return OperationalError

Loading
Loading