NEEOInc / neeo-sdk

NEEO Brain SDK
https://neeoinc.github.io/neeo-sdk/
MIT License
49 stars 17 forks source link

[DOC] registerSubscriptionFunction example is bogus #169

Closed yoctopuce closed 5 years ago

yoctopuce commented 5 years ago

in NEEO SDK 0.51.13 doc

Example for registerSubscriptionFunction was obviously copy/pasted from an other project, it uses an undefined sendComponentUpdate call and comments are bit cryptic. Here is a fix suggestion:


// Update sensor at some later point
if (updateCallbackReference) {
  updateCallbackReference({
    uniqueDeviceId: uniqueDeviceId, // "default" unless you used  enableDiscovery
    component: nameOfDeviceComponent, // name you gave to the component when adding it
    value: updatedSensorValue   // new value 
  });
}
pfiaux commented 5 years ago

Thanks for reporting. There's a lot of pending documentation improvements in the upcoming 0.52.x release, I'll check if this was already updated or if should updated the registerSubscriptionFunction doc as well.

pfiaux commented 5 years ago

OK we revised the documentation for registerSubscriptionFunction, example description and function parameters should be more clear now! It will be included in the next SDK release.