Skip to content

Commit

Permalink
Merge pull request #555 from zigbee-alliance/#538-Add-CommissionerRem…
Browse files Browse the repository at this point in the history
…oteUiFlowUrl-field-into-Model-schema

#538 Add commissioner remote UI flow url field into model schema
  • Loading branch information
akarabashov authored Mar 26, 2024
2 parents b0304a0 + dfbbf38 commit 7f9ce72
Show file tree
Hide file tree
Showing 15 changed files with 460 additions and 151 deletions.
10 changes: 10 additions & 0 deletions docs/static/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8468,6 +8468,8 @@ paths:
schemaVersion:
type: integer
format: int64
commissionerRemoteUiFlowUrl:
type: string
pagination:
type: object
properties:
Expand Down Expand Up @@ -8693,6 +8695,8 @@ paths:
schemaVersion:
type: integer
format: int64
commissionerRemoteUiFlowUrl:
type: string
default:
description: An unexpected error response.
schema:
Expand Down Expand Up @@ -21186,6 +21190,8 @@ definitions:
schemaVersion:
type: integer
format: int64
commissionerRemoteUiFlowUrl:
type: string
zigbeealliance.distributedcomplianceledger.model.ModelVersion:
type: object
properties:
Expand Down Expand Up @@ -21308,6 +21314,8 @@ definitions:
schemaVersion:
type: integer
format: int64
commissionerRemoteUiFlowUrl:
type: string
pagination:
type: object
properties:
Expand Down Expand Up @@ -21385,6 +21393,8 @@ definitions:
schemaVersion:
type: integer
format: int64
commissionerRemoteUiFlowUrl:
type: string
zigbeealliance.distributedcomplianceledger.model.QueryGetModelVersionResponse:
type: object
properties:
Expand Down
2 changes: 2 additions & 0 deletions docs/transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ Not all fields can be edited (see `EDIT_MODEL`).
- commissioningModeInitialStepsInstruction: `optional(string)` - commissioningModeInitialStepsInstruction SHALL contain text which relates to specific values of CommissioningModeInitialStepsHint. Certain values of CommissioningModeInitialStepsHint, as defined in the Pairing Hint Table, indicate a Pairing Instruction (PI) dependency, and for these values the commissioningModeInitialStepsInstruction SHALL be set
- commissioningModeSecondaryStepsHint: `optional(uint32)` - commissioningModeSecondaryStepsHint SHALL identify a hint for steps that can be used to put into commissioning mode a device that has already been commissioned. This field is a bitmap with values defined in the Pairing Hint Table. For example, a value of 4 (bit 2 is set) indicates that a device that has already been commissioned will require the user to visit a current CHIP Administrator to put the device into commissioning mode.
- commissioningModeSecondaryStepInstruction: `optional(string)` - commissioningModeSecondaryStepInstruction SHALL contain text which relates to specific values of commissioningModeSecondaryStepsHint. Certain values of commissioningModeSecondaryStepsHint, as defined in the Pairing Hint Table, indicate a Pairing Instruction (PI) dependency, and for these values the commissioningModeSecondaryStepInstruction SHALL be set
- commissionerRemoteUiFlowURL `optional(string)` - commissionerRemoteUiFlowURL SHALL identify URL to show a custom flow UI for the commissioner
- userManualURL: `optional(string)` - URL that contains product specific web page that contains user manual for the device model.
- supportURL: `optional(string)` - URL that contains product specific web page that contains support details for the device model.
- productURL: `optional(string)` - URL that contains product specific web page that contains details for the device model.
Expand Down Expand Up @@ -253,6 +254,7 @@ All non-edited fields remain the same.
- commissioningCustomFlowURL: `optional(string)` - commissioningCustomFlowURL SHALL identify a vendor specific commissioning URL for the device model when the commissioningCustomFlow field is set to '2'
- commissioningModeInitialStepsInstruction: `optional(string)` - commissioningModeInitialStepsInstruction SHALL contain text which relates to specific values of CommissioningModeInitialStepsHint. Certain values of CommissioningModeInitialStepsHint, as defined in the Pairing Hint Table, indicate a Pairing Instruction (PI) dependency, and for these values the commissioningModeInitialStepsInstruction SHALL be set
- commissioningModeSecondaryStepInstruction: `optional(string)` - commissioningModeSecondaryStepInstruction SHALL contain text which relates to specific values of commissioningModeSecondaryStepsHint. Certain values of commissioningModeSecondaryStepsHint, as defined in the Pairing Hint Table, indicate a Pairing Instruction (PI) dependency, and for these values the commissioningModeSecondaryStepInstruction SHALL be set
- commissionerRemoteUiFlowURL `optional(string)` - commissionerRemoteUiFlowURL SHALL identify URL to show a custom flow UI for the commissioner
- userManualURL: `optional(string)` - URL that contains product specific web page that contains user manual for the device model.
- supportURL: `optional(string)` - URL that contains product specific web page that contains support details for the device model.
- productURL: `optional(string)` - URL that contains product specific web page that contains details for the device model.
Expand Down
10 changes: 7 additions & 3 deletions integration_tests/cli/model-demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ test_divider
productLabel="Device #1"
schema_version_0=0
schema_version_2=2
commissionerRemoteUiFlowURL="https://commissionerRemoteUiFlowURL.dclmodel"
echo "Add Model with VID: $vid PID: $pid"
result=$(echo "test1234" | dcld tx model add-model --vid=$vid --pid=$pid --deviceTypeID=1 --productName=TestProduct --productLabel="$productLabel" --partNumber=1 --commissioningCustomFlow=0 --schemaVersion=$schema_version_2 --from=$vendor_account --yes)
result=$(echo "test1234" | dcld tx model add-model --vid=$vid --pid=$pid --deviceTypeID=1 --productName=TestProduct --productLabel="$productLabel" --partNumber=1 --commissioningCustomFlow=0 --commissionerRemoteUiFlowURL="$commissionerRemoteUiFlowURL" --schemaVersion=$schema_version_2 --from=$vendor_account --yes)
check_response "$result" "\"code\": 0"
echo "$result"

