Fix battery parsing issue
This commit is contained in:
parent
1f49ed6bb0
commit
5046f4f416
@ -102,15 +102,15 @@ void main(List<String> arguments) async {
|
|||||||
|
|
||||||
payload['vel'] = recordProps['velocity'];
|
payload['vel'] = recordProps['velocity'];
|
||||||
|
|
||||||
int? batt = recordProps['battery'] != null
|
double? batt = recordProps['battery'] != null
|
||||||
? int.tryParse(recordProps['battery'])
|
? double.tryParse(recordProps['battery'].toString())
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
if (batt != null && batt <= 1) {
|
if (batt != null && batt <= 1) {
|
||||||
batt = batt * 100;
|
batt = batt * 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
payload['batt'] = batt;
|
payload['batt'] = batt?.toInt();
|
||||||
|
|
||||||
payload['bs'] = recordProps['battery_status'];
|
payload['bs'] = recordProps['battery_status'];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user