Skip to content

Commit 01b3290

Browse files
committed
bump to 0.6.1_20240326
fix #22
1 parent 6822905 commit 01b3290

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

pytes_serial.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
dev_name = config.get('battery_info', 'dev_name')
2121
manufacturer = config.get('battery_info', 'manufacturer')
2222
model = config.get('battery_info', 'model')
23-
sw_ver = "PytesSerial v0.6.0_20231007"
23+
sw_ver = "PytesSerial v0.6.1_20240326"
2424
version = sw_ver
2525

2626
if reading_freq < 10 : reading_freq = 10
@@ -620,8 +620,8 @@ def check_events ():
620620
cell_data_req = "true"
621621
sys_events_no = sys_events_no + 1
622622

623-
if cell_data_req == "true":
624-
if cells_details =='true' and parsing_bat(power)=="true":
623+
if cell_data_req == "true" and cells_details =='true':
624+
if parsing_bat(power)=="true":
625625
pass
626626
else:
627627
battery_events_log.info ('CHECK EVENTS - power_'+ str(power)+' cells details:cells data could not be read')
@@ -633,7 +633,7 @@ def parsing_bat(power):
633633
global line_str_array
634634
bat = []
635635
cells_data =[]
636-
636+
637637
try:
638638
req = ('bat '+ str(power))
639639
size = 1000
@@ -650,7 +650,7 @@ def parsing_bat(power):
650650
if line_str[0:6].startswith('Batt'):
651651
power_idx = line_str.find('Batt')
652652
volt_idx = line_str.find('Volt ')
653-
curr_idx = line_str.find('Curr ')
653+
#curr_idx = line_str.find('Curr ')
654654
temp_idx = line_str.find('Tempr ')
655655
base_st_idx = line_str.find('Base State')
656656
volt_st_idx = line_str.find('Volt.')
@@ -666,7 +666,7 @@ def parsing_bat(power):
666666
if decode =='true' and not line_str[base_st_idx:base_st_idx+7].startswith('Absent') and not line_str[0:6].startswith('Batt'):
667667
cell = int(line_str[0:2])
668668
voltage = int(line_str[volt_idx:volt_idx+7])/1000
669-
current = int(line_str[curr_idx:curr_idx+7])/1000
669+
#current = int(line_str[curr_idx:curr_idx+7])/1000
670670
temp = int(line_str[temp_idx:temp_idx+7])/1000
671671
basic_st = line_str[base_st_idx:base_st_idx+8]
672672
volt_st = line_str[volt_st_idx:volt_st_idx+8]
@@ -677,7 +677,7 @@ def parsing_bat(power):
677677
cells_data = {
678678
'cell':cell,
679679
'voltage': voltage,
680-
'current': current,
680+
#'current': current,
681681
'temp ': temp,
682682
'basic_st': basic_st,
683683
'volt_st': volt_st,
@@ -697,8 +697,7 @@ def parsing_bat(power):
697697
{headers[4].capitalize(): <9}|\
698698
{headers[5].capitalize(): <8}|\
699699
{headers[6].capitalize(): <8}|\
700-
{headers[7].capitalize(): <8}|\
701-
{headers[8].capitalize(): <8}')
700+
{headers[7].capitalize(): <8}')
702701

703702
print(headers_str)
704703
battery_events_log.info (headers_str)
@@ -712,8 +711,7 @@ def parsing_bat(power):
712711
{cell_data[4]: <9}|\
713712
{cell_data[5]: <8}|\
714713
{cell_data[6]: <8}|\
715-
{cell_data[7]: <8}|\
716-
{cell_data[8]: <8}\
714+
{cell_data[7]: <8}\
717715
')
718716
print(cell_data_str)
719717
battery_events_log.info (cell_data_str)

0 commit comments

Comments
 (0)