fix exit code and color
This commit is contained in:
parent
ecf5c67ffb
commit
c36eb8daae
|
@ -7,7 +7,7 @@ function batteryColor(batteryPercent) {
|
||||||
switch(batteryPercent) {
|
switch(batteryPercent) {
|
||||||
case -1: color = "green"; break;
|
case -1: color = "green"; break;
|
||||||
case -2: color = "red"; break;
|
case -2: color = "red"; break;
|
||||||
default: color = colors[~~(batteryPercent / 10 + 0.5)]; break;
|
default: color = colors[~~(batteryPercent / 10 + 0.5) - 1]; break;
|
||||||
}
|
}
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ Item {
|
||||||
connectedSources: ["headsetcontrol -bc"]
|
connectedSources: ["headsetcontrol -bc"]
|
||||||
interval: pollingrate * 1e3
|
interval: pollingrate * 1e3
|
||||||
onNewData: {
|
onNewData: {
|
||||||
if(data['exit_code'] > 0) {
|
if(data['exit code'] > 0) {
|
||||||
batteryPercent = -2;
|
batteryPercent = -2;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user