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