Skip to content
This repository was archived by the owner on Jul 24, 2026. It is now read-only.

fix: prevent low battery notification on first UPower notify - #18

Merged
trin94 merged 1 commit into
mainfrom
feat/low-battery-notification
Jul 18, 2026
Merged

fix: prevent low battery notification on first UPower notify#18
trin94 merged 1 commit into
mainfrom
feat/low-battery-notification

Conversation

@trin94

@trin94 trin94 commented Jul 18, 2026

Copy link
Copy Markdown
Owner

No description provided.

@trin94
trin94 force-pushed the feat/low-battery-notification branch from f1be529 to 85a185b Compare July 18, 2026 11:22
Logging in without touching the mouse leaves UPower with a
placeholder percentage of 0. On the first touch the device state
flips to discharging before the real percentage arrives, so the
widget briefly sees a live 0% reading and announces a low battery
that isn't one.

A reading of 0 now counts as not reporting, since UPower keeps 0
until it has read the device once. The low battery logic also moves
into its own monitor that checks device properties directly, because
the old announce path read derived bindings that can hold stale
values while updates settle. That mix of display state and policy is
what made this bug possible.

The QML sources are split into entry points, logic, and views so the
policy and the display code stay apart.
@trin94
trin94 force-pushed the feat/low-battery-notification branch from 85a185b to 30edf63 Compare July 18, 2026 11:50
@trin94
trin94 merged commit f2e46bc into main Jul 18, 2026
1 check passed
@trin94
trin94 deleted the feat/low-battery-notification branch July 18, 2026 11:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant