20
20
dev_name = config .get ('battery_info' , 'dev_name' )
21
21
manufacturer = config .get ('battery_info' , 'manufacturer' )
22
22
model = config .get ('battery_info' , 'model' )
23
- sw_ver = "PytesSerial v0.6.0_20231007 "
23
+ sw_ver = "PytesSerial v0.6.1_20240326 "
24
24
version = sw_ver
25
25
26
26
if reading_freq < 10 : reading_freq = 10
@@ -620,8 +620,8 @@ def check_events ():
620
620
cell_data_req = "true"
621
621
sys_events_no = sys_events_no + 1
622
622
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" :
625
625
pass
626
626
else :
627
627
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):
633
633
global line_str_array
634
634
bat = []
635
635
cells_data = []
636
-
636
+
637
637
try :
638
638
req = ('bat ' + str (power ))
639
639
size = 1000
@@ -650,7 +650,7 @@ def parsing_bat(power):
650
650
if line_str [0 :6 ].startswith ('Batt' ):
651
651
power_idx = line_str .find ('Batt' )
652
652
volt_idx = line_str .find ('Volt ' )
653
- curr_idx = line_str .find ('Curr ' )
653
+ # curr_idx = line_str.find('Curr ')
654
654
temp_idx = line_str .find ('Tempr ' )
655
655
base_st_idx = line_str .find ('Base State' )
656
656
volt_st_idx = line_str .find ('Volt.' )
@@ -666,7 +666,7 @@ def parsing_bat(power):
666
666
if decode == 'true' and not line_str [base_st_idx :base_st_idx + 7 ].startswith ('Absent' ) and not line_str [0 :6 ].startswith ('Batt' ):
667
667
cell = int (line_str [0 :2 ])
668
668
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
670
670
temp = int (line_str [temp_idx :temp_idx + 7 ])/ 1000
671
671
basic_st = line_str [base_st_idx :base_st_idx + 8 ]
672
672
volt_st = line_str [volt_st_idx :volt_st_idx + 8 ]
@@ -677,7 +677,7 @@ def parsing_bat(power):
677
677
cells_data = {
678
678
'cell' :cell ,
679
679
'voltage' : voltage ,
680
- 'current' : current ,
680
+ # 'current': current,
681
681
'temp ' : temp ,
682
682
'basic_st' : basic_st ,
683
683
'volt_st' : volt_st ,
@@ -697,8 +697,7 @@ def parsing_bat(power):
697
697
{ headers [4 ].capitalize (): <9} |\
698
698
{ headers [5 ].capitalize (): <8} |\
699
699
{ headers [6 ].capitalize (): <8} |\
700
- { headers [7 ].capitalize (): <8} |\
701
- { headers [8 ].capitalize (): <8} ' )
700
+ { headers [7 ].capitalize (): <8} ' )
702
701
703
702
print (headers_str )
704
703
battery_events_log .info (headers_str )
@@ -712,8 +711,7 @@ def parsing_bat(power):
712
711
{ cell_data [4 ]: <9} |\
713
712
{ cell_data [5 ]: <8} |\
714
713
{ cell_data [6 ]: <8} |\
715
- { cell_data [7 ]: <8} |\
716
- { cell_data [8 ]: <8} \
714
+ { cell_data [7 ]: <8} \
717
715
' )
718
716
print (cell_data_str )
719
717
battery_events_log .info (cell_data_str )
0 commit comments