Skip to content

Commit 659608d

Browse files
committed
Fix addProperty macro, again
1 parent ba5faf4 commit 659608d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/ArduinoCloudV2.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ class ArduinoCloudClass {
2424

2525
int connected();
2626

27-
template<typename T> void addProperty(T property, permissionType _permission = READWRITE, long seconds = ON_CHANGE, void(*fn)(void) = NULL) {
28-
Thing.addProperty(property).publishEvery(seconds).setPermission(_permission).onUpdate(fn);
27+
#define addProperty( v, ...) addPropertyReal(v, #v, __VA_ARGS__)
28+
29+
template<typename T> void addPropertyReal(T property, String name, permissionType _permission = READWRITE, long seconds = ON_CHANGE, void(*fn)(void) = NULL) {
30+
Thing.addPropertyReal(property, name).publishEvery(seconds).setPermission(_permission).onUpdate(fn);
2931
}
3032

3133
protected:

0 commit comments

Comments
 (0)