zwave-js / certification-backlog

Issues and discussions related to Z-Wave certification of HA + Z-Wave JS
1 stars 0 forks source link

Add button to reset all device config values to defaults #39

Closed marcelveldt closed 2 weeks ago

marcelveldt commented 4 months ago

In the frontend panel where you can set device config values, there should be a way/button to reset all values to the default. The driver exposes a command to perform this action:

https://zwave-js.github.io/node-zwave-js/#/api/CCs/Configuration?id=resetall

bramkragten commented 2 months ago

Is this command exposed through core?

MartinHjelmare commented 2 months ago

No, either we need to add the default value to the metadata object in the zwave_js/get_config_parameters websocket command, or we need to add a new command that calls the reset driver command:

  1. https://github.com/home-assistant/core/blob/70966c2b63a34478576d0cef5899d75b39e7b2f0/homeassistant/components/zwave_js/api.py#L1685-L1716
  2. https://zwave-js.github.io/node-zwave-js/#/api/CCs/Configuration?id=reset

The first way is the least amount of work in core, but the latter may be a bit more "correct".

wendevlin commented 2 months ago

No, either we need to add the default value to the metadata object in the zwave_js/get_config_parameters websocket command, or we need to add a new command that calls the reset driver command:

  1. https://github.com/home-assistant/core/blob/70966c2b63a34478576d0cef5899d75b39e7b2f0/homeassistant/components/zwave_js/api.py#L1685-L1716
  2. https://zwave-js.github.io/node-zwave-js/#/api/CCs/Configuration?id=reset

The first way is the least amount of work in core, but the latter may be a bit more "correct".

We would need a lot of api calls when we do it with zwave_js/set_config_parameter instead of resetAll You forward it in the backend to zwave_js right? So when both frontend and backend use resetAll it would be the way to go in my opinion.

I would like you to provide us a zwave_js/reset_all_config_parameters or something like this.

MartinHjelmare commented 2 months ago

Sounds good.

And we should do both changes, since I think Dominic said that we need to show the default value to the user.

AlCalzone commented 2 months ago

We should definitely use resetAll, not reset the parameters manually.

wendevlin commented 2 months ago

Frontend PR: https://github.com/home-assistant/frontend/pull/21991