Skip to content

Use DEFAULT_MIN_TIME_BETWEEN_UPDATES_MILLIS as default period for publishOnChange #403

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion extras/test/src/test_publishOnChange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ SCENARIO("An Arduino cloud property is published on value change", "[ArduinoClou
CloudInt test = 10;
int const DELTA = 6;

addPropertyToContainer(property_container, test, "test", Permission::ReadWrite).publishOnChange(DELTA);
addPropertyToContainer(property_container, test, "test", Permission::ReadWrite).publishOnChange(DELTA,0);

WHEN("test = 10, delta = 6, the property is encoded for the 1st time") {
THEN("The property should be encoded") {
Expand Down
2 changes: 1 addition & 1 deletion src/property/Property.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class Property
/* Composable configuration of the Property class */
Property & onUpdate(UpdateCallbackFunc func);
Property & onSync(OnSyncCallbackFunc func);
Property & publishOnChange(float const min_delta_property, unsigned long const min_time_between_updates_millis = 0);
Property & publishOnChange(float const min_delta_property, unsigned long const min_time_between_updates_millis = DEFAULT_MIN_TIME_BETWEEN_UPDATES_MILLIS);
Property & publishEvery(unsigned long const seconds);
Property & publishOnDemand();
Property & encodeTimestamp();
Expand Down