Skip to content

Commit 5067fa9

Browse files
ilcatoaentinger
authored andcommitted
Manage the SWI attribute on behalf of the widget
1 parent d2153d3 commit 5067fa9

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

types/automation/CloudColoredLight.h

+7-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,13 @@ class CloudColoredLight : public CloudColor {
8686
appendAttribute(_value.swi);
8787
appendAttribute(_value.hue);
8888
appendAttribute(_value.sat);
89-
appendAttribute(_value.bri);
89+
// To allow visualization through color widget
90+
if (_value.swi) {
91+
appendAttribute(_value.bri);
92+
} else {
93+
float bri = 0;
94+
appendAttributeReal(bri, getAttributeName(".bri", '.'), encoder);
95+
}
9096
}
9197
virtual void setAttributesFromCloud() {
9298
setAttribute(_cloud_value.swi);

types/automation/CloudDimmeredLight.h

+1-4
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,7 @@ class CloudDimmeredLight : public CloudColoredLight {
3939
bool getSwitch() {
4040
return _value.swi;
4141
}
42-
virtual void appendAttributesToCloud() {
43-
appendAttribute(_value.swi);
44-
appendAttribute(_value.bri);
45-
}
42+
4643
virtual void setAttributesFromCloud() {
4744
setAttribute(_cloud_value.swi);
4845
setAttribute(_cloud_value.bri);

0 commit comments

Comments
 (0)