Skip to content

Clear override text conditionally based on device #423

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

Merged
merged 2 commits into from
Jul 5, 2025
Merged

Conversation

bjorkert
Copy link
Contributor

@bjorkert bjorkert commented Jul 4, 2025

This pull request resolves issue #403.

Description:

This change introduces a conditional clearing of the override information in the infoManager. Previously, the override data was cleared every time the device status was updated.

This caused an issue for Trio users, where the override text would disappear from the display. This happened because for Trio, override information is fetched from treatments, and the device status does not contain this data. If a device status update occurred after the treatment data was processed, the override information would be incorrectly cleared.

For "Loop" devices, the override information is part of the device status, so clearing it upon refresh is the correct behavior to ensure the display is up-to-date.

Changes:

  • In updateDeviceStatusDisplay(jsonDeviceStatus:), the call to infoManager.clearInfoData(types: [.override]) is now wrapped in a conditional check.
  • The override data is now only cleared if the selected device is "Loop".

This ensures that the override information is handled correctly for both Loop and Trio users, fixing the glitch where the override text would intermittently disappear for the latter.

@bjorkert bjorkert requested a review from marionbarker July 4, 2025 14:18
@bjorkert bjorkert linked an issue Jul 4, 2025 that may be closed by this pull request
Copy link
Collaborator

@marionbarker marionbarker left a comment

Choose a reason for hiding this comment

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

Code review

The code review looks appropriate

Test

I built this branch (as well as dev branch) on a test phone viewing both a Loop URL and Trio URL (at separate times). I did not notice a difference with the Loop URL between the dev and trio-override builds.

Trio URL

  • With dev:
    • disabling an override removed the override from the display completely (instead of changing the end point)
  • With trio-override:
    • disabling an override updated the end point to the actual duration

@bjorkert bjorkert merged commit a1137ce into dev Jul 5, 2025
@bjorkert bjorkert deleted the trio-override branch July 5, 2025 16:34
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.

The override text in the info table is glitchy
2 participants