-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dd90d55
commit 1656f3c
Showing
12 changed files
with
346 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/**Mocked data */ | ||
export default function({faker, url}) { | ||
//Last.fm api | ||
if (/^https:..testapp.herokuapp.com.*$/.test(url)) { | ||
//Get Nightscout Data | ||
console.debug(`metrics/compute/mocks > mocking nightscout api result > ${url}`) | ||
const lastInterval = Math.floor(new Date() / 300000) * 300000 | ||
const directionArray = ["SingleUp", "DoubleUp", "FortyFiveUp", "Flat", "FortyFiveDown", "SingleDown", "DoubleDown"] | ||
return ({ | ||
status:200, | ||
data:{ | ||
data:[{ | ||
_id:faker.git.commitSha().substring(0, 23), | ||
device:"xDrip-DexcomG5", | ||
date:lastInterval, | ||
dateString:new Date(lastInterval).toISOString(), | ||
sgv:faker.random.number({min:40, max:400}), | ||
delta:faker.random.number({min:-10, max:10}), | ||
direction:directionArray[Math.floor(Math.random() * directionArray.length)], | ||
type:"sgv", | ||
filtered:0, | ||
unfiltered:0, | ||
rssi:100, | ||
noise:1, | ||
sysTime:new Date(lastInterval).toISOString(), | ||
utcOffset:faker.random.number({min:-12, max:14})*60, | ||
}], | ||
}, | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
### 💉 Nightscout | ||
|
||
The *Nightscout* plugin lets you display blood sugar values from a [Nightscout](http://nightscout.info) site. | ||
|
||
<table> | ||
<td align="center"> | ||
<img src="https://github.com/legoandmars/legoandmars/blob/master/metrics.plugin.nightscout.svg"> | ||
<img width="900" height="1" alt=""> | ||
</td> | ||
</table> | ||
|
||
<details> | ||
<summary>💬 Setting up a nightscout site</summary> | ||
|
||
The [nightscout website](http://www.nightscout.info/) details how to self-host a nightscout site. Check out the instructions there. | ||
|
||
</details> | ||
|
||
#### ℹ️ Examples workflows | ||
|
||
[➡️ Available options for this plugin](metadata.yml) | ||
|
||
```yaml | ||
- uses: lowlighter/metrics@master | ||
with: | ||
# ... other options | ||
plugin_nightscout: yes | ||
plugin_nightscout_url: ${{ secrets.NIGHTSCOUT_URL }} # Use the github actions "NIGHTSCOUT_URL" secret as your nightscout site | ||
plugin_nightscout_datapoints: 12 # Use the latest 12 blood sugar datapoints to create a graph | ||
plugin_nightscout_lowalert: 80 # Blood sugars below 80 will be considered low | ||
plugin_nightscout_highalert: 180 # Blood sugars above 180 will be considered high | ||
plugin_nightscout_urgentlowalert: 50 # Blood sugars below 50 will be considered urgently low | ||
plugin_nightscout_urgenthighalert: 250 # Blood sugars above 250 will be considered urgently high | ||
``` |
Oops, something went wrong.