Skip to content

Commit

Permalink
Merge pull request #2 from nightscout/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
DigitalDan1 committed Oct 28, 2018
2 parents af5d582 + 9b238df commit aca7565
Show file tree
Hide file tree
Showing 23 changed files with 3,357 additions and 3,779 deletions.
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/--bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: "\U0001F41BBug report"
about: Create a report to help us improve things

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Your setup information**
- What version of Nightscout (e.g. 0.10.3)
- What type of CGM, and how do you get your data there? (e.g. G4 and ShareBridge, or wired receiver, etc.)
- Is your issue specific to a browser (Firefox/Safari/Chrome?) or a device (Android phone, etc.)?

**Additional context**
Add any other context about the problem here.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/--feature-request--.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: "\U0001F4A1Feature request\U0001F4A1"
about: Suggest an idea for this project

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/--individual-troubleshooting-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: "\U0001F198Individual troubleshooting help"
about: Getting help with your own individual setup of Nightscout

---

Having issues getting Nightscout up and running? Instead of creating an issue here, please use one of the existing support channels for Nightscout.

The main support channel is on Facebook: please join the CGM In The Cloud Facebook group (https://www.facebook.com/groups/cgminthecloud) and start a post there.

**Suggestions to include in your post when you are asking for help:**
1. Include what you are trying to do: ("*I am trying to set up Nightscout for the first time.*")
2. Include which step you are on and what the problem is: ("*I deployed on Heroku, but I'm not seeing any BG data.*")
3. If possible, include a link to the version of documentation you are following ("*I'm following the OpenAPS Nightscout setup docs (https://openaps.readthedocs.io/en/latest/docs/While%20You%20Wait%20For%20Gear/nightscout-setup.html#nightscout-setup-with-heroku)*")

Other places you can find support and assistance for Nightscout include Gitter's [nightscout/public](https://gitter.im/nightscout/public) channel.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.11.x
8.12.x
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
language: node_js
os: osx
node_js:
- "10"
- "8"
os:
- osx
before_install:
- if [[ `npm --version` != "5.8.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 Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Minimum browser requirements for viewing the site:

Windows installation software requirements:

- [Node.js](http://nodejs.org/) Latest Node 8 LTS (Node 8.11.3 or later). Use [Install instructions for Node](https://nodejs.org/en/download/package-manager/) or use `setup.sh`)
- [Node.js](http://nodejs.org/) Latest Node 8 LTS (Node 8.12.0 or later). 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
1 change: 0 additions & 1 deletion lib/api/profile/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ function configure (app, wares, ctx) {
res.json(created.ops);
console.log('Profile created', created);
}

});
});

Expand Down
5 changes: 5 additions & 0 deletions lib/authorization/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ function init (env, ctx) {
obj.created_at = (new Date()).toISOString();
}
collection.insert(obj, function (err, doc) {
if (err != null && err.message) {
console.log('Data insertion error', err.message);
fn(err.message, null);
return;
}
storage.reload(function loaded() {
fn(null, doc.ops);
});
Expand Down
8 changes: 4 additions & 4 deletions lib/language.js
Original file line number Diff line number Diff line change
Expand Up @@ -3002,7 +3002,7 @@ function init() {
,fi: 'Käytä korjausannosta laskentaan'
,nb: 'Bruk blodsukkerkorrigering i beregning'
,pl: 'Użyj BG w obliczeniach korekty'
,ru: 'При рассчете проводите коррекцию на СК'
,ru: 'При расчете проводите коррекцию на СК'
,sk: 'Použite korekciu na glykémiu'
,nl: 'Gebruik BG in berekeningen'
,ko: '계산에 보정된 혈당을 사용하세요.'
Expand Down Expand Up @@ -3163,7 +3163,7 @@ function init() {
,fi: 'Käytä hiilihydraattikorjausta laskennassa'
,nb: 'Bruk karbohydratkorrigering i beregning'
,pl: 'Użyj wartość węglowodanów w obliczeniach korekty'
,ru: 'Пользуйтесь коррекцией углеводов при рассчете'
,ru: 'Пользуйтесь коррекцией углеводов при расчете'
,sk: 'Použite korekciu na sacharidy'
,nl: 'Gebruik KH correctie in berekening'
,ko: '계산에 보정된 탄수화물을 사용하세요.'
Expand All @@ -3186,7 +3186,7 @@ function init() {
,fi: 'Käytä aktiivisia hiilihydraatteja laskennassa'
,nb: 'Benytt aktive karbohydrater i beregning'
,pl: 'Użyj COB do obliczenia korekty'
,ru: 'Учитывайте активные углеводы при рассчете (COB)'
,ru: 'Учитывайте активные углеводы при расчете (COB)'
,sk: 'Použite korekciu na COB'
,nl: 'Gebruik ingenomen KH in berekening'
,ko: '계산에 보정된 COB를 사용하세요.'
Expand All @@ -3209,7 +3209,7 @@ function init() {
,fi: 'Käytä aktiviivista insuliinia laskennassa'
,nb: 'Bruk aktivt insulin i beregningen'
,pl: 'Użyj IOB w obliczeniach'
,ru: 'Учитывайте активный инсулин при рассчете (IOB)'
,ru: 'Учитывайте активный инсулин при расчете (IOB)'
,sk: 'Použite IOB vo výpočte'
,nl: 'Gebruik IOB in berekening'
,ko: '계산에 IOB를 사용하세요.'
Expand Down
1 change: 1 addition & 0 deletions lib/plugins/alexa-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ To add Alexa support for a plugin, [check this out](#adding-alexa-support-to-a-p

1. Your Nightscout site needs to be new enough that it supports the `alexa` plugin. It needs to be [version 0.9.1 (Grilled Cheese)](https://github.com/nightscout/cgm-remote-monitor/releases/tag/0.9.1) or later. See [updating my version](https://github.com/nightscout/cgm-remote-monitor#updating-my-version) if you need a newer version.
1. Add `alexa` to the list of plugins in your `ENABLE` setting. ([Environment variables](https://github.com/nightscout/cgm-remote-monitor#environment) are set in the configuration section for your monitor. Typically Azure, Heroku, etc.)
1. The Alexa plugin pulls its units preferences from your site's defaults. If you don't have a `DISPLAY_UNITS` entry, it will default to `mg/dl`. If you want it to use mmol/L, make sure you have a `DISPLAY_UNITS` line, and set it to `mmol` (*not* `mmol/l`).

## Create Your Alexa Skill

Expand Down
2 changes: 1 addition & 1 deletion lib/plugins/xdrip-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ function init(ctx) {
result.level = levels.WARN;
}

if (sensorInfo.xdripjs.voltageb && (sensorInfo.xdripjs.voltageb < prefs.warnBatV)) {
if (sensorInfo.xdripjs.voltageb && (sensorInfo.xdripjs.voltageb < (prefs.warnBatV - 10))) {
sendNotification = true;
message = 'CGM Battery B Low Voltage: ' + sensorInfo.xdripjs.voltageb;
title = 'CGM Battery Low';
Expand Down
5 changes: 5 additions & 0 deletions lib/server/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ function storage (env, ctx) {
function create (obj, fn) {
obj.created_at = (new Date( )).toISOString( );
api().insert(obj, function (err, doc) {
if (err != null && err.message) {
console.log('Activity data insertion error', err.message);
fn(err.message, null);
return;
}
fn(null, doc.ops);
});
}
Expand Down
5 changes: 5 additions & 0 deletions lib/server/devicestatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ function storage (collection, ctx) {
obj.created_at = (new Date()).toISOString();
}
api().insert(obj, function (err, doc) {
if (err != null && err.message) {
console.log('Error inserting the device status object', err.message);
fn(err.message, null);
return;
}
fn(null, doc.ops);
ctx.bus.emit('data-received');
});
Expand Down
5 changes: 5 additions & 0 deletions lib/server/food.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ function storage (env, ctx) {
function create (obj, fn) {
obj.created_at = (new Date( )).toISOString( );
api().insert(obj, function (err, doc) {
if (err != null && err.message) {
console.log('Data insertion error', err.message);
fn(err.message, null);
return;
}
fn(null, doc.ops);
});
}
Expand Down
12 changes: 12 additions & 0 deletions lib/server/websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,10 @@ function init (env, ctx, server) {
// if not found create new record
console.log(LOG_DEDUP + 'Adding new record');
ctx.store.collection(collection).insert(data.data, function insertResult (err, doc) {
if (err != null && err.message) {
console.log('treatments data insertion error: ', err.message);
return;
}
if (callback) {
callback(doc.ops);
}
Expand Down Expand Up @@ -367,13 +371,21 @@ function init (env, ctx, server) {
}
});
ctx.store.collection(collection).insert(data.data, function insertResult (err, doc) {
if (err != null && err.message) {
console.log('devicestatus insertion error: ', err.message);
return;
}
if (callback) {
callback(doc.ops);
}
ctx.bus.emit('data-received');
});
} else {
ctx.store.collection(collection).insert(data.data, function insertResult (err, doc) {
if (err != null && err.message) {
console.log(data.collection + ' insertion error: ', err.message);
return;
}
if (callback) {
callback(doc.ops);
}
Expand Down
3 changes: 2 additions & 1 deletion lib/storage/mongo-storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ function init (env, cb, forceNewConnection) {

console.log('Setting up new connection to MongoDB');
var timeout = 30 * 1000;
var options = { reconnectInterval: 10000, reconnectTries: 500, connectTimeoutMS: timeout, socketTimeoutMS: timeout };
var options = { reconnectInterval: 10000, reconnectTries: 500, connectTimeoutMS: timeout,
socketTimeoutMS: timeout, useNewUrlParser: true };

var connect_with_retry = function(i) {
return MongoClient.connect(env.storageURI, options, function connected(err, client) {
Expand Down

0 comments on commit aca7565

Please sign in to comment.