-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 reset all config for zwave node, Show default value per parameter #21894
Add reset all config for zwave node, Show default value per parameter #21894
Conversation
Still in draft, because core isn't ready yet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 🙂 Feature-wise it's look ok for me!
I only have feedback about code style.
For dialog, we don't usually add ha-dialog
in the render function.
For your use-case, you have two choices :
- use generic dialog (e.g. showConfirmationDialog)
This will open a confirmation dialog and return a promise with a boolean.
For example :
```ts
const confirm = await showConfirmationDialog(this, {
title: this.hass.localize(
"ui.panel.config.category.editor.confirm_delete"
),
text: this.hass.localize(
"ui.panel.config.category.editor.confirm_delete_text"
),
confirmText: this.hass.localize("ui.common.delete"),
destructive: true,
});
- build your own dialog
For example : https://github.com/home-assistant/frontend/blob/dev/src/dialogs/restart/show-dialog-restart.ts
If you need more logic than just text and confirmation, you can do something similar as you did but in separate files so the dialog can be lazy loaded when needed.
For this feature, I would keep it simple and use a confirmation dialog with a snack message for loading, success or error.
…to zwave-device-restore-config
Remove zwave default config info from description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the Z-Wave perspective the frontend looks good. Just needs to actually do something when pressing the reset button.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good to me ! I only put few suggestions to improve the dialog 🙂
Breaking change
Proposed change
Add a reset all config parameter functionality at the bottom of the zwave node configration panel.
Add the default value to every parameter:
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: