From 93ea803a5bd7ccfa074e06e51f2c3dc20d2f97a0 Mon Sep 17 00:00:00 2001 From: Silver Kuusik Date: Tue, 14 Nov 2017 14:55:15 +0100 Subject: [PATCH] Update sumorobot.js --- sumorobot.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sumorobot.js b/sumorobot.js index 303c3df..152e17d 100755 --- a/sumorobot.js +++ b/sumorobot.js @@ -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 */