Commit 8728ff3b authored by Guillaume Blanchy's avatar Guillaume Blanchy
Browse files

Merge branch 'code_refactor' of https://gitlab.irstea.fr/reversaal/OhmPi into code_refactor

Showing with 4 additions and 3 deletions
+4 -3
...@@ -18,7 +18,7 @@ OHMPI_CONFIG = { ...@@ -18,7 +18,7 @@ OHMPI_CONFIG = {
HARDWARE_CONFIG = { HARDWARE_CONFIG = {
'ctl': {'model': 'raspberry_pi'}, 'ctl': {'model': 'raspberry_pi'},
'pwr': {'model': 'pwr_batt', 'voltage': 12.}, 'pwr': {'model': 'pwr_batt', 'voltage': 12., 'interface_name': 'none'},
'tx': {'model': 'mb_2024_0_2', 'tx': {'model': 'mb_2024_0_2',
'voltage_max': 50., # Maximum voltage supported by the TX board [V] 'voltage_max': 50., # Maximum voltage supported by the TX board [V]
'current_max': 4800, # Maximum voltage read by the current ADC on the TX board [mA] 'current_max': 4800, # Maximum voltage read by the current ADC on the TX board [mA]
......
...@@ -18,7 +18,7 @@ OHMPI_CONFIG = { ...@@ -18,7 +18,7 @@ OHMPI_CONFIG = {
HARDWARE_CONFIG = { HARDWARE_CONFIG = {
'ctl': {'model': 'raspberry_pi'}, 'ctl': {'model': 'raspberry_pi'},
'pwr': {'model': 'pwr_batt', 'voltage': 12.}, 'pwr': {'model': 'pwr_batt', 'voltage': 12., 'interface_name': 'none'},
'tx': {'model': 'mb_2024_0_2', 'tx': {'model': 'mb_2024_0_2',
'voltage_max': 50., # Maximum voltage supported by the TX board [V] 'voltage_max': 50., # Maximum voltage supported by the TX board [V]
'current_max': 4800, # Maximum voltage read by the current ADC on the TX board [mA] 'current_max': 4800, # Maximum voltage read by the current ADC on the TX board [mA]
......
...@@ -78,7 +78,7 @@ class OhmPiHardware: ...@@ -78,7 +78,7 @@ class OhmPiHardware:
# Initialize RX # Initialize RX
HARDWARE_CONFIG['rx'].pop('model') HARDWARE_CONFIG['rx'].pop('model')
HARDWARE_CONFIG['rx'].update(**HARDWARE_CONFIG['rx']) HARDWARE_CONFIG['rx'].update(**HARDWARE_CONFIG['rx']) # TODO: delete me ?
HARDWARE_CONFIG['rx'].update({'ctl': HARDWARE_CONFIG['rx'].pop('ctl', self.ctl)}) HARDWARE_CONFIG['rx'].update({'ctl': HARDWARE_CONFIG['rx'].pop('ctl', self.ctl)})
if isinstance(HARDWARE_CONFIG['rx']['ctl'], dict): if isinstance(HARDWARE_CONFIG['rx']['ctl'], dict):
ctl_mod = HARDWARE_CONFIG['rx']['ctl'].pop('model', self.ctl) ctl_mod = HARDWARE_CONFIG['rx']['ctl'].pop('model', self.ctl)
......
...@@ -14,6 +14,7 @@ def get_logging_levels(): ...@@ -14,6 +14,7 @@ def get_logging_levels():
"""Gets a list of the logging levels loaded""" """Gets a list of the logging levels loaded"""
return [logging.getLevelName(x) for x in range(1,101) if not logging.getLevelName(x).startswith('Level')] return [logging.getLevelName(x) for x in range(1,101) if not logging.getLevelName(x).startswith('Level')]
def add_logging_level(level_name, level_num, method_name=None): def add_logging_level(level_name, level_num, method_name=None):
""" """
Comprehensively adds a new logging level to the `logging` module and the Comprehensively adds a new logging level to the `logging` module and the
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment