Skip to content

Commit a89f2d1

Browse files
committed
Use CHECK_CBOR_MULTI in all multivalue properties
1 parent 6136b40 commit a89f2d1

File tree

6 files changed

+23
-23
lines changed

6 files changed

+23
-23
lines changed

src/property/types/CloudColor.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,9 @@ class CloudColor : public Property {
189189
_cloud_value = _value;
190190
}
191191
virtual CborError appendAttributesToCloud() {
192-
CHECK_CBOR(appendAttribute(_value.hue));
193-
CHECK_CBOR(appendAttribute(_value.sat));
194-
CHECK_CBOR(appendAttribute(_value.bri));
192+
CHECK_CBOR_MULTI(appendAttribute(_value.hue));
193+
CHECK_CBOR_MULTI(appendAttribute(_value.sat));
194+
CHECK_CBOR_MULTI(appendAttribute(_value.bri));
195195
return CborNoError;
196196
}
197197
virtual void setAttributesFromCloud() {

src/property/types/CloudLocation.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ class CloudLocation : public Property {
9090
_cloud_value = _value;
9191
}
9292
virtual CborError appendAttributesToCloud() {
93-
CHECK_CBOR(appendAttribute(_value.lat));
94-
CHECK_CBOR(appendAttribute(_value.lon));
93+
CHECK_CBOR_MULTI(appendAttribute(_value.lat));
94+
CHECK_CBOR_MULTI(appendAttribute(_value.lon));
9595
return CborNoError;
9696
}
9797
virtual void setAttributesFromCloud() {

src/property/types/CloudSchedule.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -418,10 +418,10 @@ class CloudSchedule : public Property {
418418
_cloud_value = _value;
419419
}
420420
virtual CborError appendAttributesToCloud() {
421-
CHECK_CBOR(appendAttribute(_value.frm));
422-
CHECK_CBOR(appendAttribute(_value.to));
423-
CHECK_CBOR(appendAttribute(_value.len));
424-
CHECK_CBOR(appendAttribute(_value.msk));
421+
CHECK_CBOR_MULTI(appendAttribute(_value.frm));
422+
CHECK_CBOR_MULTI(appendAttribute(_value.to));
423+
CHECK_CBOR_MULTI(appendAttribute(_value.len));
424+
CHECK_CBOR_MULTI(appendAttribute(_value.msk));
425425
return CborNoError;
426426
}
427427
virtual void setAttributesFromCloud() {

src/property/types/automation/CloudColoredLight.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@ class CloudColoredLight : public CloudColor {
119119
_cloud_value = _value;
120120
}
121121
virtual CborError appendAttributesToCloud() {
122-
CHECK_CBOR(appendAttribute(_value.swi));
123-
CHECK_CBOR(appendAttribute(_value.hue));
124-
CHECK_CBOR(appendAttribute(_value.sat));
125-
CHECK_CBOR(appendAttribute(_value.bri));
122+
CHECK_CBOR_MULTI(appendAttribute(_value.swi));
123+
CHECK_CBOR_MULTI(appendAttribute(_value.hue));
124+
CHECK_CBOR_MULTI(appendAttribute(_value.sat));
125+
CHECK_CBOR_MULTI(appendAttribute(_value.bri));
126126
return CborNoError;
127127
}
128128
virtual void setAttributesFromCloud() {

src/property/types/automation/CloudDimmedLight.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,14 @@ class CloudDimmedLight : public Property {
9999
}
100100

101101
virtual CborError appendAttributesToCloud() {
102-
appendAttribute(_value.swi);
102+
CHECK_CBOR_MULTI(appendAttribute(_value.swi));
103103
// To allow visualization through color widget
104104
// Start
105105
float hue = 0;
106106
float sat = 0;
107-
CHECK_CBOR(appendAttributeReal(hue, getAttributeName(".hue", '.'), encoder));
108-
CHECK_CBOR(appendAttributeReal(sat, getAttributeName(".sat", '.'), encoder));
109-
CHECK_CBOR(appendAttribute(_value.bri));
107+
CHECK_CBOR_MULTI(appendAttributeReal(hue, getAttributeName(".hue", '.'), encoder));
108+
CHECK_CBOR_MULTI(appendAttributeReal(sat, getAttributeName(".sat", '.'), encoder));
109+
CHECK_CBOR_MULTI(appendAttribute(_value.bri));
110110
// should be only:
111111
// appendAttribute(_value.bri);
112112
// end

src/property/types/automation/CloudTelevision.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,12 @@ class CloudTelevision : public Property {
214214
_cloud_value = _value;
215215
}
216216
virtual CborError appendAttributesToCloud() {
217-
CHECK_CBOR(appendAttribute(_value.swi));
218-
CHECK_CBOR(appendAttribute(_value.vol));
219-
CHECK_CBOR(appendAttribute(_value.mut));
220-
CHECK_CBOR(appendAttribute((int)_value.pbc));
221-
CHECK_CBOR(appendAttribute((int)_value.inp));
222-
CHECK_CBOR(appendAttribute(_value.cha));
217+
CHECK_CBOR_MULTI(appendAttribute(_value.swi));
218+
CHECK_CBOR_MULTI(appendAttribute(_value.vol));
219+
CHECK_CBOR_MULTI(appendAttribute(_value.mut));
220+
CHECK_CBOR_MULTI(appendAttribute((int)_value.pbc));
221+
CHECK_CBOR_MULTI(appendAttribute((int)_value.inp));
222+
CHECK_CBOR_MULTI(appendAttribute(_value.cha));
223223
return CborNoError;
224224
}
225225
virtual void setAttributesFromCloud() {

0 commit comments

Comments
 (0)