Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d498b6d

Browse files
authoredApr 13, 2020
Fix string property change notifications. (#111)
Fixes #2479
1 parent da5886f commit d498b6d

File tree

6 files changed

+14
-3
lines changed

6 files changed

+14
-3
lines changed
 

‎Thing.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,11 @@ class ThingItem {
226226
this->hasChanged = true;
227227
}
228228

229+
void setValue(const char *s) {
230+
*(this->getValue().string) = s;
231+
this->hasChanged = true;
232+
}
233+
229234
/**
230235
* Returns the property value if it has been changed via {@link setValue}
231236
* since the last call or returns a nullptr.
@@ -603,7 +608,7 @@ class ThingDevice {
603608
break;
604609
}
605610
case STRING:
606-
*(property->getValue().string) = newValue.as<String>();
611+
property->setValue(newValue.as<const char *>());
607612
property->changed(property->getValue());
608613
break;
609614
}

‎examples/AsyncProperty/AsyncProperty.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* thing-url-adapter.
44
*/
55

6+
#define LARGE_JSON_BUFFERS 1
7+
68
#include <Arduino.h>
79
#include <Thing.h>
810
#include <WebThingAdapter.h>

‎examples/BME280/BME280.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
updates: dh, kg 2018
2828
*/
2929

30+
#define LARGE_JSON_BUFFERS 1
31+
3032
#include <Arduino.h>
3133
#include <BME280.h>
3234
#include <BME280I2C.h>

‎examples/RGBLamp/RGBLamp.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
1111
*/
1212

13+
#define LARGE_JSON_BUFFERS 1
14+
1315
#include <Arduino.h>
1416
#include <Thing.h>
1517
#include <WebThingAdapter.h>

‎library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "webthing-arduino",
33
"description": "A library for creating Web Things using the Web of Things API. Runs on ESP8266, ESP32, Ethernet, and WiFi101-compatible boards. Compatible with the Mozilla WebThings Gateway.",
44
"keywords": "Communication",
5-
"version": "0.11.2",
5+
"version": "0.11.3",
66
"authors": {
77
"name": "Mozilla IoT <iot@mozilla.com>"
88
},

‎library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=webthing-arduino
2-
version=0.11.2
2+
version=0.11.3
33
author=Mozilla IoT <iot@mozilla.com>
44
maintainer=James Hobin <hobinjk@gmail.com>
55
sentence=A library for creating Web Things using the Web of Things API

0 commit comments

Comments
 (0)
Please sign in to comment.