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

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

Closed
marcelveldt opened this issue Jul 4, 2024 · 7 comments
Closed

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

marcelveldt opened this issue Jul 4, 2024 · 7 comments
Assignees
Labels
backend This bug or request (primary) involves the Home Assistant backend/integration (and its dependencies) frontend This bug or request (primary) involves the Home Assistant frontend zwave-certification Required for Z-Wave certification

Comments

@marcelveldt
Copy link
Collaborator

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

@marcelveldt marcelveldt converted this from a draft issue Jul 4, 2024
@marcelveldt marcelveldt added the frontend This bug or request (primary) involves the Home Assistant frontend label Jul 4, 2024
@AlCalzone AlCalzone added the zwave-certification Required for Z-Wave certification label Sep 5, 2024
@bramkragten
Copy link
Collaborator

Is this command exposed through core?

@bramkragten bramkragten added the backend This bug or request (primary) involves the Home Assistant backend/integration (and its dependencies) label Sep 5, 2024
@MartinHjelmare
Copy link
Collaborator

MartinHjelmare commented Sep 5, 2024

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
Copy link
Collaborator

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
Copy link
Collaborator

MartinHjelmare commented Sep 5, 2024

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
Copy link
Member

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

@wendevlin
Copy link
Collaborator

Frontend PR: home-assistant/frontend#21991

@AlCalzone
Copy link
Member

Verified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend This bug or request (primary) involves the Home Assistant backend/integration (and its dependencies) frontend This bug or request (primary) involves the Home Assistant frontend zwave-certification Required for Z-Wave certification
Projects
Development

No branches or pull requests

6 participants