Преглед изворни кода

feat: add logging for received cell info in measurement controller; suppress HTTP warnings

Silas Gruen пре 6 месеци
родитељ
комит
8954f98e87
2 измењених фајлова са 2 додато и 0 уклоњено
  1. 1 0
      src/controllers/measurement_controller.py
  2. 1 0
      src/services/http_service.py

+ 1 - 0
src/controllers/measurement_controller.py

@@ -111,6 +111,7 @@ class MeasurementController:
         charge_fraction = int(self.config['measurement']['c_rate']*100)  # Convert to percentage
         capacity = cell_info['cell_type']['capacity']
         cut_off_curr = self.config['measurement']['cut_off_curr']
+        logger.info(f"Received cell info for cell {insertion_info.cell_id}: limits: {min_volt}mV - {max_volt}mV, charge fraction: {charge_fraction}%, capacity: {capacity}mAh, cut-off current: {cut_off_curr}mA")
         limits = CellLimits(min_volt, max_volt, charge_fraction, capacity, cut_off_curr, 0) # cycle_num is set to 0 initially
         self.devices[insertion_info.device_id].slots[insertion_info.slot_id].insert_cell(Cell(insertion_info.cell_id, limits, capacity))
         

+ 1 - 0
src/services/http_service.py

@@ -1,6 +1,7 @@
 import requests
 import logging
 
+requests.packages.urllib3.disable_warnings() 
 logger = logging.getLogger(__name__)
 
 DEBUG_DATA = {