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

Added Additional Conditional Formatting #287

Merged
merged 3 commits into from
Apr 20, 2023
Merged
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
72 changes: 56 additions & 16 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
"footerDisplay": "",
"customUi": false,
"schema": {
"name": {
"type": "string",
"title": "Name",
"required": true,
"default": "Tuya"
},
"type": "object",
"properties": {
"name": {
"type": "string",
"title": "Name",
"required": true,
"default": "Tuya"
},
"options": {
"title": "Project Info",
"type": "object",
Expand Down Expand Up @@ -125,12 +125,18 @@
"category": {
"title": "Category",
"description": "Category Code or `hidden`",
"type": "string"
"type": "string",
"condition": {
"functionBody": "return (model.options && model.options.deviceOverrides);"
}
},
"unbridged": {
"title": "Unbridge",
"description": "Would you like to make this device be an external device?",
"type": "boolean"
"type": "boolean",
"condition": {
"functionBody": "return (model.options && model.options.deviceOverrides);"
}
},
"schema": {
"title": "Schema Overriding Configs",
Expand All @@ -141,11 +147,17 @@
"code": {
"title": "DP Code",
"type": "string",
"required": true
"required": true,
"condition": {
"functionBody": "return (model.options && model.options.deviceOverrides);"
}
},
"newCode": {
"title": "New DP Code",
"type": "string"
"type": "string",
"condition": {
"functionBody": "return (model.options && model.options.deviceOverrides && model.options.deviceOverrides[arrayIndices[0]].schema && model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].code && !model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].hidden);"
}
},
"type": {
"title": "New DP Type",
Expand Down Expand Up @@ -188,43 +200,70 @@
"Raw"
]
}
]
],
"condition": {
"functionBody": "return (model.options && model.options.deviceOverrides && model.options.deviceOverrides[arrayIndices[0]].schema && model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].code && !model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].hidden);"
}
},
"property": {
"title": "New DP Property",
"type": "object",
"properties": {
"min": {
"title": "min",
"type": "integer"
"type": "integer",
"condition": {
"functionBody": "return (model.options && model.options.deviceOverrides && model.options.deviceOverrides[arrayIndices[0]].schema && model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].type === 'Integer' && !model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].hidden);"
}
},
"max": {
"title": "max",
"type": "integer"
"type": "integer",
"condition": {
"functionBody": "return (model.options && model.options.deviceOverrides && model.options.deviceOverrides[arrayIndices[0]].schema && model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].type === 'Integer' && !model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].hidden);"
}
},
"scale": {
"title": "scale",
"type": "integer"
"type": "integer",
"condition": {
"functionBody": "return (model.options && model.options.deviceOverrides && model.options.deviceOverrides[arrayIndices[0]].schema && model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].type === 'Integer' && !model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].hidden);"
}
},
"step": {
"title": "step",
"type": "integer"
"type": "integer",
"condition": {
"functionBody": "return (model.options && model.options.deviceOverrides && model.options.deviceOverrides[arrayIndices[0]].schema && model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].type === 'Integer' && !model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].hidden);"
}
},
"range": {
"title": "range",
"type": "array",
"items": {
"title": "value",
"type": "string"
},
"condition": {
"functionBody": "return (model.options && model.options.deviceOverrides && model.options.deviceOverrides[arrayIndices[0]].schema && model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].type === 'Enum' && !model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].hidden);"
}
}
},
"condition": {
"functionBody": "return (model.options && model.options.deviceOverrides && model.options.deviceOverrides[arrayIndices[0]].schema && model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].code && !model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].hidden);"
}
},
"hidden": {
"title": "Hidden",
"type": "boolean"
"type": "boolean",
"condition": {
"functionBody": "return (model.options && model.options.deviceOverrides);"
}
}
}
},
"condition": {
"functionBody": "return (model.options && model.options.deviceOverrides);"
}
}
}
Expand Down Expand Up @@ -340,6 +379,7 @@
},
{
"key": "options.deviceOverrides[].schema[].property",
"notitle": false,
"items": [
"options.deviceOverrides[].schema[].property.min",
"options.deviceOverrides[].schema[].property.max",
Expand Down