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

speech and Warning, Pump Battery Low Alarm issue during Clock testing... #3709

Merged
merged 9 commits into from
Jul 26, 2018
1 change: 1 addition & 0 deletions lib/client/browser-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function init (client, serverSettings, $) {
$('#alarm-timeagowarnmins-browser').val(settings.alarmTimeagoWarnMins);
$('#alarm-timeagourgent-browser').prop('checked', settings.alarmTimeagoUrgent);
$('#alarm-timeagourgentmins-browser').val(settings.alarmTimeagoUrgentMins);
$('#alarm-pumpbatterylow-browser').prop('checked', settings.alarmPumpBatteryLow);

$('#nightmode-browser').prop('checked', settings.nightMode);
$('#editmode-browser').prop('checked', settings.editMode);
Expand Down
17 changes: 10 additions & 7 deletions lib/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -596,13 +596,16 @@ client.load = function load(serverSettings, callback) {
playAlarm(audio);
$(this).addClass('playing');
});

var speechPlugin = client.plugins.enabledPlugins['speech'];

if (speechPlugin) {
speechPlugin.say(alarmMessage);
}


//TODO: temporary disabled becaused it throws Uncaught TypeError: Cannot read property 'speech' of undefined if speech is not in ENABLE, https://github.com/nightscout/cgm-remote-monitor/pull/3709
//var speechEnabled = client.plugins.isEnabled('speech') ;
//if (speechEnabled) {
// var speechPlugin = client.plugins.enabledPlugins['speech'];
// if (speechPlugin) {
// speechPlugin.say(alarmMessage);
// }
//}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this bit

}