Expand All @@ -81,6 +82,7 @@ check_response "$result" "\"vid\": $vid"
check_response "$result" "\"pid\": $pid"
check_response "$result" "\"productLabel\": \"$productLabel\""
check_response "$result" "\"schemaVersion\": $schema_version_2"
check_response "$result" "\"commissionerRemoteUiFlowUrl\": \"$commissionerRemoteUiFlowURL\""
echo "$result"

echo "Get Model with VID: $vid_with_pids PID: $pid"
Expand Down Expand Up @@ -124,10 +126,11 @@ echo "$result"

test_divider

echo "Update Model with VID: ${vid} PID: ${pid} with new description"
echo "Update Model with VID: ${vid} PID: ${pid} with new description and commissionerRemoteUiFlowURL"
description="New Device Description"
schema_version_3=3
result=$(echo "test1234" | dcld tx model update-model --vid=$vid --pid=$pid --from $vendor_account --yes --productLabel "$description" --schemaVersion=$schema_version_3)
newCommissionerRemoteUiFlowURL="https://commissionerRemoteUiFlowURL.dclmodel.updated"
result=$(echo "test1234" | dcld tx model update-model --vid=$vid --pid=$pid --from $vendor_account --yes --productLabel "$description" --schemaVersion=$schema_version_3 --commissionerRemoteUiFlowURL="$newCommissionerRemoteUiFlowURL")
check_response "$result" "\"code\": 0"
echo "$result"

Expand All @@ -146,6 +149,7 @@ check_response "$result" "\"vid\": $vid"
check_response "$result" "\"pid\": $pid"
check_response "$result" "\"productLabel\": \"$description\""
check_response "$result" "\"schemaVersion\": $schema_version_3"
check_response "$result" "\"commissionerRemoteUiFlowUrl\": \"$newCommissionerRemoteUiFlowURL\""
echo "$result"

test_divider
Expand Down
1 change: 1 addition & 0 deletions proto/model/model.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ message Model {
int32 lsfRevision = 17;
string creator = 18 [(cosmos_proto.scalar) = "cosmos.AddressString"];
uint32 schemaVersion = 19;
string commissionerRemoteUiFlowUrl = 20;
}

2 changes: 2 additions & 0 deletions proto/model/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ message MsgCreateModel {
string productUrl = 16 [(gogoproto.moretags) = "validate:\"omitempty,url,startsnotwith=http:,max=256\""];
string lsfUrl = 17 [(gogoproto.moretags) = "validate:\"omitempty,url,startsnotwith=http:,max=256\""];
uint32 schemaVersion = 18 [(gogoproto.moretags) = "validate:\"gte=0,lte=65535\""];
string commissionerRemoteUiFlowUrl = 19 [(gogoproto.moretags) = "validate:\"omitempty,url,startsnotwith=http:,max=256\""];
}
message MsgCreateModelResponse {}

