merge commits

This commit is contained in:
Silver Kuusik 2017-12-20 01:37:42 +01:00
commit 1db25f2260
1 changed files with 3 additions and 3 deletions

View File

@ -59,9 +59,9 @@ Sumorobot.prototype.connect = function() {
var data = evt.data.replace(/'/g, '"').toLowerCase();
console.log(data);
var battery = JSON.parse(data)["battery_voltage"];
battery = Math.round((((battery - 3.6) * 100) / (4.2 - 3.6)));
//$("#battery").html(battery + "");
$("#bar").html("Connected");
battery = Math.round((((battery - 3.0) * 100) / (4.2 - 3.0)));
$("#battery").html(battery + "%");
//$("#bar").html("Battery");
$("#bar").addClass("connected");
};
/* when there is an WebSocket error */