Skip to content

Commit 45e6aa0

Browse files
authored
Merge branch 'dev' into wip/bewest/restore-8026
2 parents e60e093 + e74f53c commit 45e6aa0

18 files changed

Lines changed: 69 additions & 29 deletions

File tree

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
strategy:
1818
matrix:
19-
node-version: [14.x, 16.x]
19+
node-version: [14.x, 16.x, 20, lts/*]
2020
mongodb-version: [4.4, 5.0, 6.0]
2121

2222
steps:
@@ -87,4 +87,4 @@ jobs:
8787
platforms: ${{ env.PLATFORMS }}
8888
tags: |
8989
${{ env.DOCKER_IMAGE }}:${{ steps.package-version.outputs.current-version }}
90-
${{ env.DOCKER_IMAGE }}:latest
90+
${{ env.DOCKER_IMAGE }}:latest

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md)
112112
- [`override` (Override Mode)](#override-override-mode)
113113
- [`xdripjs` (xDrip-js)](#xdripjs-xdrip-js)
114114
- [`alexa` (Amazon Alexa)](#alexa-amazon-alexa)
115-
- [`googlehome` (Google Home/DialogFLow)](#googlehome-google-homedialogflow)
115+
- [`googlehome` (Google Home/DialogFLow)](#googlehome-google-homedialogflow) [broken]
116116
- [`speech` (Speech)](#speech-speech)
117117
- [`cors` (CORS)](#cors-cors)
118118
- [Extended Settings](#extended-settings)
@@ -666,9 +666,11 @@ For remote overrides, the following extended settings must be configured:
666666
##### `alexa` (Amazon Alexa)
667667
Integration with Amazon Alexa, [detailed setup instructions](docs/plugins/alexa-plugin.md)
668668

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

672+
Unfortunately this integration broke when [Google discontinued conversational actions](https://developers.google.com/assistant/ca-sunset). We'll keep this here for reference, in case it can be revived at some point in the future.
673+
672674
##### `speech` (Speech)
673675
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.
674676

@@ -750,7 +752,7 @@ For remote overrides, the following extended settings must be configured:
750752
* `ns-info` - Plugins that generate notifications at the info level will cause this event to also be triggered. It will be sent in addition to `ns-event`.
751753
* `ns-warning` - Alarms at the warning level with cause this event to also be triggered. It will be sent in addition to `ns-event`.
752754
* `ns-urgent` - Alarms at the urgent level with cause this event to also be triggered. It will be sent in addition to `ns-event`.
753-
* see the [full list of events](lib/plugins/maker-setup.md#events)
755+
* see the [full list of events](docs/plugins/maker-setup.md#events)
754756

755757

756758
### Treatment Profile

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ x-logging:
1010
services:
1111
mongo:
1212
image: mongo:4.4
13+
restart: always
1314
volumes:
1415
- ${NS_MONGO_DATA_DIR:-./mongo-data}:/data/db:cached
1516
logging: *default-logging
@@ -65,6 +66,7 @@ services:
6566

6667
traefik:
6768
image: traefik:latest
69+
restart: always
6870
container_name: 'traefik'
6971
command:
7072
- '--providers.docker=true'

docs/plugins/googlehome-plugin.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The Google Assistant integration is broken!
2+
Unfortunately this integration broke when [Google discontinued conversational actions](https://developers.google.com/assistant/ca-sunset). We'll keep this here for reference, in case it can be revived at some point in the future.
3+
14
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
25
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
36
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*

lib/client/browser-utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function init ($) {
1515
$.fn.tooltip.defaults = {
1616
fade: true
1717
, gravity: 'n'
18-
, opacity: 0.75
18+
, opacity: 0.9
1919
};
2020

2121
$('#drawerToggle').click(function(event) {

lib/client/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ client.load = function load (serverSettings, callback) {
192192

193193
client.tooltip = d3.select('body').append('div')
194194
.attr('class', 'tooltip')
195-
.style('opacity', 0);
195+
.style('display', 'none');
196196

197197
client.settings = browserSettings(client, serverSettings, $);
198198

lib/client/renderer.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function init (client, d3) {
5454
}
5555

5656
function hideTooltip () {
57-
client.tooltip.style('opacity', 0);
57+
client.tooltip.style('display', 'none');
5858
}
5959

6060
// get the desired opacity for context chart based on the brush extent
@@ -147,7 +147,7 @@ function init (client, d3) {
147147

148148
var rawbgInfo = getRawbgInfo();
149149

150-
client.tooltip.style('opacity', .9);
150+
client.tooltip.style('display', 'block');
151151
client.tooltip.html('<strong>' + translate('BG') + ':</strong> ' + client.sbx.scaleEntry(d) +
152152
(d.type === 'mbg' ? '<br/><strong>' + translate('Device') + ': </strong>' + d.device : '') +
153153
(d.type === 'forecast' && d.forecastType ? '<br/><strong>' + translate('Forecast Type') + ': </strong>' + d.forecastType : '') +
@@ -338,7 +338,7 @@ function init (client, d3) {
338338
prepareTreatCircles(treatCircles.enter().append('circle'))
339339
.attr('class', 'treatment-dot')
340340
.on('mouseover', function(d) {
341-
client.tooltip.style('opacity', .9);
341+
client.tooltip.style('display', 'block');
342342
client.tooltip.html(d.isAnnouncement ? announcementTooltip(d) : treatmentTooltip(d))
343343
.style('left', tooltipLeft())
344344
.style('top', (d3.event.pageY + 15) + 'px');
@@ -435,7 +435,7 @@ function init (client, d3) {
435435
.attr('class', 'g-duration')
436436
.attr('transform', rectTranslate)
437437
.on('mouseover', function(d) {
438-
client.tooltip.style('opacity', .9);
438+
client.tooltip.style('display', 'block');
439439
client.tooltip.html(d.isAnnouncement ? announcementTooltip(d) : treatmentTooltip(d))
440440
.style('left', tooltipLeft())
441441
.style('top', (d3.event.pageY + 15) + 'px');
@@ -640,7 +640,7 @@ function init (client, d3) {
640640
glucose = Math.round(glucose * decimals) / decimals;
641641
}
642642

643-
client.tooltip.style('opacity', .9);
643+
client.tooltip.style('display', 'block');
644644
client.tooltip.html('<strong>' + translate('Time') + ':</strong> ' + client.formatTime(getOrAddDate(treatment)) + '<br/>' + '<strong>' + translate('Treatment type') + ':</strong> ' + translate(client.careportal.resolveEventName(treatment.eventType)) + '<br/>' +
645645
(treatment.carbs ? '<strong>' + translate('Carbs') + ':</strong> ' + treatment.carbs + '<br/>' : '') +
646646
(treatment.protein ? '<strong>' + translate('Protein') + ':</strong> ' + treatment.protein + '<br/>' : '') +
@@ -667,7 +667,7 @@ function init (client, d3) {
667667
//console.log(treatment);
668668
var windowWidth = $(client.tooltip.node()).parent().parent().width();
669669
var left = d3.event.x + TOOLTIP_WIDTH < windowWidth ? d3.event.x : windowWidth - TOOLTIP_WIDTH - 10;
670-
client.tooltip.style('opacity', .9)
670+
client.tooltip.style('display', 'block')
671671
.style('left', left + 'px')
672672
.style('top', (d3.event.pageY ? d3.event.pageY + 15 : 40) + 'px');
673673

@@ -762,7 +762,7 @@ function init (client, d3) {
762762
})
763763
.on('drag', function() {
764764
//console.log(d3.event);
765-
client.tooltip.style('opacity', .9);
765+
client.tooltip.style('display', 'block');
766766
var x = Math.min(Math.max(0, d3.event.x), chart().charts.attr('width'));
767767
var y = Math.min(Math.max(0, d3.event.y), chart().focusHeight);
768768

@@ -1268,7 +1268,7 @@ function init (client, d3) {
12681268
})
12691269
.text(generateText)
12701270
.on('mouseover', function(d) {
1271-
client.tooltip.style('opacity', .9);
1271+
client.tooltip.style('display', 'block');
12721272
client.tooltip.html(profileTooltip(d))
12731273
.style('left', (d3.event.pageX) + 'px')
12741274
.style('top', (d3.event.pageY + 15) + 'px');

lib/constants.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"HTTP_BAD_REQUEST": 400,
88
"ENTRIES_DEFAULT_COUNT" : 10,
99
"PROFILES_DEFAULT_COUNT" : 10,
10-
"MMOL_TO_MGDL": 18.018018018,
10+
"MMOL_TO_MGDL": 18.01559,
1111
"ONE_DAY" : 86400000,
1212
"TWO_DAYS" : 172800000,
1313
"FIFTEEN_MINUTES": 900000,

lib/plugins/openaps.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ function init (ctx) {
392392
function addSuggestion () {
393393
if (prop.lastSuggested) {
394394
var bg = prop.lastSuggested.bg;
395-
var units = sbx.data.profile.getUnits();
395+
var units = sbx.settings.units;
396396

397397
if (units === 'mmol') {
398398
bg = Math.round(bg / consts.MMOL_TO_MGDL * 10) / 10;
@@ -478,9 +478,15 @@ function init (ctx) {
478478

479479
if ('enacted' === prop.status.code) {
480480
var canceled = prop.lastEnacted.rate === 0 && prop.lastEnacted.duration === 0;
481+
var bg = prop.lastEnacted.bg;
482+
var units = sbx.settings.units;
483+
484+
if (units === 'mmol') {
485+
bg = Math.round(bg / consts.MMOL_TO_MGDL * 10) / 10;
486+
}
481487

482488
var valueParts = [
483-
valueString('BG: ', prop.lastEnacted.bg)
489+
valueString('BG: ', bg)
484490
, ', <b>Temp Basal' + (canceled ? ' Canceled' : ' Started') + '</b>'
485491
, canceled ? '' : ' ' + prop.lastEnacted.rate.toFixed(2) + ' for ' + prop.lastEnacted.duration + 'm'
486492
, valueString(', ', prop.lastEnacted.reason)

lib/plugins/pluginbase.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function init (majorPills, minorPills, statusPills, bgStatus, tooltip) {
8484
}).join('<br/>\n');
8585

8686
pill.mouseover(function pillMouseover (event) {
87-
tooltip.style('opacity', .9);
87+
tooltip.style('display', 'block');
8888

8989
var windowWidth = $(tooltip.node()).parent().parent().width();
9090
var left = event.pageX + TOOLTIP_WIDTH < windowWidth ? event.pageX : windowWidth - TOOLTIP_WIDTH - 10;
@@ -94,7 +94,7 @@ function init (majorPills, minorPills, statusPills, bgStatus, tooltip) {
9494
});
9595

9696
pill.mouseout(function pillMouseout ( ) {
97-
tooltip.style('opacity', 0);
97+
tooltip.style('display', 'none');
9898
});
9999
} else {
100100
pill.off('mouseover');

0 commit comments

Comments
 (0)