Skip to content
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

update podState, add setStateWithResult to match OmniBLE, from itsmojo #36

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

marionbarker
Copy link
Collaborator

This PR is in response to a problem found in Trio, which uses the same submodules as Loop. The code difference was prepared and tested by @itsmojo.

Loop works fine without these changes, but also should continue to work.

When modifying OmniKit in a manner similar to OmniBLE (LoopKit/OmniBLE#125), it was discovered some code found in OmniBLE did not make it into OmniKit when that code was updated to SwiftUI.

From @itsmojo:

  • "I think that this was just an accidental omission and that the OmniKit setStateWithResult should match the OmniBLE version which takes time into consideration when looking for changes between oldStatus & newStatus as well as oldHighlight and newHighlight."

Trio Issue: Extra messages exchanged with Omnipod

@itsmojo
Copy link
Contributor

itsmojo commented Jul 18, 2024

Ran various insulin delivery changing tests (automatic bolus, manual bolus, trying to bolusing with an on-going bolus, cancelling a bolus followed immediately by another bolus, automatic temp basal, manual temp basal, suspend, resume, etc) with a live pod and everything worked as expected. I also added additional debug code that would print out the {new,old}Status.bolusState and the {new,}oldStatus.basalDeliveryState in cases where they differed due to the additional !isFinished(at: date) testing and reran all the testing. By analyzing the Xcode logs I was to detect cases where shouldNotifyStatusUpdate was set to true solely because of the additional improvements. This allowed the HUD to show a change in delivery status change without a pod command having to be run. This was confirmed checking the time of a HUD update for the end of a manual temp basal against the pod comms logs.

Copy link
Contributor

@itsmojo itsmojo left a comment

Choose a reason for hiding this comment

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

LGTM

@marionbarker marionbarker merged commit f55c080 into LoopKit:main Jul 18, 2024
Jon-b-m added a commit to Artificial-Pancreas/iAPS that referenced this pull request Aug 1, 2024
Omnipod updates ported by @itsmojo:
LoopKit/OmniBLE#125 & LoopKit/OmniKit#36, fix bolusState & basalDeliveryState use !isFinished() again
LoopKit/OmniKit#36, update OmniKit setStateWithResult() to match OmniBLE version
LoopKit/OmniBLE#126 & LoopKit/OmniKit#37, fix incorrect pod suspended message on bolus after an error
Remove no longer needed APSManager updateStatus() to avoid extra get pod status commands

Nightscout Glucose backfill resolved:
#775

Resolves several old issues with import/upload to Nightscout and to the statistics database.
Prepare for the configuration profiles and the onboarding Views coming in v4.9, for instance backup of your CoreData.
f0d1d52

Make Oref0 error string in pop-up more accessible: 41d2b44

Localization of the Sharing strings, by @Mirko-tri

Crowdin translations from translators: Hung Nguyen Phuteleco, @Mirko-tri, Abdulrahman Alfantokh, @vanzaam, Mykola Yroslavadudko and Typ1er.
@rhys-jones rhys-jones mentioned this pull request Aug 3, 2024
@TrachYuri TrachYuri mentioned this pull request Aug 4, 2024
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.

2 participants