Skip to content

Commit 55d7ee8

Browse files
committed
Rename appendAttributeReal to appendAttribute
1 parent f123166 commit 55d7ee8

18 files changed

+43
-43
lines changed

src/property/Property.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ CborError Property::append(CborEncoder *encoder, bool lightPayload) {
185185
return CborNoError;
186186
}
187187

188-
CborError Property::appendAttributeReal(bool value, String attributeName, CborEncoder *encoder) {
188+
CborError Property::appendAttribute(bool value, String attributeName, CborEncoder *encoder) {
189189
return appendAttributeName(attributeName, [value](CborEncoder & mapEncoder)
190190
{
191191
CHECK_CBOR(cbor_encode_int(&mapEncoder, static_cast<int>(CborIntegerMapKey::BooleanValue)));
@@ -194,7 +194,7 @@ CborError Property::appendAttributeReal(bool value, String attributeName, CborEn
194194
}, encoder);
195195
}
196196

197-
CborError Property::appendAttributeReal(int value, String attributeName, CborEncoder *encoder) {
197+
CborError Property::appendAttribute(int value, String attributeName, CborEncoder *encoder) {
198198
return appendAttributeName(attributeName, [value](CborEncoder & mapEncoder)
199199
{
200200
CHECK_CBOR(cbor_encode_int(&mapEncoder, static_cast<int>(CborIntegerMapKey::Value)));
@@ -203,7 +203,7 @@ CborError Property::appendAttributeReal(int value, String attributeName, CborEnc
203203
}, encoder);
204204
}
205205

206-
CborError Property::appendAttributeReal(unsigned int value, String attributeName, CborEncoder *encoder) {
206+
CborError Property::appendAttribute(unsigned int value, String attributeName, CborEncoder *encoder) {
207207
return appendAttributeName(attributeName, [value](CborEncoder & mapEncoder)
208208
{
209209
CHECK_CBOR(cbor_encode_int(&mapEncoder, static_cast<int>(CborIntegerMapKey::Value)));
@@ -212,7 +212,7 @@ CborError Property::appendAttributeReal(unsigned int value, String attributeName
212212
}, encoder);
213213
}
214214

215-
CborError Property::appendAttributeReal(float value, String attributeName, CborEncoder *encoder) {
215+
CborError Property::appendAttribute(float value, String attributeName, CborEncoder *encoder) {
216216
return appendAttributeName(attributeName, [value](CborEncoder & mapEncoder)
217217
{
218218
CHECK_CBOR(cbor_encode_int(&mapEncoder, static_cast<int>(CborIntegerMapKey::Value)));
@@ -221,7 +221,7 @@ CborError Property::appendAttributeReal(float value, String attributeName, CborE
221221
}, encoder);
222222
}
223223

224-
CborError Property::appendAttributeReal(String value, String attributeName, CborEncoder *encoder) {
224+
CborError Property::appendAttribute(String value, String attributeName, CborEncoder *encoder) {
225225
return appendAttributeName(attributeName, [value](CborEncoder & mapEncoder)
226226
{
227227
CHECK_CBOR(cbor_encode_int(&mapEncoder, static_cast<int>(CborIntegerMapKey::StringValue)));

src/property/Property.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,11 @@ class Property
186186

187187
void updateLocalTimestamp();
188188
CborError append(CborEncoder * encoder, bool lightPayload);
189-
CborError appendAttributeReal(bool value, String attributeName = "", CborEncoder *encoder = nullptr);
190-
CborError appendAttributeReal(int value, String attributeName = "", CborEncoder *encoder = nullptr);
191-
CborError appendAttributeReal(unsigned int value, String attributeName = "", CborEncoder *encoder = nullptr);
192-
CborError appendAttributeReal(float value, String attributeName = "", CborEncoder *encoder = nullptr);
193-
CborError appendAttributeReal(String value, String attributeName = "", CborEncoder *encoder = nullptr);
189+
CborError appendAttribute(bool value, String attributeName = "", CborEncoder *encoder = nullptr);
190+
CborError appendAttribute(int value, String attributeName = "", CborEncoder *encoder = nullptr);
191+
CborError appendAttribute(unsigned int value, String attributeName = "", CborEncoder *encoder = nullptr);
192+
CborError appendAttribute(float value, String attributeName = "", CborEncoder *encoder = nullptr);
193+
CborError appendAttribute(String value, String attributeName = "", CborEncoder *encoder = nullptr);
194194
#ifndef __AVR__
195195
CborError appendAttributeName(String attributeName, std::function<CborError (CborEncoder& mapEncoder)>f, CborEncoder *encoder);
196196
void setAttributeReal(String attributeName, std::function<void (CborMapData & md)>setValue);

src/property/types/CloudBool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class CloudBool : public Property {
5353
_cloud_value = _value;
5454
}
5555
virtual CborError appendAttributesToCloud(CborEncoder *encoder) {
56-
return appendAttributeReal(_value, "", encoder);
56+
return appendAttribute(_value, "", encoder);
5757
}
5858
virtual void setAttributesFromCloud() {
5959
setAttributeReal(_cloud_value, "");

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(CborEncoder *encoder) {
192-
CHECK_CBOR_MULTI(appendAttributeReal(_value.hue, "hue", encoder));
193-
CHECK_CBOR_MULTI(appendAttributeReal(_value.sat, "sat", encoder));
194-
CHECK_CBOR_MULTI(appendAttributeReal(_value.bri, "bri", encoder));
192+
CHECK_CBOR_MULTI(appendAttribute(_value.hue, "hue", encoder));
193+
CHECK_CBOR_MULTI(appendAttribute(_value.sat, "sat", encoder));
194+
CHECK_CBOR_MULTI(appendAttribute(_value.bri, "bri", encoder));
195195
return CborNoError;
196196
}
197197
virtual void setAttributesFromCloud() {

src/property/types/CloudFloat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class CloudFloat : public Property {
5555
_cloud_value = _value;
5656
}
5757
virtual CborError appendAttributesToCloud(CborEncoder *encoder) {
58-
return appendAttributeReal(_value, "", encoder);
58+
return appendAttribute(_value, "", encoder);
5959
}
6060
virtual void setAttributesFromCloud() {
6161
setAttributeReal(_cloud_value, "");

src/property/types/CloudInt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class CloudInt : public Property {
5353
_cloud_value = _value;
5454
}
5555
virtual CborError appendAttributesToCloud(CborEncoder *encoder) {
56-
return appendAttributeReal(_value, "", encoder);
56+
return appendAttribute(_value, "", encoder);
5757
}
5858
virtual void setAttributesFromCloud() {
5959
setAttributeReal(_cloud_value, "");

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(CborEncoder *encoder) {
93-
CHECK_CBOR_MULTI(appendAttributeReal(_value.lat, "lat", encoder));
94-
CHECK_CBOR_MULTI(appendAttributeReal(_value.lon, "lon", encoder));
93+
CHECK_CBOR_MULTI(appendAttribute(_value.lat, "lat", encoder));
94+
CHECK_CBOR_MULTI(appendAttribute(_value.lon, "lon", encoder));
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(CborEncoder *encoder) {
421-
CHECK_CBOR_MULTI(appendAttributeReal(_value.frm, "frm", encoder));
422-
CHECK_CBOR_MULTI(appendAttributeReal(_value.to, "to", encoder));
423-
CHECK_CBOR_MULTI(appendAttributeReal(_value.len, "len", encoder));
424-
CHECK_CBOR_MULTI(appendAttributeReal(_value.msk, "msk", encoder));
421+
CHECK_CBOR_MULTI(appendAttribute(_value.frm, "frm", encoder));
422+
CHECK_CBOR_MULTI(appendAttribute(_value.to, "to", encoder));
423+
CHECK_CBOR_MULTI(appendAttribute(_value.len, "len", encoder));
424+
CHECK_CBOR_MULTI(appendAttribute(_value.msk, "msk", encoder));
425425
return CborNoError;
426426
}
427427
virtual void setAttributesFromCloud() {

src/property/types/CloudString.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class CloudString : public Property {
5959
_cloud_value = _value;
6060
}
6161
virtual CborError appendAttributesToCloud(CborEncoder *encoder) {
62-
return appendAttributeReal(_value, "", encoder);
62+
return appendAttribute(_value, "", encoder);
6363
}
6464
virtual void setAttributesFromCloud() {
6565
setAttributeReal(_cloud_value, "");

src/property/types/CloudUnsignedInt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class CloudUnsignedInt : public Property {
5353
_cloud_value = _value;
5454
}
5555
virtual CborError appendAttributesToCloud(CborEncoder *encoder) {
56-
return appendAttributeReal(_value, "", encoder);
56+
return appendAttribute(_value, "", encoder);
5757
}
5858
virtual void setAttributesFromCloud() {
5959
setAttributeReal(_cloud_value, "");

src/property/types/CloudWrapperBool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class CloudWrapperBool : public CloudWrapperBase {
4646
_cloud_value = _primitive_value;
4747
}
4848
virtual CborError appendAttributesToCloud(CborEncoder *encoder) {
49-
return appendAttributeReal(_primitive_value, "", encoder);
49+
return appendAttribute(_primitive_value, "", encoder);
5050
}
5151
virtual void setAttributesFromCloud() {
5252
setAttributeReal(_cloud_value, "");

src/property/types/CloudWrapperFloat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class CloudWrapperFloat : public CloudWrapperBase {
4848
_cloud_value = _primitive_value;
4949
}
5050
virtual CborError appendAttributesToCloud(CborEncoder *encoder) {
51-
return appendAttributeReal(_primitive_value, "", encoder);
51+
return appendAttribute(_primitive_value, "", encoder);
5252
}
5353
virtual void setAttributesFromCloud() {
5454
setAttributeReal(_cloud_value, "");

src/property/types/CloudWrapperInt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class CloudWrapperInt : public CloudWrapperBase {
4646
_cloud_value = _primitive_value;
4747
}
4848
virtual CborError appendAttributesToCloud(CborEncoder *encoder) {
49-
return appendAttributeReal(_primitive_value, "", encoder);
49+
return appendAttribute(_primitive_value, "", encoder);
5050
}
5151
virtual void setAttributesFromCloud() {
5252
setAttributeReal(_cloud_value, "");

src/property/types/CloudWrapperString.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class CloudWrapperString : public CloudWrapperBase {
5050
_cloud_value = _primitive_value;
5151
}
5252
virtual CborError appendAttributesToCloud(CborEncoder *encoder) {
53-
return appendAttributeReal(_primitive_value, "", encoder);
53+
return appendAttribute(_primitive_value, "", encoder);
5454
}
5555
virtual void setAttributesFromCloud() {
5656
setAttributeReal(_cloud_value, "");

src/property/types/CloudWrapperUnsignedInt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class CloudWrapperUnsignedInt : public CloudWrapperBase {
4646
_cloud_value = _primitive_value;
4747
}
4848
virtual CborError appendAttributesToCloud(CborEncoder *encoder) {
49-
return appendAttributeReal(_primitive_value, "", encoder);
49+
return appendAttribute(_primitive_value, "", encoder);
5050
}
5151
virtual void setAttributesFromCloud() {
5252
setAttributeReal(_cloud_value, "");

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(CborEncoder *encoder) {
122-
CHECK_CBOR_MULTI(appendAttributeReal(_value.swi, "swi", encoder));
123-
CHECK_CBOR_MULTI(appendAttributeReal(_value.hue, "hue", encoder));
124-
CHECK_CBOR_MULTI(appendAttributeReal(_value.sat, "sat", encoder));
125-
CHECK_CBOR_MULTI(appendAttributeReal(_value.bri, "bri", encoder));
122+
CHECK_CBOR_MULTI(appendAttribute(_value.swi, "swi", encoder));
123+
CHECK_CBOR_MULTI(appendAttribute(_value.hue, "hue", encoder));
124+
CHECK_CBOR_MULTI(appendAttribute(_value.sat, "sat", encoder));
125+
CHECK_CBOR_MULTI(appendAttribute(_value.bri, "bri", encoder));
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(CborEncoder *encoder) {
102-
CHECK_CBOR_MULTI(appendAttributeReal(_value.swi, "swi", encoder));
102+
CHECK_CBOR_MULTI(appendAttribute(_value.swi, "swi", encoder));
103103
// To allow visualization through color widget
104104
// Start
105105
float hue = 0;
106106
float sat = 0;
107-
CHECK_CBOR_MULTI(appendAttributeReal(hue, "hue", encoder));
108-
CHECK_CBOR_MULTI(appendAttributeReal(sat, "sat", encoder));
109-
CHECK_CBOR_MULTI(appendAttributeReal(_value.bri, "bri", encoder));
107+
CHECK_CBOR_MULTI(appendAttribute(hue, "hue", encoder));
108+
CHECK_CBOR_MULTI(appendAttribute(sat, "sat", encoder));
109+
CHECK_CBOR_MULTI(appendAttribute(_value.bri, "bri", encoder));
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(CborEncoder *encoder) {
217-
CHECK_CBOR_MULTI(appendAttributeReal(_value.swi, "swi", encoder));
218-
CHECK_CBOR_MULTI(appendAttributeReal(_value.vol, "vol", encoder));
219-
CHECK_CBOR_MULTI(appendAttributeReal(_value.mut, "mut", encoder));
220-
CHECK_CBOR_MULTI(appendAttributeReal((int)_value.pbc, "pbc", encoder));
221-
CHECK_CBOR_MULTI(appendAttributeReal((int)_value.inp, "inp", encoder));
222-
CHECK_CBOR_MULTI(appendAttributeReal(_value.cha, "cha", encoder));
217+
CHECK_CBOR_MULTI(appendAttribute(_value.swi, "swi", encoder));
218+
CHECK_CBOR_MULTI(appendAttribute(_value.vol, "vol", encoder));
219+
CHECK_CBOR_MULTI(appendAttribute(_value.mut, "mut", encoder));
220+
CHECK_CBOR_MULTI(appendAttribute((int)_value.pbc, "pbc", encoder));
221+
CHECK_CBOR_MULTI(appendAttribute((int)_value.inp, "inp", encoder));
222+
CHECK_CBOR_MULTI(appendAttribute(_value.cha, "cha", encoder));
223223
return CborNoError;
224224
}
225225
virtual void setAttributesFromCloud() {

0 commit comments

Comments
 (0)