jperkin / node-openzwave

node.js interface to libopenzwave
Other
110 stars 54 forks source link

query: range for dinners #5

Closed mrose17 closed 10 years ago

mrose17 commented 10 years ago

ok. i have loaded up the 10 different z-wave things i have here.

since the current command set handles setLevel/switchOn/switchOff, i think that covers binary switches and multi-level switches.

here's a question on multi-level switches, with one device i saw:

level=0->7

and on another

level=0->63

is there a pre-defined range (e.g., 0..100) or something?

jperkin commented 10 years ago

Yeh, 0-99 is the effective range. The handling is a bit weird for these devices, 0-99 is the active range, 100-254 is rounded down to 99, and 255 is 'use last value, otherwise 99'.

This was really confusing me early on in my work when I was setting the level to maximum and it would occasionally turn the thing off!

Anyway, I see no practical use for 100-255, so I will probably add an assertion that we're in the 0-99 range to avoid confusion and document.

mrose17 commented 10 years ago

that works, thanks!