Skip to content

Commit

Permalink
g7
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorkert committed May 13, 2023
1 parent c8351c0 commit 9906576
Show file tree
Hide file tree
Showing 5 changed files with 259 additions and 170 deletions.
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ This patch provides a separate suspend threshold for meal and manual bolusing at
## Omnipod Dash Site Change
When replacing a pod, this patch ensures that Loop updates Nightscout with a 'Pump Site Change'-treatment, resulting in an updated 'CAGE'-pill and pod change reminder in Loop Follow. Please note that this will happen on the next pod change after the patch is applied, and the date of current pod will not be updated.
 
## Dexcom G6 - Sensor Change
## Dexcom G6+G7 - Sensor Change
When replacing a sensor, this patch ensures that Loop updates Nightscout with a 'Sensor Change' treatment, resulting in an updated 'SAGE' pill and a sensor change reminder in Loop Follow. Please note that the start date of the current sensor will be populated.
 
## Dexcom G6 - Upload Readings
## Dexcom G6+G7 - Upload Readings
This patch automatically sets the 'Upload readings' option to 'On' by default when changing the transmitter. This change addresses the common issue of users forgetting to change the setting, resulting in no blood sugar values being sent to Nightscout.
 
## View PreMeal in Nightscout
Expand Down Expand Up @@ -68,9 +68,6 @@ Additionally, this patch restores the feature to click on Loop's recommended val
## 2 hours Lolipop
This patch reverts the carb absorption time for the lollipop (fast) icon in Loop 3 to its original value of 2 hours, which was used in Loop 2. The other default carb absorption times remain unchanged, so the taco (medium) icon remains at 3 hours, and the pizza (slow) icon remains at 5 hours, which is the same as in Loop 3. It's worth noting that Loop 2 had a carb absorption time of 4 hours for the pizza (slow) icon.
 
## Dexcom G6+G7 - Sensor Change
When replacing a sensor, this patch ensures that Loop updates Nightscout with a 'Sensor Change' treatment, resulting in an updated 'SAGE' pill and a sensor change reminder in Loop Follow. Please note that the start date of the current sensor will be populated.
 
 
# Loop Follow patches
These patches are intended for the development branch of Loop Follow.
Expand Down
50 changes: 50 additions & 0 deletions g6g7_upload_readings.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Submodule CGMBLEKit contains modified content
diff --git a/CGMBLEKit/CGMBLEKit/TransmitterManager.swift b/CGMBLEKit/CGMBLEKit/TransmitterManager.swift
index 4942087..371b7bd 100644
--- a/CGMBLEKit/CGMBLEKit/TransmitterManager.swift
+++ b/CGMBLEKit/CGMBLEKit/TransmitterManager.swift
@@ -22,7 +22,7 @@ public struct TransmitterManagerState: RawRepresentable, Equatable {

public var shouldSyncToRemoteService: Bool

- public init(transmitterID: String, shouldSyncToRemoteService: Bool = false) {
+ public init(transmitterID: String, shouldSyncToRemoteService: Bool = true) {
self.transmitterID = transmitterID
self.shouldSyncToRemoteService = shouldSyncToRemoteService
}
Submodule G7SensorKit contains modified content
diff --git a/G7SensorKit/G7SensorKit/G7CGMManager/G7CGMManagerState.swift b/G7SensorKit/G7SensorKit/G7CGMManager/G7CGMManagerState.swift
index 948b02f..95538dd 100644
--- a/G7SensorKit/G7SensorKit/G7CGMManager/G7CGMManagerState.swift
+++ b/G7SensorKit/G7SensorKit/G7CGMManager/G7CGMManagerState.swift
@@ -18,7 +18,7 @@ public struct G7CGMManagerState: RawRepresentable, Equatable {
public var latestReading: G7GlucoseMessage?
public var latestReadingTimestamp: Date?
public var latestConnect: Date?
- public var uploadReadings: Bool = false
+ public var uploadReadings: Bool = true

init() {
}
@@ -31,7 +31,7 @@ public struct G7CGMManagerState: RawRepresentable, Equatable {
}
self.latestReadingTimestamp = rawValue["latestReadingTimestamp"] as? Date
self.latestConnect = rawValue["latestConnect"] as? Date
- self.uploadReadings = rawValue["uploadReadings"] as? Bool ?? false
+ self.uploadReadings = rawValue["uploadReadings"] as? Bool ?? true
}

public var rawValue: RawValue {
diff --git a/G7SensorKit/G7SensorKitUI/Views/G7SettingsViewModel.swift b/G7SensorKit/G7SensorKitUI/Views/G7SettingsViewModel.swift
index 8513d2b..e2e275c 100644
--- a/G7SensorKit/G7SensorKitUI/Views/G7SettingsViewModel.swift
+++ b/G7SensorKit/G7SensorKitUI/Views/G7SettingsViewModel.swift
@@ -23,7 +23,7 @@ class G7SettingsViewModel: ObservableObject {
@Published private(set) var activatedAt: Date?
@Published private(set) var lastConnect: Date?
@Published private(set) var latestReadingTimestamp: Date?
- @Published var uploadReadings: Bool = false {
+ @Published var uploadReadings: Bool = true {
didSet {
cgmManager.uploadReadings = uploadReadings
}
172 changes: 100 additions & 72 deletions lnl_customization.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Expand All @@ -10,20 +11,24 @@
background-color: #f4f4f4;
padding: 20px;
}

h1 {
color: #333;
}

div {
margin-bottom: 20px;
}

label {
display: block;
margin: 0px 0;
margin: 0px 0;
padding: 6px;
background-color: #fff;
border-radius: 5px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
}

button {
display: block;
margin-top: 20px;
Expand All @@ -35,9 +40,11 @@
border-radius: 5px;
cursor: pointer;
}

button:hover {
background-color: #0056b3;
}

textarea {
width: 100%;
height: 500px;
Expand All @@ -50,13 +57,14 @@
}
</style>
</head>

<body>
<h1>Customize Loop</h1>
<div>
<label><input type="checkbox" id="option1"> Increase Future Carbs Limit to 4 hours</label><br>
<label><input type="checkbox" id="option2"> Libre Users: Limit Loop to <5 minutes</label><br>
<label><input type="checkbox" id="option3"> Modify Carb Warning & Limit: Low Carb to 49 & 99</label><br>
<label><input type="checkbox" id="option4"> Modify Carb Warning & Limit: High Carb to 201 & 300</label><br>
<label><input type="checkbox" id="option4"> Modify Carb Warning & Limit: High Carb to 201 &300</label><br>
<label><input type="checkbox" id="option5"> Disable Authentication Requirement</label><br>
<label><input type="checkbox" id="option6"> Override Insulin Needs Picker (50% to 200%, steps of 5%)</label><br>
<label><input type="checkbox" id="option7"> CAGE: Upload Pod Start to Nightscout</label><br>
Expand All @@ -67,76 +75,95 @@ <h1>Customize Loop</h1>
<textarea id="output" readonly></textarea>

<script>
const options = [
{
id: 'option1',
text: `
# Loop: Increase future carb time limit to 4 hours from 1 hour default
curl https://github.com/loopnlearn/Loop/commit/a974b6749ef4506ca679a0061c260dabcfbf9ee2.patch | git apply --directory=Loop
`
},
{
id: 'option2',
text: `
# Loop: LoopDataManager: Limit loop cycles to no more frequent than once every 4.8 minutes
curl https://github.com/loopnlearn/Loop/commit/414588c5e7dc36f692c8bbcf2d97adde1861072a.patch | git apply --directory=Loop
`
},
{
id: 'option3',
text: `
# Loop: LoopConstants: Limit carb entry to 99 and shows warning if over 49 g
curl https://github.com/loopnlearn/Loop/commit/d9939c65a6b2fc088ee5acdf0d9dc247ad30986c.patch | git apply --directory=Loop
`
},
{
id: 'option4',
text: `
# Loop: Modify Carb Warning & Limit: High Carb to 201 & 300
curl https://github.com/loopnlearn/Loop/commit/a79482ac638736c2b3b8c5057b48e3097323a522.patch | git apply --directory=Loop
`
},
{
id: 'option5',
text: `
# LoopKit: Disable Authentication Requirement
curl https://github.com/loopnlearn/LoopKit/commit/77ee44534dd16154d910cfb11dea240cf8a23262.patch | git apply --directory=LoopKit
`
},
{
id: 'option6',
text: `
# LoopKit: Override Insulin Needs Picker (50% to 200%, steps of 5%)
curl https://github.com/loopnlearn/LoopKit/commit/f35654104f70b7dc70f750d129fbb338b9a4cee0.patch | git apply --directory=LoopKit
`
},
{
id: 'option7',
text: `
# CAGE: Upload Pod Start to Nightscout
curl https://raw.githubusercontent.com/loopnlearn/loopbuildscripts/main/patch/cage.patch | git apply
`
},
{
id: 'option8',
text: `
# CGMBLEKit: SAGE: Upload G6 Sensor Start to Nightscout
curl https://github.com/loopnlearn/CGMBLEKit/commit/777c7e36de64bdc060973a6628a02add0917520e.patch | git apply --directory=CGMBLEKit
`
},
{
id: 'option9',
text: `
# CGMBLEKit: Change Default to Upload G6 Readings
curl https://github.com/loopnlearn/CGMBLEKit/commit/b9638cc7cef74b1da74c950c0dbb3525f157e11f.patch | git apply --directory=CGMBLEKit
`
}
let options = [
];

const initialText = `
# Customize Loop: Download and apply patches
- name: Customize Loop
run: |`;
function indent(level) {
return ' '.repeat(level * 2);
}

function addOption(id, comment, url, directory = '') {
let command = `curl ${url} | git apply`;
if (directory) {
command += ` --directory=${directory}`;
}

let text = `
${indent(5)}# ${comment}
${indent(5)}${command}
`;

options.push({
id: id,
text: text
});
}

addOption(
'option1',
'Loop: Increase future carb time limit to 4 hours from 1 hour default',
'https://github.com/loopnlearn/Loop/commit/a974b6749ef4506ca679a0061c260dabcfbf9ee2.patch',
'Loop'
);

addOption(
'option2',
'Loop: LoopDataManager: Limit loop cycles to no more frequent than once every 4.8 minutes',
'https://github.com/loopnlearn/Loop/commit/414588c5e7dc36f692c8bbcf2d97adde1861072a.patch',
'Loop'
);

addOption(
'option3',
'Loop: LoopConstants: Limit carb entry to 99 and shows warning if over 49 g',
'https://github.com/loopnlearn/Loop/commit/d9939c65a6b2fc088ee5acdf0d9dc247ad30986c.patch',
'Loop'
);

addOption(
'option4',
'Loop: Modify Carb Warning & Limit: High Carb to 201 & 300',
'https://github.com/loopnlearn/Loop/commit/a79482ac638736c2b3b8c5057b48e3097323a522.patch',
'Loop'
);

addOption(
'option5',
'LoopKit: Disable Authentication Requirement',
'https://github.com/loopnlearn/LoopKit/commit/77ee44534dd16154d910cfb11dea240cf8a23262.patch',
'LoopKit'
);

addOption(
'option6',
'LoopKit: Override Insulin Needs Picker (50% to 200%, steps of 5%)',
'https://github.com/loopnlearn/LoopKit/commit/f35654104f70b7dc70f750d129fbb338b9a4cee0.patch',
'LoopKit'
);

addOption(
'option7',
'CAGE: Upload Pod Start to Nightscout',
'https://raw.githubusercontent.com/loopnlearn/loopbuildscripts/main/patch/cage.patch'
);

addOption(
'option8',
'CGMBLEKit: SAGE: Upload G6 Sensor Start to Nightscout',
'https://github.com/loopnlearn/CGMBLEKit/commit/777c7e36de64bdc060973a6628a02add0917520e.patch',
'CGMBLEKit'
);

addOption(
'option9',
'CGMBLEKit: Change Default to Upload G6 Readings',
'https://github.com/loopnlearn/CGMBLEKit/commit/b9638cc7cef74b1da74c950c0dbb3525f157e11f.patch',
'CGMBLEKit'
);

const initialText = indent(3) + `# Customize Loop: Download and apply patches
${indent(3)}- name: Customize Loop
${indent(4)}run: |`;

const output = document.getElementById('output');
const copyButton = document.getElementById('copyButton');
Expand All @@ -160,10 +187,11 @@ <h1>Customize Loop</h1>
copyButton.addEventListener('click', () => {
output.select();
document.execCommand('copy');
alert('Text copied to clipboard');
alert('Text copied to clipboard!');
});

updateOutput();
</script>
</body>

</html>
Loading

0 comments on commit 9906576

Please sign in to comment.