Skip to content

Commit 6e12d87

Browse files
committed
Update examples to use unit
1 parent 0928552 commit 6e12d87

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

examples/PlatformIO/BME280/src/BME280.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@
4545

4646
WebThingAdapter* adapter;
4747

48-
const char* bme280Types[] = {nullptr};
48+
const char* bme280Types[] = {"TemperatureSensor", nullptr};
4949
ThingDevice weather("bme280", "BME280 Weather Sensor", bme280Types);
50-
ThingProperty weatherTemp("temperature", "", NUMBER, nullptr);
50+
ThingProperty weatherTemp("temperature", "", NUMBER, "TemperatureProperty");
5151
ThingProperty weatherHum("humidity", "", NUMBER, nullptr);
5252
ThingProperty weatherPres("pressure", "", NUMBER, nullptr);
5353

@@ -122,6 +122,7 @@ void setup() {
122122
digitalWrite(LED_BUILTIN, PIN_STATE_HIGH);
123123
adapter = new WebThingAdapter("weathersensor", WiFi.localIP());
124124

125+
weatherTemp.unit = "c";
125126
weather.addProperty(&weatherTemp);
126127
weather.addProperty(&weatherPres);
127128
weather.addProperty(&weatherHum);

0 commit comments

Comments
 (0)