Skip to content

Automation triggers: a pick in the editor is shown at once - #5592

Open
olorinmaia wants to merge 2 commits into
nightscout:devfrom
olorinmaia:phone/fix/automation-bt-trigger-selection
Open

olorinmaia wants to merge 2 commits into
nightscout:devfrom
olorinmaia:phone/fix/automation-bt-trigger-selection

Conversation

@olorinmaia

@olorinmaia olorinmaia commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

In the automation trigger editor, a pick in the Bluetooth device list or in "On connect / On disconnect" was stored but not shown, so it looked like the pick was lost. The temp target, time and WiFi triggers had the same fault. Two more faults were hidden behind it: the Bluetooth field showed the first paired device when nothing was stored (a trigger saved like that has an empty name and never fires), and the time trigger stored the picked date one day too early west of UTC.

Fix

  • Bluetooth, temp target, time and WiFi editors get tick, like the other editors (they redraw after a pick)
  • Bluetooth device field is empty until the user picks a device (no fallback to the first paired device)
  • Time trigger: the date picker works in UTC, so the pick is read in UTC and the picker gets the local date as midnight UTC

Tests

No unit tests cover these editors, none added. On device (Z Flip 5, full release, time zone America/Vancouver): Bluetooth device and connect picks show at once, temp target and WiFi chips update, the time trigger shows and keeps the picked date.

Before After
before.mp4
after.mp4

Fixes #5550

The Bluetooth device, temp target, time and WiFi trigger editors did not get the tick that the other editors use to redraw. After a pick the value was stored in the trigger, but the screen kept the old text, so it looked like the pick was lost.

The Bluetooth device field also showed the first paired device when nothing was stored. A user who did not open the list saved a trigger with an empty device name, which never fires. The field is now empty until the user picks a device.

Fixes nightscout#5550
The date picker gives and takes a day as midnight UTC. The editor read the pick in the local zone and gave the picker the raw trigger time. West of UTC the stored date was one day too early. The picker could also open on the wrong day, for example in the first hour after midnight in Norway.

The pick is now read in UTC, and the picker gets the local date as midnight UTC. The time of day is untouched.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant