Skip to content

Remote Bolus Dev#362

Merged
ps2 merged 5 commits into
LoopKit:devfrom
gestrich:dev_otp
Jan 25, 2022
Merged

Remote Bolus Dev#362
ps2 merged 5 commits into
LoopKit:devfrom
gestrich:dev_otp

Conversation

@gestrich

@gestrich gestrich commented May 23, 2021

Copy link
Copy Markdown
Contributor

This PR includes small changes to the LoopKit library to support remote/bolus in dev. See the workspace PR for more details on the overall effort.

@gestrich gestrich changed the base branch from master to dev May 23, 2021 14:25
@ps2

ps2 commented Jun 12, 2021

Copy link
Copy Markdown
Collaborator

Thanks @gestrich ! Will be looking at this soon.

@gestrich

Copy link
Copy Markdown
Contributor Author

@ps2 I still have a few weeks before these pieces will be ready for review but will ping you on these when ready to go (welcome interim feedback though too). I'll probably start sharing with some testers at that time to give it an initial look too.

@gestrich gestrich force-pushed the dev_otp branch 7 times, most recently from cd652eb to b0f6296 Compare June 20, 2021 15:59
@gestrich

Copy link
Copy Markdown
Contributor Author

@ps2 I've started to ask for some community help with the docs and early testing of these branches https://loop.zulipchat.com/#narrow/stream/144182-development/topic/Remote.20bolus.20.2F.20remote.20carbs.

On the code side, it is probably a good time to discuss the overall integration of this feature. I can either do my best to make a quality write-up on the architecture and my own questions. I'd also be willing to do a code walkthrough over a quick video call which may be a shortcut for both of us. Just let me know what works best for you. thanks!

@@ -18,4 +18,8 @@ public enum LoopNotificationCategory: String {
case pumpExpired
case pumpFault
case alert

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added these for the local notifications that will present for remote bolus/carbs.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

These alert definitions are probably going away, or being moved into Loop itself. But I'll take this for now

@@ -78,6 +78,13 @@ public protocol RemoteDataService: Service {
- Parameter completion: The completion function to call with any success or failure.
*/
func uploadSettingsData(_ stored: [StoredSettings], completion: @escaping (_ result: Result<Bool, Error>) -> Void)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This new delegate methods is so Loop can ask remote data services if they can validate a notification. More details on this flow in the Loop PR.

@@ -118,5 +125,9 @@ public extension RemoteDataService {
func uploadSettingsData(_ stored: [StoredSettings], completion: @escaping (_ result: Result<Bool, Error>) -> Void) {
completion(.success(false))
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No support for validation by default. The services can choose to implement this, like the NightscoutService will.

@gestrich gestrich marked this pull request as ready for review September 3, 2021 20:05
}

func validatePushNotificationSource(_ notification: [String: AnyObject]) -> Bool {
return false

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not a big fan of default implementations for protocols (https://betterprogramming.pub/swift-why-you-should-avoid-using-default-implementations-in-protocols-eeffddbed46d), but I can see you're just extending the pattern. And it's a pain to update all the actual implementations that use the protocol.

@@ -18,4 +18,8 @@ public enum LoopNotificationCategory: String {
case pumpExpired
case pumpFault
case alert

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

These alert definitions are probably going away, or being moved into Loop itself. But I'll take this for now

@ps2 ps2 merged commit 376b962 into LoopKit:dev Jan 25, 2022
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.

3 participants