eclipse-thingweb / eclipse-thingweb/node-wot

[binding-http] Sending the first GET request to observe a property starts logging of the TD to the console

Open
#244 12 comments 1 reaction 1 assignee Claimed by @relu91 View on GitHub
enhancement td-tools
Dominant language
TypeScript
Stars
192
Forks
100
Avg merge
3d 2h
Merged PRs (30d)
6

Description

## Version

core: 0.7.0
binding-http: 0.7.0
installed via npm

## Behavior

On the Thing side, every second I write to a property that updates its value with a function like this:

```js
private pollSensors(){
setInterval(()=>{
bme280.readSensorData().then((data) => {

this.thing.writeProperty("temperature",data.temperature_C)
this.thing.writeProperty("pressure",data.pressure_hPa)

});
},1000)
}
```
When the Thing starts, it logs the sensor values every second like the following

```
ExposedThing 'RainbowHAT' directly sets Property 'temperature' to value '36.81'
ExposedThing 'RainbowHAT' directly sets Property 'pressure' to value '949.9067119739695'
```
So far so good. Sending an HTTP GET request to read a property (`/properties/temperature`) results in the TD being logged to the console. This is weird but maybe it is OK.

However, sending a GET request to observe a property (`/properties/temperature/observable`) results in the TD being logged every second or every time the property is written to.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.