Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typo/unclarity in readme.md #185

Open
gvdhoven opened this issue Feb 17, 2019 · 3 comments
Open

Typo/unclarity in readme.md #185

gvdhoven opened this issue Feb 17, 2019 · 3 comments

Comments

@gvdhoven
Copy link

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?

@pfiaux
Copy link
Contributor

pfiaux commented Feb 18, 2019

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:

  1. Device "MY_DEVICE" has version bumped to 2, we detect this and start the update for all "MY_DEVICE" devices added on the Brain
  2. All components are matched (existing device on Brain with current SDK definition) using the component name (for instance "BRIGHTNESS_SLIDER")
  3. The properties are updated as needed using the SDK values as new values.

@gvdhoven
Copy link
Author

@pfiaux thanx, but how do i set the 'component' name in my own driver?

@pfiaux
Copy link
Contributor

pfiaux commented Feb 18, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants