remove battery indication

This commit is contained in:
Silver Kuusik 2017-11-07 23:24:37 +01:00
parent 13f4bb8346
commit 3a1a035389
2 changed files with 2 additions and 2 deletions

View File

@ -14,7 +14,7 @@
<script src="sumorobot.js"></script> <script src="sumorobot.js"></script>
</head> </head>
<body> <body>
<div id="bar">Battery: <span id="battery">0</span>%</div> <div id="bar">Disconnected<span id="battery"></span></div>
<div id="stream"> <div id="stream">
<div class="btn-group btn-group-justified"> <div class="btn-group btn-group-justified">
<a href="#" class="btn btn-lg btn-danger btn-close">Close</a> <a href="#" class="btn btn-lg btn-danger btn-close">Close</a>

View File

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