node-zwave-js icon indicating copy to clipboard operation
node-zwave-js copied to clipboard

Report MultiLevelSwitchCC event type as a string instead of as a number

Open j9brown opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe.

In the course of identifying various issues with the new MultiLevelSwitchCC event feature, I've found it a bit hard to interpret the event_type field associated with these messages. I had to dig through the zwave-js source code to find the correct values (though I could have looked at the Zwave spec).

Describe the solution you'd like

Instead of reporting event_type as a number, consider using a string: such as start (event type 4) and stop (event type 5).

Describe alternatives you've considered

Instead of changing the field type, you could add a new field alongside it to avoid breaking changes. That said, since this is a new feature that's still being shaken out, there may not be many clients affected by such a change.

j9brown avatar May 06 '22 20:05 j9brown

Keeping the enum values lets us stay in sync with the specification and opens up an easier possibility for future extension. IMO this is mainly a documentation issue - the relevant (auto-generated) documentation should mention all this.

AlCalzone avatar May 09 '22 12:05 AlCalzone

I believe this is solved with https://github.com/zwave-js/node-zwave-js/pull/4652/files

AlCalzone avatar Feb 06 '23 21:02 AlCalzone