We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5e92f67 commit fccc594Copy full SHA for fccc594
ArduinoCloudThing.h
@@ -195,14 +195,15 @@ inline void ArduinoCloudProperty<char*>::appendValue(CborObject &cbor) {
195
cbor.set("s", property);
196
};
197
198
-#ifndef addProperty
199
-#define addProperty(prop) addPropertyReal(prop, #prop)
200
-#endif
+#define NAME_OF( v ) #v
201
202
class ArduinoCloudThing {
203
public:
204
ArduinoCloudThing();
205
void begin();
+ template <typename T> ArduinoCloudPropertyGeneric& addProperty(T property) {
+ return addPropertyReal(property, NAME_OF(property));
206
+ };
207
ArduinoCloudPropertyGeneric& addPropertyReal(int& property, String name);
208
ArduinoCloudPropertyGeneric& addPropertyReal(bool& property, String name);
209
ArduinoCloudPropertyGeneric& addPropertyReal(float& property, String name);
0 commit comments