forked from marva/sumorobot-web
Update sumorobot.js
This commit is contained in:
parent
e34572a8f2
commit
bef66dfbda
@ -55,7 +55,7 @@ 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.0) * 100) / (4.2 - 3.6)));
|
||||
battery = Math.round((((battery - 3.0) * 100) / (4.2 - 3.0)));
|
||||
$("#battery").html(battery + "%");
|
||||
$("#bar").html("Battery");
|
||||
$("#bar").addClass("connected");
|
||||
|
Loading…
Reference in New Issue
Block a user