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

Syncing recent dev #4

Merged
merged 47 commits into from
Jan 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
10d623b
mgdl -> mg/dl
AdrianLxM Mar 6, 2018
bde4750
Merge pull request #9 from inventor96/update-virtual-assistants-v2
inventor96 Nov 7, 2019
378406b
Merge pull request #10 from nightscout/dev
inventor96 Dec 7, 2019
e4e417b
Merge branch 'dev' of github.com:inventor96/cgm-remote-monitor into dev
inventor96 Dec 17, 2019
14e8c8c
Bump version to 13.0.2-dev
sulkaharo Dec 18, 2019
e0667c9
fix some random test failures (#5341)
jpcunningh Dec 20, 2019
6f43f47
Merge branch 'dev' of github.com:inventor96/cgm-remote-monitor into dev
inventor96 Dec 27, 2019
0c9f819
Added support for asking delta
inventor96 Dec 27, 2019
a4c0425
Added time reference
inventor96 Dec 27, 2019
a7e49b3
Made delta reading more informative
inventor96 Dec 27, 2019
7a1fc6d
Corrected time reference
inventor96 Dec 27, 2019
c9c9495
Try shortening the response
inventor96 Dec 27, 2019
014df85
Revert attempt
inventor96 Dec 27, 2019
6475310
Updated templates and documentation
inventor96 Dec 27, 2019
161c496
Minor improvement in response when delta is 0
inventor96 Dec 27, 2019
23d25a4
German translations improved and added (#5360)
tanja3981 Jan 1, 2020
aeebf0b
Delta support in virtual assistants (#5376)
sulkaharo Jan 1, 2020
9718bc7
Fix Alexa Launch and SessionEnded Requests (#5377)
Bartlomiejsz Jan 1, 2020
a4ce06f
Fix #5149 - discord link on CONTRIBUTING.md doesn't do anything (#5380)
Bartlomiejsz Jan 1, 2020
8139cb9
Fix #5146 - display of treatment with only Fat and Protein set (#5381)
Bartlomiejsz Jan 1, 2020
f7922a6
Basic report page style fixes and updates (#5387)
andrew-dixon Jan 1, 2020
031c5be
Add missing Polish translations and improve existing (#5382)
Bartlomiejsz Jan 1, 2020
1c579a7
Addressed virtual assistant usage with Authentication Roles (#5388)
inventor96 Jan 1, 2020
78be0f6
mgdl -> mg/dl (#3423)
sulkaharo Jan 1, 2020
44519b9
Fix timeago alarms (again). The changes to the rendered had an uninte…
sulkaharo Jan 1, 2020
9817b03
Remove the server side test
sulkaharo Jan 1, 2020
df03577
Merge pull request #5394 from nightscout/fix_timeago
sulkaharo Jan 1, 2020
60be07c
Fix Graph Display Without Recent Devicestatus (#5409)
jpcunningh Jan 6, 2020
ee0b1e8
Update Russian (#5415)
apanasef Jan 6, 2020
0def1f2
Add server teardown ability (#5410)
PetrOndrusek Jan 6, 2020
bb34500
Additional German Translations and corrections (#5405)
herzogmedia Jan 6, 2020
5e47c4d
Fix #5188 - move predictions to bundle and don't render chart on pred…
Bartlomiejsz Jan 6, 2020
ddbda15
Move toolbar and authentication status to partial and include on each…
Bartlomiejsz Jan 6, 2020
4098689
Virtual assistant code simplification (#5400)
inventor96 Jan 11, 2020
4f9f735
Pr/5379 (#5441)
sulkaharo Jan 11, 2020
c49ea37
Volunteer for Polish translations (#5396)
Bartlomiejsz Jan 11, 2020
2f60d8d
Api3 output renderers (#5425)
PetrOndrusek Jan 12, 2020
5c15243
Restore glucose distribution test (#5434)
jakobsandberg Jan 12, 2020
81d926a
Increase coverage of tests on units utility and clean up timeago test…
jakobsandberg Jan 12, 2020
937aa47
Refactor to encapsulate duplicated settings logic (#5426)
jakobsandberg Jan 12, 2020
64663d2
Send coverage reports to Codacy (#5444)
sulkaharo Jan 12, 2020
7dc292e
Resolve unnecessary uses of eslint-ignore (#5436)
jakobsandberg Jan 12, 2020
3a1d9be
Fix eslint errors and add npm script for eslint (#5427)
jakobsandberg Jan 14, 2020
04edbec
Remove redundant checks on entry ID (#5440)
jakobsandberg Jan 14, 2020
d095482
Run CI Action for Pull Requests
sulkaharo Jan 14, 2020
3386ac6
Update DayToDay report for Loop Overrides (#5452)
jonfawcett Jan 18, 2020
baad198
Fix earlier merge error with predictions having moved to the report b…
sulkaharo Jan 18, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CI test

on: [push]
on: [push, pull_request]

jobs:
build:
Expand Down Expand Up @@ -28,5 +28,7 @@ jobs:
sudo apt-get install -y --allow-downgrades mongodb-org=3.6.14 mongodb-org-server=3.6.14 mongodb-org-shell=3.6.14 mongodb-org-mongos=3.6.14 mongodb-org-tools=3.6.14
- name: Start MongoDB
run: sudo systemctl start mongod
- name: Run tests
- name: Run Tests
run: npm run-script test-ci
- name: Send Coverage
run: npm run-script coverage
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
[coverage-img]: https://img.shields.io/coveralls/nightscout/cgm-remote-monitor/master.svg
[coverage-url]: https://coveralls.io/r/nightscout/cgm-remote-monitor?branch=master
[discord-img]: https://img.shields.io/discord/629952586895851530?label=discord%20chat
[discord-url]: https://discordapp.com/channels/629952586895851530/629952669967974410
[discord-url]: https://discord.gg/rTKhrqz

## Installation for development

Expand Down Expand Up @@ -181,6 +181,7 @@ Also if you can't code, it's possible to contribute by improving the documentati
[@unsoluble]: https://github.com/unsoluble
[@viderehh]: https://github.com/viderehh
[@OpossumGit]: https://github.com/OpossumGit
[@Bartlomiejsz]: https://github.com/Bartlomiejsz

| Contribution area | List of contributors |
| ------------------------------------- | ---------------------------------- |
Expand Down Expand Up @@ -252,7 +253,7 @@ Languages with less than 90% coverage will be removed in a future Nightscout ver
| 한국어 (`ko`)|Please volunteer|Needs attention: 80.6%|
| Norsk (Bokmål) (`nb`)|Please volunteer|OK|
| Nederlands (`nl`)|[@PieterGit]|OK|
| Polski (`pl`)|Please volunteer|OK|
| Polski (`pl`)|[@Bartlomiejsz]|OK|
| Português (Brasil) (`pt`)|Please volunteer|OK|
| Română (`ro`)|Please volunteer|OK|
| Русский (`ru`)|[@apanasef]|OK|
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,24 @@ Community maintained fork of the

- [Install](#install)
- [Supported configurations:](#supported-configurations)
- [Minimum browser requirements for viewing the site:](#minimum-browser-requirements-for-viewing-the-site)
- [Recommended minimum browser versions for using Nightscout:](#recommended-minimum-browser-versions-for-using-nightscout)
- [Windows installation software requirements:](#windows-installation-software-requirements)
- [Installation notes for users with nginx or Apache reverse proxy for SSL/TLS offloading:](#installation-notes-for-users-with-nginx-or-apache-reverse-proxy-for-ssltls-offloading)
- [Installation notes for Microsoft Azure, Windows:](#installation-notes-for-microsoft-azure-windows)
- [Development](#development)
- [Usage](#usage)
- [Updating my version?](#updating-my-version)
- [What is my mongo string?](#what-is-my-mongo-string)
- [Configure my uploader to match](#configure-my-uploader-to-match)
- [Nightscout API](#nightscout-api)
- [Example Queries](#example-queries)
- [Environment](#environment)
- [Required](#required)
- [Features/Labs](#featureslabs)
- [Features](#features)
- [Alarms](#alarms)
- [Core](#core)
- [Predefined values for your browser settings (optional)](#predefined-values-for-your-browser-settings-optional)
- [Predefined values for your server settings (optional)](#predefined-values-for-your-server-settings-optional)
- [Views](#views)
- [Plugins](#plugins)
- [Default Plugins](#default-plugins)
- [`delta` (BG Delta)](#delta-bg-delta)
Expand Down Expand Up @@ -97,7 +98,7 @@ Community maintained fork of the
- [`openaps` (OpenAPS)](#openaps-openaps)
- [`loop` (Loop)](#loop-loop)
- [`override` (Override Mode)](#override-override-mode)
- [`xdripjs` (xDrip-js)](#xdripjs-xdripjs)
- [`xdripjs` (xDrip-js)](#xdripjs-xdrip-js)
- [`alexa` (Amazon Alexa)](#alexa-amazon-alexa)
- [`googlehome` (Google Home/DialogFLow)](#googlehome-google-homedialogflow)
- [`speech` (Speech)](#speech-speech)
Expand All @@ -109,6 +110,7 @@ Community maintained fork of the
- [Setting environment variables](#setting-environment-variables)
- [Vagrant install](#vagrant-install)
- [More questions?](#more-questions)
- [Browser testing suite provided by](#browser-testing-suite-provided-by)
- [License](#license)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->
Expand Down Expand Up @@ -583,7 +585,7 @@ For remote overrides, the following extended settings must be configured:
Treatment Profile Fields:

* `timezone` (Time Zone) - time zone local to the patient. *Should be set.*
* `units` (Profile Units) - blood glucose units used in the profile, either "mgdl" or "mmol"
* `units` (Profile Units) - blood glucose units used in the profile, either "mg/dl" or "mmol"
* `dia` (Insulin duration) - value should be the duration of insulin action to use in calculating how much insulin is left active. Defaults to 3 hours.
* `carbs_hr` (Carbs per Hour) - The number of carbs that are processed per hour, for more information see [#DIYPS](http://diyps.org/2014/05/29/determining-your-carbohydrate-absorption-rate-diyps-lessons-learned/).
* `carbratio` (Carb Ratio) - grams per unit of insulin.
Expand Down
59 changes: 38 additions & 21 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,36 +131,53 @@ function create (env, ctx) {
}
}));

const clockviews = require('./lib/server/clocks.js')(env, ctx);
clockviews.setLocals(app.locals);

app.use("/clock", clockviews);

app.get("/", (req, res) => {
res.render("index.html", {
locals: app.locals
});
});

var appPages = {
"/clock-color.html": "clock-color.html"
, "/admin": "adminindex.html"
, "/profile": "profileindex.html"
, "/food": "foodindex.html"
, "/bgclock.html": "bgclock.html"
, "/report": "reportindex.html"
, "/translations": "translationsindex.html"
, "/clock.html": "clock.html"
"/": {
file: "index.html"
, type: "index"
}
, "/admin": {
file: "adminindex.html"
, title: 'Admin Tools'
, type: 'admin'
}
, "/food": {
file: "foodindex.html"
, title: 'Food Editor'
, type: 'food'
}
, "/profile": {
file: "profileindex.html"
, title: 'Profile Editor'
, type: 'profile'
}
, "/report": {
file: "reportindex.html"
, title: 'Nightscout reporting'
, type: 'report'
}
, "/translations": {
file: "translationsindex.html"
, title: 'Nightscout translations'
, type: 'translations'
}
};

Object.keys(appPages).forEach(function(page) {
app.get(page, (req, res) => {
res.render(appPages[page], {
locals: app.locals
res.render(appPages[page].file, {
locals: app.locals,
title: appPages[page].title ? appPages[page].title : '',
type: appPages[page].type ? appPages[page].type : '',
});
});
});

const clockviews = require('./lib/server/clocks.js')(env, ctx);
clockviews.setLocals(app.locals);

app.use("/clock", clockviews);

app.get("/appcache/*", (req, res) => {
res.render("nightscout.appcache", {
locals: app.locals
Expand Down
3 changes: 2 additions & 1 deletion bundle/bundle.reports.source.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import './bundle.source';

window.Nightscout.report_plugins = require('../lib/report_plugins/')();
window.Nightscout.predictions = require('../lib/report/predictions');

console.info('Nightscout report bundle ready');

// Needed for Hot Module Replacement
if(typeof(module.hot) !== 'undefined') {
module.hot.accept() // eslint-disable-line no-undef
module.hot.accept()
}
2 changes: 1 addition & 1 deletion bundle/bundle.source.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ console.info('Nightscout bundle ready');

// Needed for Hot Module Replacement
if(typeof(module.hot) !== 'undefined') {
module.hot.accept() // eslint-disable-line no-undef
module.hot.accept()
}
3 changes: 2 additions & 1 deletion ci.test.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ HOSTNAME=localhost
INSECURE_USE_HTTP=true
PORT=1337
NODE_ENV=production
CI=true
CI=true
CODACY_PROJECT_TOKEN=cff7ab3377d6434a9355fd051dbb4595
11 changes: 11 additions & 0 deletions docs/plugins/alexa-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- [Create a new Alexa skill](#create-a-new-alexa-skill)
- [Define the interaction model](#define-the-interaction-model)
- [Point your skill at your site](#point-your-skill-at-your-site)
- [Do you use Authentication Roles?](#do-you-use-authentication-roles)
- [Test your skill out with the test tool](#test-your-skill-out-with-the-test-tool)
- [What questions can you ask it?](#what-questions-can-you-ask-it)
- [Activate the skill on your Echo or other device](#activate-the-skill-on-your-echo-or-other-device)
Expand Down Expand Up @@ -75,10 +76,20 @@ Now you need to point your skill at *your* Nightscout site.
1. In the left-hand menu for your skill, there's an option called "Endpoint". Click it.
1. Under "Service Endpoint Type", select "HTTPS".
1. You only need to set up the Default Region. In the box that says "Enter URI...", put in `https://{yourdomain}/api/v1/alexa`. (So if your Nightscout site is at `mynightscoutsite.herokuapp.com`, you'll enter `https://mynightscoutsite.herokuapp.com/api/v1/alexa` in the box.)
- If you use Authentication Roles, you'll need to add a bit to the end of your URL. See [the section](#do-you-use-authentication-roles) below.
1. In the dropdown under the previous box, select "My development endpoint is a sub-domain of a domain that has a wildcard certificate from a certificate authority".
1. Click the "Save Endpoints" button at the top.
1. You should see a success message pop up when the save succeeds.

### Do you use Authentication Roles? ###

If you use Authentication Roles, you will need to add a token to the end of your Nightscout URL when configuring your Endpoint.

1. In your Nightscout Admin Tools, add a new subject and give it the "readable" role.
- If you **really** would like to be super specific, you could create a new role and set the permissions to `api:*:read`.
1. After the new subject is created, copy the "Access Token" value for the new row in your subject table (**don't** copy the link, just copy the text).
1. At the end of your Nighscout URL, add `?token={yourtoken}`, where `{yourtoken}` is the Access Token you just copied. Your new URL should look like `https://{yourdomain}/api/v1/googlehome?token={yourtoken}`.

### Test your skill out with the test tool

Click on the "Test" tab on the top menu. This will take you to the page where you can test your new skill.
Expand Down
71 changes: 71 additions & 0 deletions docs/plugins/alexa-templates/en-us.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@
{
"name": "LIST_OF_METRICS",
"values": [
{
"name": {
"value": "delta",
"synonyms": [
"blood glucose delta",
"blood sugar delta",
"bg delta"
]
}
},
{
"name": {
"value": "uploader battery",
Expand Down Expand Up @@ -162,6 +172,67 @@
"raw blood glucose"
]
}
},
{
"name": {
"value": "cgm noise"
}
},
{
"name": {
"value": "cgm tx age",
"synonyms": [
"tx age",
"transmitter age",
"cgm transmitter age"
]
}
},
{
"name": {
"value": "cgm tx status",
"synonyms": [
"tx status",
"transmitter status",
"cgm transmitter status"
]
}
},
{
"name": {
"value": "cgm battery",
"synonyms": [
"cgm battery level",
"cgm battery levels",
"cgm batteries",
"cgm transmitter battery",
"cgm transmitter battery level",
"cgm transmitter battery levels",
"cgm transmitter batteries",
"transmitter battery",
"transmitter battery level",
"transmitter battery levels",
"transmitter batteries"
]
}
},
{
"name": {
"value": "cgm session age",
"synonyms": [
"session age"
]
}
},
{
"name": {
"value": "cgm status"
}
},
{
"name": {
"value": "cgm mode"
}
}
]
}
Expand Down
Binary file modified docs/plugins/google-home-templates/en-us.zip
Binary file not shown.
11 changes: 11 additions & 0 deletions docs/plugins/googlehome-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- [Overview](#overview)
- [Activate the Nightscout Google Home Plugin](#activate-the-nightscout-google-home-plugin)
- [Create Your DialogFlow Agent](#create-your-dialogflow-agent)
- [Do you use Authentication Roles?](#do-you-use-authentication-roles)
- [What questions can you ask it?](#what-questions-can-you-ask-it)
- [Updating your agent with new features](#updating-your-agent-with-new-features)
- [Adding support for additional languages](#adding-support-for-additional-languages)
Expand Down Expand Up @@ -56,6 +57,7 @@ To add Google Home support for your Nightscout site, here's what you need to do:
1. After the import finishes, click the "DONE" button followed by the "SAVE" button.
1. In the navigation pane on the left, click on "Fulfillment".
1. Enable the toggle for "Webhook" and then fill in the URL field with your Nightscout URL: `https://YOUR-NIGHTSCOUT-SITE/api/v1/googlehome`
- If you use Authentication Roles, you'll need to add a bit to the end of your URL. See [the section](#do-you-use-authentication-roles) below.
1. Scroll down to the bottom of the page and click the "SAVE" button.
1. Click on "Integrations" in the navigation pane.
1. Click on "INTEGRATION SETTINGS" for "Google Assistant".
Expand All @@ -65,6 +67,15 @@ To add Google Home support for your Nightscout site, here's what you need to do:

That's it! Now try asking Google "Hey Google, ask *your Action's name* how am I doing?"

### Do you use Authentication Roles? ###

If you use Authentication Roles, you will need to add a token to the end of your Nightscout URL when configuring your Webhook.

1. In your Nightscout Admin Tools, add a new subject and give it the "readable" role.
- If you **really** would like to be super specific, you could create a new role and set the permissions to `api:*:read`.
1. After the new subject is created, copy the "Access Token" value for the new row in your subject table (**don't** copy the link, just copy the text).
1. At the end of your Nighscout URL, add `?token=YOUR-TOKEN`, where `YOUR-TOKEN` is the Access Token you just copied. Your new URL should look like `https://YOUR-NIGHTSCOUT-SITE/api/v1/googlehome?token=YOUR-TOKEN`.

### What questions can you ask it?

See [Interacting with Virtual Assistants](interacting-with-virtual-assistants.md) for details on what you can do with Google Home.
Expand Down
10 changes: 10 additions & 0 deletions docs/plugins/interacting-with-virtual-assistants.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ This list is not meant to be comprehensive, nor does it include every way you ca
- "Alexa, ask Nightscout what is my basal"
- "Alexa, ask Nightscout what is my current basal"
- "Alexa, ask Nightscout what is my cob"
- "Alexa, ask Nightscout what is my delta"
- "Alexa, ask Nightscout what is Charlie's carbs on board"
- "Alexa, ask Nightscout what is Sophie's carbohydrates on board"
- "Alexa, ask Nightscout what is Harper's loop forecast"
Expand All @@ -51,6 +52,15 @@ This list is not meant to be comprehensive, nor does it include every way you ca
- "Alexa, ask Nightscout what is Arden's raw bg"
- "Alexa, ask Nightscout what is Dana's raw blood glucose"

*CGM Info:* (when using the [`xdripjs` plugin](/README.md#xdripjs-xdrip-js))

- "Alexa, ask Nightscout what's my CGM status"
- "Alexa, ask Nightscout what's my CGM session age"
- "Alexa, ask Nightscout what's my CGM transmitter age"
- "Alexa, ask Nightscout what's my CGM mode"
- "Alexa, ask Nightscout what's my CGM noise"
- "Alexa, ask Nightscout what's my CGM battery"

*Insulin Remaining:*

- "Alexa, ask Nightscout how much insulin do I have left"
Expand Down
Loading