Expand All @@ -61,6 +62,7 @@ message MsgUpdateModel {
string lsfUrl = 13 [(gogoproto.moretags) = "validate:\"omitempty,url,startsnotwith=http:,max=256\""];
int32 lsfRevision = 14 [(gogoproto.moretags) = "validate:\"gte=0,lte=65535\""];
uint32 schemaVersion = 15 [(gogoproto.moretags) = "validate:\"gte=0,lte=65535\""];
string commissionerRemoteUiFlowUrl = 16 [(gogoproto.moretags) = "validate:\"omitempty,url,startsnotwith=http:,max=256\""];
}
message MsgUpdateModelResponse {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export interface ModelModel {

/** @format int64 */
schemaVersion?: number;
commissionerRemoteUiFlowUrl?: string;
}

export interface ModelModelVersion {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface Model {
lsfRevision: number
creator: string
schemaVersion: number
commissionerRemoteUiFlowUrl: string
}

const baseModel: object = {
Expand All @@ -44,7 +45,8 @@ const baseModel: object = {
lsfUrl: '',
lsfRevision: 0,
creator: '',
schemaVersion: 0
schemaVersion: 0,
commissionerRemoteUiFlowUrl: ''
}

export const Model = {
Expand Down Expand Up @@ -106,6 +108,9 @@ export const Model = {
if (message.schemaVersion !== 0) {
writer.uint32(152).uint32(message.schemaVersion)
}
if (message.commissionerRemoteUiFlowUrl !== '') {
writer.uint32(162).string(message.commissionerRemoteUiFlowUrl)
}
return writer
},

Expand Down Expand Up @@ -173,6 +178,9 @@ export const Model = {
case 19:
message.schemaVersion = reader.uint32()
break
case 20:
message.commissionerRemoteUiFlowUrl = reader.string()
break
default:
reader.skipType(tag & 7)
break
Expand Down Expand Up @@ -278,6 +286,11 @@ export const Model = {
} else {
message.schemaVersion = 0
}
if (object.commissionerRemoteUiFlowUrl !== undefined && object.commissionerRemoteUiFlowUrl !== null) {
message.commissionerRemoteUiFlowUrl = String(object.commissionerRemoteUiFlowUrl)
} else {
message.commissionerRemoteUiFlowUrl = ''
}
return message
},

Expand All @@ -304,6 +317,7 @@ export const Model = {
message.lsfRevision !== undefined && (obj.lsfRevision = message.lsfRevision)
message.creator !== undefined && (obj.creator = message.creator)
message.schemaVersion !== undefined && (obj.schemaVersion = message.schemaVersion)
message.commissionerRemoteUiFlowUrl !== undefined && (obj.commissionerRemoteUiFlowUrl = message.commissionerRemoteUiFlowUrl)
return obj
},

Expand Down Expand Up @@ -404,6 +418,11 @@ export const Model = {
} else {
message.schemaVersion = 0
}
if (object.commissionerRemoteUiFlowUrl !== undefined && object.commissionerRemoteUiFlowUrl !== null) {
message.commissionerRemoteUiFlowUrl = object.commissionerRemoteUiFlowUrl
} else {
message.commissionerRemoteUiFlowUrl = ''
}
return message
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface MsgCreateModel {
productUrl: string
lsfUrl: string
schemaVersion: number
commissionerRemoteUiFlowUrl: string
}

export interface MsgCreateModelResponse {}
Expand All @@ -43,6 +44,7 @@ export interface MsgUpdateModel {
lsfUrl: string
lsfRevision: number
schemaVersion: number
commissionerRemoteUiFlowUrl: string
}

export interface MsgUpdateModelResponse {}
Expand Down Expand Up @@ -120,7 +122,8 @@ const baseMsgCreateModel: object = {
supportUrl: '',
productUrl: '',
lsfUrl: '',
schemaVersion: 0
schemaVersion: 0,
commissionerRemoteUiFlowUrl: ''
}

export const MsgCreateModel = {
Expand Down Expand Up @@ -179,6 +182,9 @@ export const MsgCreateModel = {
if (message.schemaVersion !== 0) {
writer.uint32(144).uint32(message.schemaVersion)
}
if (message.commissionerRemoteUiFlowUrl !== '') {
writer.uint32(154).string(message.commissionerRemoteUiFlowUrl)
}
return writer
},

Expand Down Expand Up @@ -243,6 +249,9 @@ export const MsgCreateModel = {
case 18:
message.schemaVersion = reader.uint32()
break
case 19:
message.commissionerRemoteUiFlowUrl = reader.string()
break
default:
reader.skipType(tag & 7)
break
Expand Down Expand Up @@ -343,6 +352,11 @@ export const MsgCreateModel = {
} else {
message.schemaVersion = 0
}
if (object.commissionerRemoteUiFlowUrl !== undefined && object.commissionerRemoteUiFlowUrl !== null) {
message.commissionerRemoteUiFlowUrl = String(object.commissionerRemoteUiFlowUrl)
} else {
message.commissionerRemoteUiFlowUrl = ''
}
return message
},

Expand All @@ -368,6 +382,7 @@ export const MsgCreateModel = {
message.productUrl !== undefined && (obj.productUrl = message.productUrl)
message.lsfUrl !== undefined && (obj.lsfUrl = message.lsfUrl)
message.schemaVersion !== undefined && (obj.schemaVersion = message.schemaVersion)
message.commissionerRemoteUiFlowUrl !== undefined && (obj.commissionerRemoteUiFlowUrl = message.commissionerRemoteUiFlowUrl)
return obj
},

Expand Down Expand Up @@ -463,6 +478,11 @@ export const MsgCreateModel = {
} else {
message.schemaVersion = 0
}
if (object.commissionerRemoteUiFlowUrl !== undefined && object.commissionerRemoteUiFlowUrl !== null) {
message.commissionerRemoteUiFlowUrl = object.commissionerRemoteUiFlowUrl
} else {
message.commissionerRemoteUiFlowUrl = ''
}
return message
}
}
Expand Down Expand Up @@ -520,7 +540,8 @@ const baseMsgUpdateModel: object = {
productUrl: '',
lsfUrl: '',
lsfRevision: 0,
schemaVersion: 0
schemaVersion: 0,
commissionerRemoteUiFlowUrl: ''
}

export const MsgUpdateModel = {
Expand Down Expand Up @@ -570,6 +591,9 @@ export const MsgUpdateModel = {
if (message.schemaVersion !== 0) {
writer.uint32(120).uint32(message.schemaVersion)
}
if (message.commissionerRemoteUiFlowUrl !== '') {
writer.uint32(130).string(message.commissionerRemoteUiFlowUrl)
}
return writer
},

Expand Down Expand Up @@ -625,6 +649,9 @@ export const MsgUpdateModel = {
case 15:
message.schemaVersion = reader.uint32()
break
case 16:
message.commissionerRemoteUiFlowUrl = reader.string()
break
default:
reader.skipType(tag & 7)
break
Expand Down Expand Up @@ -710,6 +737,11 @@ export const MsgUpdateModel = {
} else {
message.schemaVersion = 0
}
if (object.commissionerRemoteUiFlowUrl !== undefined && object.commissionerRemoteUiFlowUrl !== null) {
message.commissionerRemoteUiFlowUrl = String(object.commissionerRemoteUiFlowUrl)
} else {
message.commissionerRemoteUiFlowUrl = ''
}
return message
},

Expand All @@ -732,6 +764,7 @@ export const MsgUpdateModel = {
message.lsfUrl !== undefined && (obj.lsfUrl = message.lsfUrl)
message.lsfRevision !== undefined && (obj.lsfRevision = message.lsfRevision)
message.schemaVersion !== undefined && (obj.schemaVersion = message.schemaVersion)
message.commissionerRemoteUiFlowUrl !== undefined && (obj.commissionerRemoteUiFlowUrl = message.commissionerRemoteUiFlowUrl)
return obj
},

Expand Down Expand Up @@ -812,6 +845,11 @@ export const MsgUpdateModel = {
} else {
message.schemaVersion = 0
}
if (object.commissionerRemoteUiFlowUrl !== undefined && object.commissionerRemoteUiFlowUrl !== null) {
message.commissionerRemoteUiFlowUrl = object.commissionerRemoteUiFlowUrl
} else {
message.commissionerRemoteUiFlowUrl = ''
}
return message
}
}
Expand Down
1 change: 1 addition & 0 deletions x/model/client/cli/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const (
FlagCommissioningModeInitialStepsInstruction = "commissioningModeInitialStepsInstruction"
FlagCommissioningModeSecondaryStepsHint = "commissioningModeSecondaryStepsHint"
FlagCommissioningModeSecondaryStepsInstruction = "commissioningModeSecondaryStepsInstruction"
FlagCommissionerRemoteUIFlowURL = "commissionerRemoteUiFlowURL"
FlagUserManualURL = "userManualURL"
FlagSupportURL = "supportURL"
FlagProductURL = "productURL"
Expand Down
Loading

0 comments on commit 7f9ce72

Please sign in to comment.