Update sumorobot.js

This commit is contained in:
Silver Kuusik 2017-11-14 14:57:47 +01:00 committed by GitHub
parent 93ea803a5b
commit e34572a8f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

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