andrei-tatar / nora-service

NORA backend service
https://node-red-google-home.herokuapp.com
34 stars 30 forks source link

How to add devices? #17

Closed realjax closed 4 years ago

realjax commented 4 years ago

Google keeps on adding devices and I think Nora could use a few more as well (TV for instance).

How can someone add a device? What is the way to go?

andrei-tatar commented 4 years ago
  1. Check if the traits you need are added and add them if necessary
  2. Define the new device model, state, etc.
  3. Edit the command/query handlers for the commands the traits need to support (if no new traits added, this should already be fine)
  4. Add the new widgets in node-red-contrib-nora - so they are available in node-red.

If you want the TV with only on/off. You can pretty much duplicate the switch device (or actually a better way would be to update the switch device to support other device types - switch/outlet/light/tv/etc).

On the long run, the best approach would be to have a custom-device that you can configure the device type, supported traits, etc. but this would still need work to add support for any new traits/commands.