bthrm - Directly apply changes if custom mode is active
parent
258fa141be
commit
c6489b1044
|
|
@ -17,6 +17,15 @@
|
|||
var settings;
|
||||
readSettings();
|
||||
|
||||
function applyCustomSettings(){
|
||||
writeSettings("enabled",true);
|
||||
writeSettings("replace",settings.custom_replace);
|
||||
writeSettings("debuglog",settings.custom_debuglog);
|
||||
writeSettings("startWithHrm",settings.custom_startWithHrm);
|
||||
writeSettings("allowFallback",settings.custom_allowFallback);
|
||||
writeSettings("fallbackTimeout",settings.custom_fallbackTimeout);
|
||||
}
|
||||
|
||||
function buildMainMenu(){
|
||||
var mainmenu = {
|
||||
'': { 'title': 'Bluetooth HRM' },
|
||||
|
|
@ -48,12 +57,7 @@
|
|||
writeSettings("allowFallback",false);
|
||||
break;
|
||||
case 3:
|
||||
writeSettings("enabled",true);
|
||||
writeSettings("replace",settings.custom_replace);
|
||||
writeSettings("debuglog",settings.custom_debuglog);
|
||||
writeSettings("startWithHrm",settings.custom_startWithHrm);
|
||||
writeSettings("allowFallback",settings.custom_allowFallback);
|
||||
writeSettings("fallbackTimeout",settings.custom_fallbackTimeout);
|
||||
applyCustomSettings();
|
||||
break;
|
||||
}
|
||||
writeSettings("mode",v);
|
||||
|
|
@ -141,6 +145,7 @@
|
|||
format: v => settings.custom_replace ? "On" : "Off",
|
||||
onchange: v => {
|
||||
writeSettings("custom_replace",v);
|
||||
if (settings.mode == 3) applyCustomSettings();
|
||||
}
|
||||
},
|
||||
'Start w. HRM': {
|
||||
|
|
@ -148,6 +153,7 @@
|
|||
format: v => settings.custom_startWithHrm ? "On" : "Off",
|
||||
onchange: v => {
|
||||
writeSettings("custom_startWithHrm",v);
|
||||
if (settings.mode == 3) applyCustomSettings();
|
||||
}
|
||||
},
|
||||
'HRM Fallback': {
|
||||
|
|
@ -155,6 +161,7 @@
|
|||
format: v => settings.custom_allowFallback ? "On" : "Off",
|
||||
onchange: v => {
|
||||
writeSettings("custom_allowFallback",v);
|
||||
if (settings.mode == 3) applyCustomSettings();
|
||||
}
|
||||
},
|
||||
'Fallback Timeout': {
|
||||
|
|
@ -165,6 +172,7 @@
|
|||
format: v=>v+"s",
|
||||
onchange: v => {
|
||||
writeSettings("custom_fallbackTimout",v*1000);
|
||||
if (settings.mode == 3) applyCustomSettings();
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue