Skip to content

Commit

Permalink
Merge branch 'dev' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
JaredDRobbins authored Jan 3, 2025
2 parents 605cd7d + 7d209bc commit 5081433
Show file tree
Hide file tree
Showing 15 changed files with 684 additions and 631 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x]
node-version: [14.x, 16.x, 20, lts/*]
mongodb-version: [4.4, 5.0, 6.0]

steps:
Expand Down Expand Up @@ -87,4 +87,4 @@ jobs:
platforms: ${{ env.PLATFORMS }}
tags: |
${{ env.DOCKER_IMAGE }}:${{ steps.package-version.outputs.current-version }}
${{ env.DOCKER_IMAGE }}:latest
${{ env.DOCKER_IMAGE }}:latest
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md)
- [`override` (Override Mode)](#override-override-mode)
- [`xdripjs` (xDrip-js)](#xdripjs-xdrip-js)
- [`alexa` (Amazon Alexa)](#alexa-amazon-alexa)
- [`googlehome` (Google Home/DialogFLow)](#googlehome-google-homedialogflow)
- [`googlehome` (Google Home/DialogFLow)](#googlehome-google-homedialogflow) [broken]
- [`speech` (Speech)](#speech-speech)
- [`cors` (CORS)](#cors-cors)
- [Extended Settings](#extended-settings)
Expand Down Expand Up @@ -666,9 +666,11 @@ 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)
##### `googlehome` (Google Home/DialogFLow) [broken]
Integration with Google Home (via DialogFlow), [detailed setup instructions](docs/plugins/googlehome-plugin.md)

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.

##### `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
3 changes: 3 additions & 0 deletions docs/plugins/googlehome-plugin.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# The Google Assistant integration is broken!
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.

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
Expand Down
10 changes: 8 additions & 2 deletions lib/plugins/openaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ function init (ctx) {
function addSuggestion () {
if (prop.lastSuggested) {
var bg = prop.lastSuggested.bg;
var units = sbx.data.profile.getUnits();
var units = sbx.settings.units;

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

if ('enacted' === prop.status.code) {
var canceled = prop.lastEnacted.rate === 0 && prop.lastEnacted.duration === 0;
var bg = prop.lastEnacted.bg;
var units = sbx.settings.units;

if (units === 'mmol') {
bg = Math.round(bg / consts.MMOL_TO_MGDL * 10) / 10;
}

var valueParts = [
valueString('BG: ', prop.lastEnacted.bg)
valueString('BG: ', bg)
, ', <b>Temp Basal' + (canceled ? ' Canceled' : ' Started') + '</b>'
, canceled ? '' : ' ' + prop.lastEnacted.rate.toFixed(2) + ' for ' + prop.lastEnacted.duration + 'm'
, valueString(', ', prop.lastEnacted.reason)
Expand Down
2 changes: 1 addition & 1 deletion lib/server/booterror.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function bootError(env, ctx) {
return '<dt><b>' + obj.desc + '</b></dt><dd>' + message.replace(/\\n/g, '<br/>') + '</dd>';
}).join(' ');

res.render('error.html', {
res.status(500).render('error.html', {
errors,
locals
});
Expand Down
2 changes: 1 addition & 1 deletion lib/server/bootevent.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function boot (env, language) {

const isLTS = process.release.lts ? true : false;

if (isLTS && (semver.satisfies(nodeVersion, '^20.0.0') || semver.satisfies(nodeVersion, '^18.0.0') || semver.satisfies(nodeVersion, '^16.0.0') || semver.satisfies(nodeVersion, '^14.0.0'))) {
if (isLTS || (semver.satisfies(nodeVersion, '^20.0.0') || semver.satisfies(nodeVersion, '^18.0.0') || semver.satisfies(nodeVersion, '^16.0.0') || semver.satisfies(nodeVersion, '^14.0.0'))) {
//Latest Node 14 LTS and Node 16 LTS are recommended and supported.
//Require at least Node 14 without known security issues
console.debug('Node LTS version ' + nodeVersion + ' is supported');
Expand Down
28 changes: 25 additions & 3 deletions lib/server/loop.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,36 @@ function init (env, ctx) {
notification.payload = payload;
notification.interruptionLevel = "time-sensitive"

provider.send(notification, [loopSettings.deviceToken]).then( (response) => {
provider.send(notification, [loopSettings.deviceToken]).then((response) => {
if (response.sent && response.sent.length > 0) {
completion();
} else {
console.log("APNs delivery failed:", response.failed)
completion("APNs delivery failed: " + response.failed[0].response.reason);
console.log("APNs delivery failed:", response.failed);

// Check if response.failed and response.failed[0] are defined
if (response.failed && response.failed.length > 0) {
const failedResponse = response.failed[0];
const reason = failedResponse.response && failedResponse.response.reason
? failedResponse.response.reason
: 'Unknown reason';

// Provide detailed debugging information
const errorMessage = `APNs delivery failed: ${reason}`;
console.error(errorMessage, failedResponse);
completion(errorMessage);
} else {
// Handle the case where response.failed is undefined or empty
const errorMessage = 'APNs delivery failed: No failure details available.';
console.error(errorMessage, response);
completion(errorMessage);
}
}
}).catch((error) => {
// Catch any other unexpected errors
console.error('Unexpected error during APNs delivery:', error);
completion(`APNs delivery failed: ${error.message || 'Unknown error'}`);
});

};

return loop();
Expand Down
28 changes: 14 additions & 14 deletions translations/ar_SA.json
Original file line number Diff line number Diff line change
Expand Up @@ -329,15 +329,15 @@
"Edit treatment": "تعديل المعالجة",
"Duration": "المدة",
"Duration in minutes": "المدة بالدقائق",
"Temp Basal": "درجة الحرارة القاعدية",
"Temp Basal Start": "بداية درجة الحرارة القاعدية",
"Temp Basal End": "نهاية درجة الحرارة القاعدية",
"Temp Basal": "الجرعة القاعدية المؤقتة",
"Temp Basal Start": "بداية الجرعة القاعدية المؤقتة",
"Temp Basal End": "نهاية الجرعة القاعدية المؤقتة",
"Percent": "بالمائة",
"Basal change in %": "التغيير الأساسي بالمائة",
"Basal value": "القيمة الأساسية",
"Absolute basal value": "القيمة الأساسية المطلقة",
"Announcement": "إعلان",
"Loading temp basal data": "تحميل درجة حرارة البيانات القاعدية",
"Loading temp basal data": "جارٍ تحميل بيانات الجرعة القاعدية المؤقتة",
"Save current record before changing to new?": "حفظ السجل الحالي قبل التغيير إلى جديد؟",
"Profile Switch": "تبديل الملف الشخصي",
"Profile": "الملف الشخصي",
Expand Down Expand Up @@ -413,8 +413,8 @@
"Targets": "الأهداف",
"Bolus insulin:": "جرعة أنسولين:",
"Base basal insulin:": "الأنسولين القاعدي الأساسي:",
"Positive temp basal insulin:": "الأنسولين القاعدي ذو درجة الحرارة الإيجابية:",
"Negative temp basal insulin:": "الأنسولين القاعدي ذو درجة الحرارة السلبية:",
"Positive temp basal insulin:": "الأنسولين القاعدي المؤقت الإيجابي:",
"Negative temp basal insulin:": "الأنسولين القاعدي المؤقت السلبي:",
"Total basal insulin:": "إجمالي الأنسولين القاعدي:",
"Total daily insulin:": "إجمالي الأنسولين اليومي:",
"Unable to save Role": "تعذر حفظ الدور",
Expand Down Expand Up @@ -452,10 +452,10 @@
"Current Carb Ratio": "نسبة الكربوهيدرات الحالية",
"Basal timezone": "المنطقة الزمنية القاعدية",
"Active profile": "ملف نشط",
"Active temp basal": "درجة الحرارة القاعدية النشطة",
"Active temp basal start": "بداية درجة الحرارة القاعدية النشطة",
"Active temp basal duration": "مدة درجة الحرارة القاعدية النشطة",
"Active temp basal remaining": "درجة الحرارة القاعدية النشطة المتبقية",
"Active temp basal": "الجرعة القاعدية المؤقتة النشطة",
"Active temp basal start": "بداية الجرعة القاعدية المؤقتة النشطة",
"Active temp basal duration": "مدة الجرعة القاعدية المؤقتة النشطة",
"Active temp basal remaining": "الوقت المتبقي للجرعة القاعدية المؤقتة النشطة",
"Basal profile value": "قيمة الملف القاعدي",
"Active combo bolus": "جرعة تركيبة نشطة",
"Active combo bolus start": "بداية جرعة تركيبة نشطة",
Expand Down Expand Up @@ -492,8 +492,8 @@
"or adjust basal": "أو ضبط القاعدية",
"Check BG using glucometer before correcting!": "-> تحقق من نسبة السكر في الدم باستخدام مقياس السكر قبل التصحيح!",
"Basal reduction to account %1 units:": "التخفيض القاعدي لحساب%1 وحدة:",
"30m temp basal": "30 متر من درجة الحرارة القاعدية",
"1h temp basal": "ساعة واحدة من درجة الحرارة القاعدية",
"30m temp basal": "جرعة قاعدية مؤقتة لمدة 30 دقيقة",
"1h temp basal": "جرعة قاعدية مؤقتة لمدة ساعة واحدة",
"Cannula change overdue!": "تغيير قنية متأخر!",
"Time to change cannula": "ميعاد تغيير القنية الطبية",
"Change cannula soon": "تغيير القنية الطبية قريبا",
Expand Down Expand Up @@ -578,7 +578,7 @@
"virtAsstTitleDelta": "دلتا جلوكوز الدم",
"virtAsstStatus": "%1 و%2 اعتبارًا من %3.",
"virtAsstBasal": "%1 القاعدي الحالي هو %2 وحدة في الساعة",
"virtAsstBasalTemp": "%1 درجة الحرارة القاعدية من %2 وحدة في الساعة ستنتهي %3",
"virtAsstBasalTemp": "%1 جرعة قاعدية مؤقتة من %2 وحدة في الساعة ستنتهي %3",
"virtAsstIob": "ولديك %1 من الأنسولين النشط.",
"virtAsstIobIntent": "لديك %1 من الأنسولين النشط",
"virtAsstIobUnits": "%1 وحدة من",
Expand Down Expand Up @@ -682,7 +682,7 @@
"Previous day": "اليوم السابق",
"Next day": "اليوم التالي",
"Next": "التالي",
"Temp basal delta": "درجة حرارة دلتا الأساسية",
"Temp basal delta": "تغير الجرعة القاعدية المؤقتة",
"Authorized by token": "مصرح به من قبل رمز",
"Auth role": "دور المصادقة",
"view without token": "عرض بدون رمز",
Expand Down
3 changes: 2 additions & 1 deletion translations/es_ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
"View all treatments": "Visualizar todos los tratamientos",
"Enable Alarms": "Activar las alarmas",
"Pump Battery Change": "Cambio batería bomba",
"Pump Battery Age": "Edad de la batería en la bomba",
"Pump Battery Age": "Edad de la batería de la bomba",
"Pump Battery Low Alarm": "Alarma de Bomba Baja",
"Pump Battery change overdue!": "Cambio de batería de bomba atrasado!",
"When enabled an alarm may sound.": "Cuando estén activas, una alarma podrá sonar",
Expand Down Expand Up @@ -704,4 +704,5 @@
"Weak API_SECRET detected. Please use a mix of small and CAPITAL letters, numbers and non-alphanumeric characters such as !#%&/ to reduce the risk of unauthorized access. The minimum length of the API_SECRET is 12 characters.": "Detectada API_SECRET débil. Por favor, utilice una mezcla de letras en minúscula y en mayúscula, números y caracteres no alfanuméricos como !#%&/ para reducir el riesgo de acceso no autorizado. La longitud mínima de la API_SECRET es de 12 caracteres.",
"less than 1": "menos de 1",
"MongoDB password and API_SECRET match. This is a really bad idea. Please change both and do not reuse passwords across the system.": "La contraseña de MongoDB y la API_SECRET coinciden. Esto es una muy mala idea. Por favor, cambie ambas contraseñas y no reutilice contraseñas en el sistema."
"virtAsstLaunch":"¿Qué quieres saber de Nightscout?"
}
Loading

0 comments on commit 5081433

Please sign in to comment.