-
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
Better disabled/error handling on config/helpers
page
#22237
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
message.entry.state === "loaded" && | ||
this._configEntries[message.entry.entry_id]?.state !== "loaded" | ||
) { | ||
this._debouncedFetchEntitySources(); |
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.
I needed to add some delay here because I think this is racy, if I just refetch sources here immediately after state changes to "loaded" about 10% of the time the newly loaded entity would not be present in the sources list returned from core.
...(helper.configEntry && | ||
helper.editable && | ||
ERROR_STATES.includes(helper.configEntry.state) && | ||
helper.entity === undefined | ||
? [ | ||
{ | ||
path: mdiTrashCan, | ||
label: this.hass.localize("ui.common.delete"), | ||
warning: true, | ||
action: () => this._deleteEntry(helper), | ||
}, | ||
] | ||
: []), |
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.
I added delete option here only for helpers in the error state, but was there a reason we don't just allow delete for all helpers here?
Co-authored-by: Simon Lamon <[email protected]>
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.
I can't answer to open question though about the need for a delay.
Hi, Best Regards |
Proposed change
Changes:
When adding a new helper, add a call to refetch entity sources. Previously after adding a new entity like a new integral sensor, it would just remain in an error state until the page was manually refreshed.
For config entries with an error, add an error info item, and a delete item to the overflow menu:
First option will show the reason for the error (which I think is not otherwise visible anywhere):
Second option will allow to delete the config entry, as I think there is no other current way to delete a broken helper. Only way I know is to go to the hidden integration page for the helper, which is only accessible by knowing and typing in the URL because we hide it otherwise.
Type of change
Example configuration
Additional information
fixes Unable to delete a wrongfully configured 'History Stats'-helper (no delete button in GUI) #21749
fixes Cannot remove or re-enable disabled helper groups #21728
fixes button template helper entity page not reachable from helpers view #21642
fixes Can't re-enable disabled template sensors from helpers view #20486
fixes Red exclamation mark icon when a custom integration helper is created in helpers overview #21931
Checklist
If user exposed functionality or configuration variables are added/changed: