Skip to content

Commit 7760396

Browse files
authored
Merge pull request #403 from pennam/publishOnChange_limit
Use DEFAULT_MIN_TIME_BETWEEN_UPDATES_MILLIS as default period for publishOnChange
2 parents 3d67134 + 349ae46 commit 7760396

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

extras/test/src/test_publishOnChange.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ SCENARIO("An Arduino cloud property is published on value change", "[ArduinoClou
2121
CloudInt test = 10;
2222
int const DELTA = 6;
2323

24-
addPropertyToContainer(property_container, test, "test", Permission::ReadWrite).publishOnChange(DELTA);
24+
addPropertyToContainer(property_container, test, "test", Permission::ReadWrite).publishOnChange(DELTA,0);
2525

2626
WHEN("test = 10, delta = 6, the property is encoded for the 1st time") {
2727
THEN("The property should be encoded") {

src/property/Property.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class Property
143143
/* Composable configuration of the Property class */
144144
Property & onUpdate(UpdateCallbackFunc func);
145145
Property & onSync(OnSyncCallbackFunc func);
146-
Property & publishOnChange(float const min_delta_property, unsigned long const min_time_between_updates_millis = 0);
146+
Property & publishOnChange(float const min_delta_property, unsigned long const min_time_between_updates_millis = DEFAULT_MIN_TIME_BETWEEN_UPDATES_MILLIS);
147147
Property & publishEvery(unsigned long const seconds);
148148
Property & publishOnDemand();
149149
Property & encodeTimestamp();

0 commit comments

Comments
 (0)