Changed battry percentage to voltage

This commit is contained in:
Igor Nurullaev
2019-09-06 17:26:47 +03:00
parent 7c90b9c76d
commit 416431dcca
3 changed files with 4 additions and 4 deletions

View File

@@ -112,7 +112,7 @@ def check_bat_v(item):
def check_bat_p(item):
if not item:
return None
if float(item) > 30: # todo config
if float(item) > 10: # todo config
return True
else:
return False

View File

@@ -15,7 +15,7 @@ def selfcheck_selected():
copter.refresh()
data = {
'anim_id': copter.anim_id,
'batt_voltage': ((float(copter.batt_voltage) - 3.2) / (4.2 - 3.2)) * 100,
'batt_voltage': copter.batt_voltage,
'cell_voltage': copter.cell_voltage,
'selfcheck': copter.selfcheck,
'time': round(float(copter.time) - time(), 3),
@@ -33,7 +33,7 @@ def selfcheck_all():
copter.refresh()
data.append({
'anim_id': copter.anim_id,
'batt_voltage': ((float(copter.batt_voltage) - 3.2) / (4.2 - 3.2)) * 100,
'batt_voltage': copter.batt_voltage,
'cell_voltage': copter.cell_voltage,
'selfcheck': copter.selfcheck,
'ip': copter.ip,

View File

@@ -52,7 +52,7 @@ var table = new Tabulator("#copters-table", {
{
title: "Batt voltage", field: "batt_voltage", formatter: function (cell) {
let voltage = cell.getValue();
if (parseFloat(voltage) > 30) {
if (parseFloat(voltage) > 10) {
cell.getElement().style.background = green;
} else if (voltage) {
cell.getElement().style.background = red;