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

Remove toast when updating state/camera/template widget fails #2262

Merged
merged 3 commits into from
Feb 17, 2022

Conversation

jpelgrom
Copy link
Member

@jpelgrom jpelgrom commented Feb 11, 2022

Summary

Based on discussion on Discord, this PR updates the camera, entity state and template widgets to remove the toast when updating the data fails, because these toasts could be very frequent1 and/or hard to attribute to a specific widget2, and show an icon on the specific widget that failed instead.

1: if the user tapped repeatedly to update toasts will 'queue', bad connections can cause problems for template widget updates because they update on any state change
2: entity state/template widgets cache data so they don't have an obvious 'not working' state

Screenshots

Showing failed updates, when the widget is able to update (again) the icon is not shown.

Light Dark
Three widgets, each with a red icon of two arrows in a circle for syncing with an exclamation mark in the middle, at the bottom of the widget, indicating that they are not updated, light mode Three widgets, each with a red icon of two arrows in a circle for syncing with an exclamation mark in the middle, at the bottom of the widget, indicating that they are not updated, dark mode

Link to pull request in Documentation repository

Not needed

Any other notes

CC @dshokouhi, thanks for the input

Copy link
Member

@dshokouhi dshokouhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking this on!

@jpelgrom jpelgrom changed the title Hide toast when updating state/camera/template widget fails Remove toast when updating state/camera/template widget fails Feb 11, 2022
 - The error can also be because the selected entity no longer exists and/or the device failed to handle the response, so use a more generic error while refreshing icon
@jpelgrom
Copy link
Member Author

Decided to change the icon because it is shown on any failure, not just network related ones, and the previous cloud icon suggested otherwise. Screenshots have been updated.

 - Don't leak widget-specific calls in to a general variable, use a data class in order to be able to return two different data types
@JBassett JBassett merged commit 09cf216 into home-assistant:master Feb 17, 2022
@jpelgrom jpelgrom deleted the widgets-hide-toast branch February 17, 2022 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants