-
Notifications
You must be signed in to change notification settings - Fork 590
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
Template widget causes app to continue receiving events while screen is off after editing #2750
Comments
I dont think we have enough logs here. Can you get more logs and reproduce the issue please? In particular we should be seeing logs that show the subscription starting and stopping like below:
In your bugs case I would expect to see the start of the subscription but no stop, also please confirm if the app has access to run in the background. You can check this by going to Configuration > Companion app and looking at the background access tile. |
The app does have access to run in the background:
Here are some more logs: (events truncated after state_changed to prevent leaking anything sensitive) Logs
|
Interesting I am unable to reproduce on my device but I am running the latest beta. Not sure if this has already been fixed there. |
I wasn't immediately seeing the issue after the most recent attempt adding the template widget. I found that configuring the widget and hitting update without changing anything seemed to make it start acting up. I didn't often reconfigure the widget before, so I'm not sure if that's required. |
Just sideloaded the latest beta and was able to reproduce the issue. I did have to configure the existing widget and hit update to trigger it immediately. |
Ok I see what you mean, I assume our entity state widget has the same bug since they share the same code. To get around the issue for now just force stop the app and reopen it after you are done editing the widget :) Edit: I edited your post to make the logs scroll friendly |
Force closing does seem to work around the problem, at least temporarily. As I said before, I don't really edit the widget and I found the app spamming my logs when I went to look at something else. Not sure if there's something other than editing the widget that triggers it. I'll update if I see it return. |
we only start our websocket subscription when the screen comes on and when we update and/or first save the widget configuration. I don't see us resubscribing when the subscription is currently active but something seems amiss still. |
The latest beta resolves the "editing existing widget" trigger, but there are apparently still other triggers for this issue. After deleting all widgets and turning off the screen, I found logs were still getting spammed with state changes. I'm not sure if the problem was occurring before deleting the widgets. I cannot reproduce the issue by recreating widgets and subsequently deleting them, so it isn't obviously related to deleting the widgets. |
lets find a path to reproduce, but also create a new issue as the original issue related to editing is solved now. |
Home Assistant Android version:
2022.6.0-full
Android version:
12
Phone model:
Pixel 6 Pro
Home Assistant version:
2022.7.7
Last working Home Assistant release (if known):
Description of problem:
Before configuring a template widget, the app only receives events while the screen is on. Once a template widget has been added, the app will continue to receive events while the screen is off (whether or not the device is charging), leading to increased battery and data usage.
Removing the template widget and restarting the app restores the previous behavior.
Since the template widget is not visible when the screen is off, this seems like incorrect behavior.
Additional information:
Template:
Logs:
The text was updated successfully, but these errors were encountered: