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

feat: add Node 12 Active LTS support, drop Node 8 support (this PR also merges some wip/013alpha stuff) #5111

Closed
wants to merge 139 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
139 commits
Select commit Hold shift + click to select a range
d767102
Merge pull request #1 from nightscout/master
inventor96 Jul 30, 2019
676048b
Merge pull request #2 from nightscout/dev
inventor96 Sep 6, 2019
202402f
Copied work done by mdomox
inventor96 Sep 6, 2019
e36a6f1
Updates and fixes to CONTRIBUTING.md
inventor96 Sep 6, 2019
93f8eb9
Spacing unification
inventor96 Sep 7, 2019
3b183a2
One more fix for CONTRIBUTING.md
inventor96 Sep 7, 2019
a7bf320
Minor code formatting improvements
inventor96 Sep 7, 2019
ce00c94
One more time...
inventor96 Sep 7, 2019
efa35c4
Renamed Alexa stuff to virtAsst for generic-ness
inventor96 Sep 7, 2019
51c8d2c
Corrected missed translate() text
inventor96 Sep 8, 2019
58162c2
Updated googlehome plugin to mimic the alexa plugin
inventor96 Sep 8, 2019
b39eb8f
Changed order of operations
inventor96 Sep 8, 2019
8a20015
Fixed parameter referencing in googlehome
inventor96 Sep 8, 2019
90562a3
Yet another CONTRIBUTING fix
inventor96 Sep 8, 2019
855b64d
Removed extra google stuff
inventor96 Sep 8, 2019
2238067
Migrated standalone intents to MetricNow intent
inventor96 Sep 8, 2019
b3a47b3
Simplified route handling
inventor96 Sep 8, 2019
79f0217
Added logging
inventor96 Sep 8, 2019
cc56ef8
Added forgotten path selector
inventor96 Sep 8, 2019
0b1ce34
Separated instructions for adding virtual assistant support in a plugin
inventor96 Sep 8, 2019
0d85439
A few typo fixes
inventor96 Sep 8, 2019
f74d6a8
Improved logging
inventor96 Sep 8, 2019
c266cab
Updated Google Home plugin instructions
inventor96 Sep 9, 2019
895407d
Attempt to trigger download of template file
inventor96 Sep 9, 2019
478b25b
Small wording tweaks
inventor96 Sep 9, 2019
c562e7d
Updated Alexa plugin documentation
inventor96 Sep 10, 2019
3563158
Updated test files
inventor96 Sep 10, 2019
0a48c1d
Re-added handler count tests so devs are prompted to write tests for …
inventor96 Sep 10, 2019
658ca16
Updated Alexa documentation
inventor96 Sep 10, 2019
2b3d783
Small typo fix
inventor96 Sep 10, 2019
73d4e04
Clarification
inventor96 Sep 10, 2019
f946f4f
Further clarifications and typos
inventor96 Sep 10, 2019
6ff8aa3
Added language info to Google Home plugin doc
inventor96 Sep 12, 2019
92d2f70
URL correction
inventor96 Sep 12, 2019
41c0335
URL fix v2
inventor96 Sep 12, 2019
f188f4f
Wording clarification
inventor96 Sep 12, 2019
071d980
Ugh...
inventor96 Sep 12, 2019
313bb60
Minor instruction fix
inventor96 Sep 12, 2019
67ae84d
Sub steps fix
inventor96 Sep 12, 2019
dd6e691
Fixed Alexa references in Google Home
inventor96 Sep 12, 2019
6032aab
Added a couple steps for improved user experience
inventor96 Sep 12, 2019
87261af
One more forgotten step
inventor96 Sep 12, 2019
450fbc2
Updated pump reservoir handler to handle undefined values
inventor96 Sep 16, 2019
bf57dfe
Updated titles and unknown-value responses
inventor96 Sep 16, 2019
ddd8f63
Modified forecast responses to use translate()
inventor96 Sep 16, 2019
d3346fe
Updated tests
inventor96 Sep 16, 2019
6dee062
Improved training phrases
inventor96 Sep 16, 2019
7349a12
initial commit for d3 upgrade
Oct 12, 2019
285fe97
d3 v5 mostly working except brush
Oct 14, 2019
c340e74
more work on the brush
Oct 14, 2019
9716c38
brush and layout mostly working now
Oct 15, 2019
dd760a9
make open-right and open-left lines visible
Oct 15, 2019
c510246
make brush selection hidden
Oct 15, 2019
fd53c45
fix open-right, open-top, and now-line in retro mode
Oct 15, 2019
ae176c8
fix setting brush to now
Oct 15, 2019
fcceeec
fix updateBrushToNow to set start correctly
Oct 15, 2019
8a1765a
add extent to updateBrushToNow
Oct 15, 2019
824604e
fix inRetro to use dataExtent instead of domain
Oct 15, 2019
c91e7bd
move a debug log message to better location
Oct 15, 2019
f9e579b
debug for brush movements
Oct 15, 2019
9a07f45
cleanup adjusted range vs. brushed range
Oct 15, 2019
b6551cd
fix syntax error
Oct 15, 2019
4e874ff
remove transitions for brush movements
Oct 16, 2019
cc82be9
log message for dataUpdate
Oct 16, 2019
a8c91e7
fix updating brush range when new data arrives
Oct 16, 2019
dfa06be
fix keeping up with data when not in retro
Oct 16, 2019
3fb44f1
keep brush range at focusRangeMS during update
Oct 16, 2019
da00bb8
fix variable name error
Oct 16, 2019
5c82495
keep chart in sync with current time when not in retro
Oct 16, 2019
47bb747
use short transition time
Oct 16, 2019
bb68263
test no opacity changes
Oct 16, 2019
28866ed
remove one more highlight and use small transition duration
Oct 16, 2019
f14ab53
fix race condition
Oct 16, 2019
61884f2
Wording improvements
inventor96 Oct 16, 2019
f5afde5
fix for uncommanded going to retro
Oct 16, 2019
f8bc44f
fix syntax error
Oct 16, 2019
dadc3a9
update chart scales when new data arrives in retro mode
Oct 17, 2019
c537d91
Use consistent transition for scroll
Oct 17, 2019
ed319ad
clean chart.updateContext
Oct 17, 2019
199f5ec
comment out debug messages
Oct 17, 2019
3772547
merge current dev to resolve conflicts
Oct 17, 2019
ffe5d99
remove unused variable
Oct 17, 2019
258fec6
update renderer to account for no structure arg for d3 attr
Oct 17, 2019
a5d8378
fix syntax error
Oct 17, 2019
4c655d8
one more syntax error
Oct 17, 2019
85dc644
use requestAnimationFrame
Oct 17, 2019
0916f36
forgot to update current scroll data
Oct 17, 2019
b9c13d5
remove extra treatment circles
Oct 18, 2019
713a99f
try using class for selection
Oct 18, 2019
7b7d375
reduce update required for focus circles
Oct 18, 2019
e7a8523
reduce update required for focus treatments
Oct 18, 2019
a52bd7e
fix update prepare treat circles
Oct 18, 2019
974dc32
use _id for treatments key
Oct 18, 2019
eca33c7
do not use opacity for past entry circles
Oct 18, 2019
8b95618
feat: drop Node v8 support, prepare for Node v12 active LTS
PieterGit Oct 18, 2019
dc8039b
update npm-shrinkrap.json
PieterGit Oct 18, 2019
fda5547
fix typo
PieterGit Oct 18, 2019
60e3421
update eslint and eslint-loader
PieterGit Oct 18, 2019
c79a2f3
upgrade css-loader, file-loader and style-loader
PieterGit Oct 18, 2019
4453d3a
update terser and terser-webpack-plugin
PieterGit Oct 18, 2019
9b2c36f
update npm-shrinkwrap
PieterGit Oct 18, 2019
173a5f1
Merge branch 'd3-upgrade' of https://github.com/jpcunningh/cgm-remote…
PieterGit Oct 18, 2019
d10ae41
Merge branch 'update-virtual-assistants' of https://github.com/invent…
PieterGit Oct 18, 2019
3445eee
replace scale.linear with scaleLinear
PieterGit Oct 18, 2019
06a8a92
d3 upgrade axis
PieterGit Oct 18, 2019
1ac583c
d3 upgrade axis
PieterGit Oct 18, 2019
e4fd55b
replace scale.linear with scaleLinear
PieterGit Oct 18, 2019
54cf245
d3 upgrade axis
PieterGit Oct 18, 2019
123395f
d3 upgrade axis
PieterGit Oct 18, 2019
e8618ae
fix tooltip location
Oct 19, 2019
5fa2cf6
Merge branch 'd3-upgrade' of https://github.com/jpcunningh/cgm-remote…
PieterGit Oct 19, 2019
bd4ed4e
fix plugin tooltip location
Oct 19, 2019
fcfb90d
Merge branch 'd3-upgrade' into wip/013alpha
Oct 19, 2019
0fc121c
Google Home setup instruction corrections
inventor96 Oct 19, 2019
62b830f
update reports for d3 v5
Oct 19, 2019
cf63611
fix inner radius default for insulin distribution pie
Oct 19, 2019
9233b1c
update reports for d3 v5
Oct 19, 2019
36ac884
fix inner radius default for insulin distribution pie
Oct 19, 2019
23a182b
fix dynamic scaling issues
Oct 19, 2019
7d7502f
fix dynamic scaling issues
Oct 19, 2019
739b01e
fix single click scroll
Oct 20, 2019
3ea7550
fix single click scroll
Oct 20, 2019
3cb3f47
Corrected how metric selection is found
inventor96 Oct 20, 2019
bec4bc6
Fix font size on axis labels
sulkaharo Oct 20, 2019
64d9dfb
Render ticks on top of everything
sulkaharo Oct 20, 2019
e80f90f
Fix value caching in the profile functions. Looks like when Circadian…
sulkaharo Oct 20, 2019
7f1ea07
Merge pull request #2 from nightscout/pr/5081
jpcunningh Oct 20, 2019
84f7c66
Merge branch 'd3-upgrade' of ssh://github.com/jpcunningh/cgm-remote-m…
Oct 20, 2019
21dffe0
Merge branch 'd3-upgrade' into wip/013alpha
Oct 20, 2019
66cf917
Merge branch 'fix_profile' of https://github.com/nightscout/cgm-remot…
PieterGit Oct 20, 2019
463c036
Merge branch 'd3-upgrade' of https://github.com/jpcunningh/cgm-remote…
PieterGit Oct 20, 2019
2f63a4a
Merge branch 'update-virtual-assistants' of https://github.com/invent…
PieterGit Oct 20, 2019
18dbbe9
Merge branch 'wip/013alpha' of https://github.com/nightscout/cgm-remo…
PieterGit Oct 20, 2019
2bedc1b
Merge branch 'wip/013alpha' of ssh://github.com/nightscout/cgm-remote…
Oct 20, 2019
60daf80
fix click to scroll jankiness
Oct 20, 2019
a609a11
move loading finished to the bottom of updateHeader
Oct 21, 2019
5b3b424
Merge branch 'dev' of https://github.com/inventor96/cgm-remote-monito…
PieterGit Oct 21, 2019
d67f603
Merge branch 'wip/013alpha' of https://github.com/nightscout/cgm-remo…
PieterGit Oct 21, 2019
8d27681
Update Node to Version 12.13.0 'Erbium' (LTS) and update npm to 6.12.0
PieterGit Oct 21, 2019
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
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.16.0
10.16.3
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dist: xenial
node_js-steps: &node_js-steps
language: node_js
before_install:
- if [[ `npm --version` != "6.4.1" ]]; then npm install -g npm@latest; npm --version; fi
- if [[ `npm --version` != "6.12.0" ]]; then npm install -g npm@latest; npm --version; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
# https://github.com/Homebrew/homebrew-core/issues/26358
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew unlink python; fi
Expand All @@ -26,5 +26,7 @@ matrix:
include:
- node_js: "10"
<<: *node_js-steps
- node_js: "12"
<<: *node_js-steps
- node_js: "node" # Latest Node is not supported, and recommend, but we'll test it to know incompatibility issues
<<: *node_js-steps
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,13 @@ Also if you can't code, it's possible to contribute by improving the documentati
| Release coordination 0.11.x: | [@PieterGit] |
| Issue/Pull request coordination: | Please volunteer |
| Cleaning up git fork spam: | Please volunteer |
| Documentation writers: | [@andrew-warrington][@unsoluble] [@tynbendad] [@danamlewis] [@rarneson] |
| Documentation writers: | [@andrew-warrington] [@unsoluble] [@tynbendad] [@danamlewis] [@rarneson] |