container.addClass('alarming').addClass(file === urgentAlarmSound ? 'urgent' : 'warning');
Expand Down
79 changes: 48 additions & 31 deletions lib/language.js
Original file line number Diff line number Diff line change
Expand Up @@ -1306,6 +1306,9 @@ function init() {
,ko: '시간 통계'
,zh_cn: '每小时状态'
}
,'netIOB stats': { // hourlystats
nl: 'netIOB stats'
}
,'Weekly success' : {
cs: 'Statistika po týdnech'
,de: 'Wöchentlicher Erfolg'
Expand Down Expand Up @@ -5138,6 +5141,9 @@ function init() {
,zh_cn: '启用报警'
,zh_tw: '啟用報警'
}
,"Pump Battery Low Alarm" : {
nl: "Pompbatterij bijna leeg Alarm"
}
,'When enabled an alarm may sound.' : {
cs: 'Při povoleném alarmu zní zvuk'
,de: 'Sofern eingeschaltet ertönt ein Alarm'
Expand Down Expand Up @@ -5253,7 +5259,7 @@ function init() {
,pl: 'Uwaga: Alarm hipoglikemii'
,ru: 'Внимание: низкая гликемия'
,sk: 'Naliehavý alarm nízkej glykémie'
,nl: 'Urgent alarm lage BG'
,nl: 'Urgent Alarm lage BG'
,ko: '긴급 저혈당 알람'
,zh_cn: '血糖过低报警'
,zh_tw: '血糖過低報警'
Expand All @@ -5276,7 +5282,7 @@ function init() {
,pl: 'Ostrzeżenie: brak odczytów'
,ru: 'Предупреждение: старые данные'
,sk: 'Varovanie: Zastaralé dáta'
,nl: 'Gegevens verouderd: Waarschuwing'
,nl: 'Waarschuwing Oude gegevens na'
,ko: '손실 데이터 : 경고'
,zh_cn: '数据过期:提醒'
,zh_tw: '數據過期:提醒'
Expand All @@ -5299,7 +5305,7 @@ function init() {
,pl: 'Uwaga: brak odczytów'
,ru: 'Внимание: старые данные'
,sk: 'Naliehavé: Zastaralé dáta'
,nl: 'URGENT Gegevens verouderd'
,nl: 'Urgente Waarschuwing Oude gegevens na'
,ko: '손실 데이터 : 긴급'
,zh_cn: '数据过期:警告'
,zh_tw: '數據過期:警告'
Expand Down Expand Up @@ -11456,28 +11462,39 @@ function init() {
,sv: 'Protein [g]'
},
'Energy [kJ]': {
cs: 'Energie [kJ]'
,de: 'Energie [kJ]'
, fi: 'Energia [kJ]'
, nl: 'Energie [kJ]'
, es: 'Energía [Kj]'
,fr: 'Énergie [kJ]'
,ro: 'Energie [g]'
,ru: 'энергетика'
,it: 'Energia [kJ]'
,sv: 'Energi [kJ]'
}
,
'Clock View': {
cs: 'Hodiny'
,fi: 'Kellonäkymä'
,nl: 'Klokweergave'
,es: 'Vista del reloj'
,fr: 'Vue Horloge'
,ro: 'Vedere tip ceas'
,ru: 'цифры крупно'
,it: 'Vista orologio'
,sv: 'Visa klocka'
cs: 'Energie [kJ]'
,de: 'Energie [kJ]'
,fi: 'Energia [kJ]'
,es: 'Energía [Kj]'
,fr: 'Énergie [kJ]'
,ro: 'Energie [g]'
,ru: 'энергетика'
,it: 'Energia [kJ]'
,nl: 'Energie [kJ]'
,sv: 'Energi [kJ]'
},
'Clock Views:': {
cs: 'Hodiny:'
,fi: 'Kellonäkymä:'
,nl: 'Klokweergave:'
,es: 'Vista del reloj:'
,fr: 'Vue Horloge:'
,ro: 'Vedere tip ceas:'
,ru: 'цифры крупно:'
,it: 'Vista orologio:'
,sv: 'Visa klocka:'
},
'Clock': {
fr: 'L\'horloge'
,nl: 'Klok'
},
'Color': {
fr: 'Couleur'
,nl: 'Kleur'
},
'Simple': {
fr: 'Simple'
,nl: 'Simpel'
}
,
'TDD average': {
Expand All @@ -11491,30 +11508,30 @@ function init() {
cs: 'Průměrné množství sacharidů'
, fi: 'Hiilihydraatit keskiarvo'
, nl: 'Gemiddelde koolhydraten per dag'
,sv: 'Genomsnittlig mängd kolhydrater per dag'
, sv: 'Genomsnittlig mängd kolhydrater per dag'
}
,
'Eating Soon': {
fi: 'Ruokailu pian'
, nl: 'Pre-maaltijd modus'
,sv: 'Äter snart'
, sv: 'Äter snart'
}
,
'Last entry {0} minutes ago': {
fi: 'Edellinen verensokeri {0} minuuttia sitten'
, nl: 'Laatste waarde {0} minuten geleden'
,sv: 'Senaste värde {0} minuter sedan'
, sv: 'Senaste värde {0} minuter sedan'
}
,
'change': {
fi: 'muutos'
, nl: 'wijziging'
,sv: 'byta'
, sv: 'byta'
},
'Speech': {
fi: 'Puhe'
, nl: 'Spraak'
,sv: 'Tal'
, sv: 'Tal'
}

};
Expand Down Expand Up @@ -11574,7 +11591,7 @@ function init() {
lang = newlang;

language.languages.forEach(function (l) {
if (l.code == lang && l.speechCode) language.speechCode = l.speechCode;
if (l.code == lang && l.speechCode) language.speechCode = l.speechCode;
});

return language();
Expand Down
1 change: 1 addition & 0 deletions lib/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function init ( ) {
, alarmTimeagoWarnMins: 15
, alarmTimeagoUrgent: true
, alarmTimeagoUrgentMins: 30
, alarmPumpBatteryLow: false
, language: 'en'
, scaleY: 'log'
, showPlugins: ''
Expand Down
10 changes: 10 additions & 0 deletions static/css/drawer.css
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,10 @@ ul.navigation {
display: block;
}

.navigation li.multilink {
display: flex;
}

.navigation a {
text-decoration: none;
background-color: #808080;
Expand All @@ -327,6 +331,12 @@ ul.navigation {
margin: 10px 0;
}

.navigation a.multilink {
display: flex;
flex-grow: 1;
justify-content: center;
}

.navigation a:hover {
background-color: #989898;
}
Expand Down
8 changes: 7 additions & 1 deletion views/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,12 @@
<li class="profilecontrol"><a id="editprofilelink" href="profile" target="profileeditor" class="translate">Profile Editor</a></li>
<li class="foodcontrol"><a id="editfoodlink" href="food" target="foodeditor" class="translate">Food Editor</a></li>
<li><a id="admintoolslink" href="admin" target="admintools" class="translate">Admin Tools</a></li>
<li><a id="clocklink" href="bgclock.html" target="admintools" class="translate">Clock View</a></li>
<li class="multilink">
<a class="translate">Clock Views:</a>
<a id="bgclocklink" href="bgclock.html" class="translate multilink">Clock</a>
<a id="clockcolorlink" href="clock-color.html" class="translate multilink">Color</a>
<a id="clocklink" href="clock.html" class="translate multilink">Simple</a>
</li>
</ul>
<fieldset class="browserSettings">
<legend class="translate icon-cog">Settings</legend>
Expand Down Expand Up @@ -227,6 +232,7 @@
<input type="text" id="alarm-timeagourgentmins-browser" class="timeago-mins" value="30"/>
<span class="translate">mins</span>
</dd>
<dd><input type="checkbox" id="alarm-pumpbatterylow-browser" /><label for="alarm-pumpbatterylow-browser" class="translate">Pump Battery Low Alarm</label></dd>
</dl>
<dl class="toggle">
<dt><span class="translate">Night Mode</span> <a class="tip" original-title="When enabled the page will be dimmed from 10pm - 6am."><i class="icon-help-circled"></i></a></dt>
Expand Down