Fixes for not splitting python list correctly.
This commit is contained in:
@@ -7,6 +7,6 @@
|
||||
},
|
||||
"deviceName": "prostarsolar",
|
||||
"driverId": "0170",
|
||||
"releaseVersion": "2",
|
||||
"releaseVersion": "3",
|
||||
"driverFileName": "prostarsolar.py"
|
||||
}
|
||||
@@ -7,6 +7,6 @@
|
||||
"persistence.py",
|
||||
"modbusMap.p"
|
||||
],
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"s3BucketName": "prostarsolar"
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -36,7 +36,7 @@ def pad(string_to_pad, char_to_pad_with, num_chars):
|
||||
|
||||
def split_into_parts(inp_str):
|
||||
"""Split the binary string."""
|
||||
return inp_str[0:1] + " " + inp_str[1:6] + " " + inp_str[7:15]
|
||||
return inp_str[0:1] + " " + inp_str[1:6] + " " + inp_str[6:17]
|
||||
|
||||
|
||||
for t in test_values:
|
||||
|
||||
@@ -18,10 +18,10 @@ def int_to_float16(int_to_convert):
|
||||
if int(bin_rep[0]) == 1:
|
||||
sign = -1.0
|
||||
exponent = float(int(bin_rep[1:6], 2))
|
||||
if exponent == 30:
|
||||
fraction = float(int("1" + bin_rep[7:17], 2))
|
||||
else:
|
||||
fraction = float(int(bin_rep[7:17], 2))
|
||||
# if exponent == 30:
|
||||
# fraction = float(int("1" + bin_rep[:17], 2))
|
||||
# else:
|
||||
fraction = float(int(bin_rep[6:17], 2))
|
||||
|
||||
if exponent == float(0b00000):
|
||||
return sign * 2 ** -14 * fraction / (2.0 ** 10.0)
|
||||
|
||||
Reference in New Issue
Block a user