neeo-sdk
neeo-sdk copied to clipboard
Typo/unclarity in readme.md
Updating device drivers
To tell the NEEO Brain about changes to your **device's components** you can simply change the driver version (.setDriverVersion). If you for example add new buttons to a device, you can increase the version and this will let the Brain know to fetch the new components.
And further:
**the name of a component** is used as an identifier for that **component**, changing it will result in it being added as a "new" **component** instead of the old one being updated
This should read "The name of a device", e.g. the .buildDevice('...') part?
By name of a component we mean something like BRIGHTNESS_SLIDER or BRIGHTNESS_SENSOR, that's what is used to identify that component if it has an update on a given device.
The name of the device isn't used during the component update process. It is used before that to identify the devices which have an update.
Here's a rough outline of the process:
- Device "MY_DEVICE" has version bumped to 2, we detect this and start the update for all "MY_DEVICE" devices added on the Brain
- All components are matched (existing device on Brain with current SDK definition) using the component name (for instance "BRIGHTNESS_SLIDER")
- The properties are updated as needed using the SDK values as new values.
@pfiaux thanx, but how do i set the 'component' name in my own driver?
When you add the component, for example if you add a switch: https://neeoinc.github.io/neeo-sdk/#src-lib-models-devicebuilder.ts-addswitch
example-switch, and an example-switch_SENSOR might be automatically created under the hood as well.
Most components should have a name property.