### Plugin contributors

| Contribution area | List of developers | List of testers
| ------------------------------------- | -------------------- | -------------------- |
| [`alexa` (Amazon Alexa)](README.md#alexa-amazon-alexa)| Please volunteer | Please volunteer |
| [`alexa` (Amazon Alexa)](README.md#alexa-amazon-alexa)| [@inventor96] | Please volunteer |
| [`ar2` (AR2 Forecasting)](README.md#ar2-ar2-forecasting)| Please volunteer | Please volunteer |
| [`basal` (Basal Profile)](README.md#basal-basal-profile)| Please volunteer | Please volunteer |
| [`boluscalc` (Bolus Wizard)](README.md#boluscalc-bolus-wizard)| Please volunteer | Please volunteer |
Expand All @@ -223,7 +223,7 @@ Also if you can't code, it's possible to contribute by improving the documentati
| [`direction` (BG Direction)](README.md#direction-bg-direction)| Please volunteer | Please volunteer |
| [`errorcodes` (CGM Error Codes)](README.md#errorcodes-cgm-error-codes)| Please volunteer | Please volunteer |
| [`food` (Custom Foods)](README.md#food-custom-foods)| Please volunteer | Please volunteer |
| [`googlehome` (Google Home)](README.md#google-home) |[@mdomox] [@rickfriele] | [@mcdafydd] [@oteroos] [@jamieowendexcom] |
| [`googlehome` (Google Home/DialogFlow)](README.md#googlehome-google-homedialogflow)| [@mdomox] [@rickfriele] [@inventor96] | [@mcdafydd] [@oteroos] [@jamieowendexcom] |
| [`iage` (Insulin Age)](README.md#iage-insulin-age)| Please volunteer | Please volunteer |
| [`iob` (Insulin-on-Board)](README.md#iob-insulin-on-board)| Please volunteer | Please volunteer |
| [`loop` (Loop)](README.md#loop-loop)| Please volunteer | Please volunteer |
Expand All @@ -232,9 +232,9 @@ Also if you can't code, it's possible to contribute by improving the documentati
| [`profile` (Treatment Profile)](README.md#profile-treatment-profile)| Please volunteer | Please volunteer |
| [`pump` (Pump Monitoring)](README.md#pump-pump-monitoring)| Please volunteer | Please volunteer |
| [`rawbg` (Raw BG)](README.md#rawbg-raw-bg)| [@jpcunningh] | Please volunteer |
| [`sage` (Sensor Age)](README.md#sage-sensor-age)| @jpcunningh | Please volunteer |
| [`sage` (Sensor Age)](README.md#sage-sensor-age)| [@jpcunningh] | Please volunteer |
| [`simplealarms` (Simple BG Alarms)](README.md#simplealarms-simple-bg-alarms)| Please volunteer | Please volunteer |
| [`speech` (Speech)](README.md#speech-speech) | [@sulkaharo] | Please volunteer |
| [`speech` (Speech)](README.md#speech-speech)| [@sulkaharo] | Please volunteer |
| [`timeago` (Time Ago)](README.md#timeago-time-ago)| Please volunteer | Please volunteer |
| [`treatmentnotify` (Treatment Notifications)](README.md#treatmentnotify-treatment-notifications)| Please volunteer | Please volunteer |
| [`upbat` (Uploader Battery)](README.md#upbat-uploader-battery)| [@jpcunningh] | Please volunteer |
Expand All @@ -251,7 +251,7 @@ Languages with less than 90% coverage will be removed in a future Nightscout ver
| Čeština (`cs`) |Please volunteer|OK |
| Deutsch (`de`) |[@viderehh] [@herzogmedia] |OK |
| Dansk (`dk`) | [@janrpn] |OK |
| Ελληνικά `(el`)|Please volunteer|Needs attention: 68.5%|
| Ελληνικά (`el`)|Please volunteer|Needs attention: 68.5%|
| English (`en`)|Please volunteer|OK|
| Español (`es`) |Please volunteer|OK|
| Suomi (`fi`)|[@sulkaharo] |OK|
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ Community maintained fork of the
- [`override` (Override Mode)](#override-override-mode)
- [`xdrip-js` (xDrip-js)](#xdrip-js-xdrip-js)
- [`alexa` (Amazon Alexa)](#alexa-amazon-alexa)
- [`googlehome` (Google Home/DialogFLow)](#googlehome-google-homedialogflow)
- [`speech` (Speech)](#speech-speech)
- [`cors` (CORS)](#cors-cors)
- [Extended Settings](#extended-settings)
Expand Down Expand Up @@ -139,7 +140,7 @@ Older versions of the browsers might work, but are untested.

## Windows installation software requirements:

- [Node.js](http://nodejs.org/) Latest Node 8 LTS (Node 8.15.1 or later) or Node 10 LTS (Node 10.16.0 or later; Node 10.15.2 works for Azure). Node versions that do not have the latest security patches will not work. Use [Install instructions for Node](https://nodejs.org/en/download/package-manager/) or use `setup.sh`)
- [Node.js](http://nodejs.org/) Latest Node 10 (`Dubnium`) LTS (Node 10.16.3 or later, Node 10.15.2 works for Azure) or Node 12 (`Erbium`) LTS (Node 12.13.0 or later; ). Node versions that do not have the latest security patches will not work. Use [Install instructions for Node](https://nodejs.org/en/download/package-manager/) or use `setup.sh`)
- [MongoDB](https://www.mongodb.com/download-center?jmp=nav#community) 3.x or later. MongoDB 2.4 is only supported for Raspberry Pi.

As a non-root user clone this repo then install dependencies into the root of the project:
Expand Down Expand Up @@ -519,6 +520,9 @@ For remote overrides, the following extended settings must be configured:
##### `alexa` (Amazon Alexa)
Integration with Amazon Alexa, [detailed setup instructions](docs/plugins/alexa-plugin.md)

##### `googlehome` (Google Home/DialogFLow)
Integration with Google Home (via DialogFlow), [detailed setup instructions](docs/plugins/googlehome-plugin.md)

##### `speech` (Speech)
Speech synthesis plugin. When enabled, speaks out the blood glucose values, IOB and alarms. Note you have to set the LANGUAGE setting on the server to get all translated alarms.

Expand Down
52 changes: 52 additions & 0 deletions docs/plugins/add-virtual-assistant-support-to-plugin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
Adding Virtual Assistant Support to a Plugin
=========================================

To add virtual assistant support to a plugin, the `init` method of the plugin should return an object that contains a `virtAsst` key. Here is an example:

```javascript
iob.virtAsst = {
intentHandlers: [{
intent: "MetricNow"
, metrics: ["iob"]
, intentHandler: virtAsstIOBIntentHandler
}]
, rollupHandlers: [{
rollupGroup: "Status"
, rollupName: "current iob"
, rollupHandler: virtAsstIOBRollupHandler
}]
};
```

There are 2 types of handlers that you will need to supply:
* Intent handler - Enables you to "teach" the virtual assistant how to respond to a user's question.
* A rollup handler - Enables you to create a command that aggregates information from multiple plugins. This would be akin to the a "flash briefing". An example would be a status report that contains your current bg, iob, and your current basal.

### Intent Handlers

A plugin can expose multiple intent handlers (e.g. useful when it can supply multiple kinds of metrics). Each intent handler should be structured as follows:
+ `intent` - This is the intent this handler is built for. Right now, the templates used by both Alexa and Google Home use only the `"MetricNow"` intent (used for getting the present value of the requested metric)
+ `metrics` - An array of metric name(s) the handler will supply. e.g. "What is my `metric`" - iob, bg, cob, etc. Make sure to add the metric name and its synonyms to the list of metrics used by the virtual assistant(s).
- **IMPORTANT NOTE:** There is no protection against overlapping metric names, so PLEASE make sure your metric name is unique!
- Note: Although this value *is* an array, you really should only supply one (unique) value, and then add aliases or synonyms to that value in the list of metrics for the virtual assistant. We keep this value as an array for backwards compatibility.
+ `intenthandler` - This is a callback function that receives 3 arguments:
- `callback` Call this at the end of your function. It requires 2 arguments:
- `title` - Title of the handler. This is the value that will be displayed on the Alexa card (for devices with a screen). The Google Home response doesn't currently display a card, so it doesn't use this value.
- `text` - This is text that the virtual assistant should speak (and show, for devices with a screen).
- `slots` - These are the slots (Alexa) or parameters (Google Home) that the virtual assistant detected (e.g. `pwd` as seen in the templates is a slot/parameter. `metric` is technically a slot, too).
- `sandbox` - This is the Nightscout sandbox that allows access to various functions.

### Rollup handlers

A plugin can also expose multiple rollup handlers
+ `rollupGroup` - This is the key that is used to aggregate the responses when the intent is invoked
+ `rollupName` - This is the name of the handler. Primarily used for debugging
+ `rollupHandler` - This is a callback function that receives 3 arguments
- `slots` - These are the values of the slots. Make sure to add these values to the appropriate custom slot
- `sandbox` - This is the nightscout sandbox that allows access to various functions.
- `callback` -
- `error` - This would be an error message
- `response` - A simple object that expects a `results` string and a `priority` integer. Results should be the text (speech) that is added to the rollup and priority affects where in the rollup the text should be added. The lowest priority is spoken first. An example callback:
```javascript
callback(null, {results: "Hello world", priority: 1});
```
Loading