Skip to content

Commit de7e25c

Browse files
committed
Rename appendAttributeReal to appendAttribute
1 parent 8a99b90 commit de7e25c

18 files changed

+43
-43
lines changed

Diff for: src/property/Property.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ CborError Property::append(CborEncoder *encoder, bool lightPayload) {
181181
return CborNoError;
182182
}
183183

184-
CborError Property::appendAttributeReal(bool value, String attributeName, CborEncoder *encoder) {
184+
CborError Property::appendAttribute(bool value, String attributeName, CborEncoder *encoder) {
185185
return appendAttributeName(attributeName, [value](CborEncoder & mapEncoder)
186186
{
187187
CHECK_CBOR(cbor_encode_int(&mapEncoder, static_cast<int>(CborIntegerMapKey::BooleanValue)));
@@ -190,7 +190,7 @@ CborError Property::appendAttributeReal(bool value, String attributeName, CborEn
190190
}, encoder);
191191
}
192192

193-
CborError Property::appendAttributeReal(int value, String attributeName, CborEncoder *encoder) {
193+
CborError Property::appendAttribute(int value, String attributeName, CborEncoder *encoder) {
194194
return appendAttributeName(attributeName, [value](CborEncoder & mapEncoder)
195195
{
196196
CHECK_CBOR(cbor_encode_int(&mapEncoder, static_cast<int>(CborIntegerMapKey::Value)));
@@ -199,7 +199,7 @@ CborError Property::appendAttributeReal(int value, String attributeName, CborEnc
199199
}, encoder);
200200
}
201201

202-
CborError Property::appendAttributeReal(unsigned int value, String attributeName, CborEncoder *encoder) {
202+
CborError Property::appendAttribute(unsigned int value, String attributeName, CborEncoder *encoder) {
203203
return appendAttributeName(attributeName, [value](CborEncoder & mapEncoder)
204204
{
205205
CHECK_CBOR(cbor_encode_int(&mapEncoder, static_cast<int>(CborIntegerMapKey::Value)));
@@ -208,7 +208,7 @@ CborError Property::appendAttributeReal(unsigned int value, String attributeName
208208
}, encoder);
209209
}
210210

211-
CborError Property::appendAttributeReal(float value, String attributeName, CborEncoder *encoder) {
211+
CborError Property::appendAttribute(float value, String attributeName, CborEncoder *encoder) {
212212
return appendAttributeName(attributeName, [value](CborEncoder & mapEncoder)
213213
{
214214
CHECK_CBOR(cbor_encode_int(&mapEncoder, static_cast<int>(CborIntegerMapKey::Value)));
@@ -217,7 +217,7 @@ CborError Property::appendAttributeReal(float value, String attributeName, CborE
217217
}, encoder);
218218
}
219219

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

Diff for: src/property/Property.h

+5-5
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);

Diff for: src/property/types/CloudBool.h

+1-1
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, "");

Diff for: src/property/types/CloudColor.h

+3-3
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() {

Diff for: src/property/types/CloudFloat.h

+1-1
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, "");

Diff for: src/property/types/CloudInt.h

+1-1
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, "");

Diff for: src/property/types/CloudLocation.h

+2-2
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() {

Diff for: src/property/types/CloudSchedule.h

+4-4
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() {

Diff for: src/property/types/CloudString.h

+1-1
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, "");

Diff for: src/property/types/CloudUnsignedInt.h

+1-1
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, "");

Diff for: src/property/types/CloudWrapperBool.h

+1-1
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, "");

Diff for: src/property/types/CloudWrapperFloat.h

+1-1
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, "");

Diff for: src/property/types/CloudWrapperInt.h

+1-1
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, "");

Diff for: src/property/types/CloudWrapperString.h

+1-1
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, "");

Diff for: src/property/types/CloudWrapperUnsignedInt.h

+1-1
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, "");

Diff for: src/property/types/automation/CloudColoredLight.h

+4-4
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() {

Diff for: src/property/types/automation/CloudDimmedLight.h

+4-4
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

Diff for: src/property/types/automation/CloudTelevision.h

+6-6
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)