Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Bug fix for when-then rules with action on boolean attribute

Rich Turner56e17b318c01
diff --git a/ui/component/or-rules/src/json-viewer/or-rule-action-attribute.ts b/ui/component/or-rules/src/json-viewer/or-rule-action-attribute.ts
index 03ed296f8..a856f23bc 100644
--- a/ui/component/or-rules/src/json-viewer/or-rule-action-attribute.ts
+++ b/ui/component/or-rules/src/json-viewer/or-rule-action-attribute.ts
@@ -105,7 +105,7 @@ export class OrRuleActionAttribute extends translate(i18next)(LitElement) {
idOptions.push(...this._assets!.map((asset) => [asset.id!, asset.name!] as [string, string]));
const asset = idValue && idValue !== "*" ? this._assets.find(a => a.id === idValue) : undefined;
- const descriptors = AssetModelUtil.getAttributeAndValueDescriptors(assetType, this.action.attributeName);
+ const descriptors = AssetModelUtil.getAttributeAndValueDescriptors(assetType, this.action.attributeName, asset && asset.attributes && this.action.attributeName ? asset.attributes[this.action.attributeName] : undefined);
// Only RW attributes can be used in actions
let attributes: [string, string][] = [];