Skip to content

Conversation

@utix
Copy link
Collaborator

@utix utix commented Sep 21, 2025

Issue: when you plug unplug screen, you create new instances. Then after a couple of days you have a dozen of pop up. This fix this issue by creating only one timer

@Ryuno-Ki
Copy link
Collaborator

Thanks for updating this PR!

Luacheck reports some issues:


    battery-widget/battery.lua:14:7: unused variable watch
    battery-widget/battery.lua:34:11: unused variable last_battery_check
    battery-widget/battery.lua:77:12: accessing undefined variable show_current_level
    battery-widget/battery.lua:78:13: mutating non-standard global variable level_widget
    battery-widget/battery.lua:105:20: accessing undefined variable global_last_warning
    battery-widget/battery.lua:105:66: accessing undefined variable global_last_warning
    battery-widget/battery.lua:106:17: setting non-standard global variable global_last_warning
    battery-widget/battery.lua:180:16: accessing undefined variable font
    battery-widget/battery.lua:192:42: shadowing upvalue batteryType on line 31

Are you looking into these?

utix added 3 commits November 29, 2025 17:09
Issue: when you plug unplug screen, you create new instances.
Then after a couple of days you have a dozen of pop up.
This fix this issue by creating only one timer
maintainability

Major refactoring to fix critical bugs, improve code structure, and add
extensibility features while maintaining backward compatibility.

Main fixes:
- Fix division by zero when all batteries have unknown status
- Initialize status variable to prevent nil reference errors
- Remove global batteryType variable to prevent pollution

Several code improvements
@utix
Copy link
Collaborator Author

utix commented Nov 29, 2025

Thanks for updating this PR!

Luacheck reports some issues:
Are you looking into these?

@Ryuno-Ki this is fixed

Copy link
Collaborator

@Ryuno-Ki Ryuno-Ki left a comment

Choose a reason for hiding this comment

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

LGTM. Excellent job!

@Ryuno-Ki
Copy link
Collaborator

Ryuno-Ki commented Dec 1, 2025

I leave the decision on merge to streetturtle.

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