forked from marva/sumorobot-web
Update sumorobot.js
This commit is contained in:
parent
f9dce03f27
commit
93ea803a5b
@ -55,9 +55,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.6)));
|
||||
$("#battery").html(battery + "");
|
||||
//$("#bar").html("Connected");
|
||||
$("#bar").addClass("connected");
|
||||
};
|
||||
/* when there is an WebSocket error */
|
||||
|
Loading…
Reference in New Issue
Block a user