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

Fix adding widgets with invalid config via app to home screen #2218

Merged
merged 1 commit into from
Jan 31, 2022

Conversation

jpelgrom
Copy link
Member

@jpelgrom jpelgrom commented Jan 31, 2022

Summary

Found a small bug in the new option to add widgets to your home screen via the app: invalid configuration only causes an exception when trying to save the data. However, when adding them via the app, the app will try saving the data after asking the launcher to add a widget, resulting in an error after adding a widget to the home screen and the widget on the home screen will never be updated.

This PR adjusts that process to check the variable/input that would typically cause the exception before asking the launcher to add a widget. Validation in general could be better, but at least now adding widgets from the app will match the behavior of adding widgets from the home screen.

(To test: add the updated widget without setting any values.)

Screenshots

n/a

Link to pull request in Documentation repository

n/a

Any other notes

@JBassett JBassett merged commit cee8eac into home-assistant:master Jan 31, 2022
@jpelgrom jpelgrom deleted the fix-app-widgets-empty-add branch January 31, 2022 19:42
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.

3 participants