KieronQuinn / SmartspacerPlugins

A collection of plugins for Smartspacer
GNU General Public License v3.0
79 stars 2 forks source link

[Bug] battery plugin stops recognizing my headphones after some time #13

Closed Giggigx closed 6 months ago

Giggigx commented 8 months ago

Select the Plugin you are reporting for

Battery

Description

The complicaton randomly stops showing, when checking the list of connected devices my headphones stop showing up, even though they're connected. Power cycling the headphones solves the issue.

I initially thought that maybe it was being killed by android's power management so I set the plugin as unrestricted, but the issue remains. Screenshot_20231109-101323 Screenshot_20231109-101330

KieronQuinn commented 6 months ago

So after some debugging, I've found the actual issue causing this lies in the Battery widget, which sometimes loses a device.

I've countered this by adding caching, which shows the last known level of the device. Usually this is pretty accurate, and it will update itself when the level next shows up in the widget, but obviously it causes another problem, in that it continues to show the last known level for a disconnected device.

I'm going to work around this by adding a bluetooth device connected requirement to Smartspacer itself, so you can use this new option and the new requirement to show the previous known value but only when the device is actually connected (regardless of what the Battery widget thinks).

I'm going to hold off updating the plugin until the Smartspacer update is done though.

KieronQuinn commented 6 months ago

This is now merged and included in Battery v1.1 and Smartspacer v1.5

Giggigx commented 6 months ago

Thank you for fixing this, also I love the phone battery percentage feature