From 8902e0ebf6e9324eaa98a4e6e441565e90a31ac7 Mon Sep 17 00:00:00 2001 From: "rpi2.0" <rpi2.0> Date: Fri, 28 Oct 2022 10:13:07 +0200 Subject: [PATCH] sets sequence through http interface bug fixing --- config.py | 2 +- http_interface.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config.py b/config.py index dfff4b10..cb664fe1 100644 --- a/config.py +++ b/config.py @@ -16,7 +16,7 @@ OHMPI_CONFIG = { 'integer': 2, # Max value 10 # TODO: Explain what this is... 'version': 2, 'max_elec': 64, - 'board_addresses': {'A': 0x70, 'B': 0x71, 'M': 0x72, 'N': 0x73}, # def. {'A': 0x76, 'B': 0x71, 'M': 0x74, 'N': 0x70} + 'board_addresses': {'A': 0x73, 'B': 0x72, 'M': 0x71, 'N': 0x70}, # def. {'A': 0x76, 'B': 0x71, 'M': 0x74, 'N': 0x70} 'settings': 'ohmpi_settings.json' } # TODO: add a dictionary with INA models and associated gain values diff --git a/http_interface.py b/http_interface.py index ab13c81d..010c75df 100644 --- a/http_interface.py +++ b/http_interface.py @@ -120,10 +120,11 @@ class MyServer(SimpleHTTPRequestHandler): os.mkdir('data') elif dic['cmd'] == 'update_settings': # ohmpi.stop() - if 'sequence' in dic['config'].keys and dic['config']['sequence'] is not None: + if 'sequence' in dic['config'].keys() and dic['config']['sequence'] is not None: sequence = dic['config']['sequence'] dic['config'].pop('sequence', None) payload = json.dumps({'cmd_id': cmd_id, 'cmd': 'set_sequence', 'args': sequence}) + publish.single(payload=payload, **publisher_config) payload = json.dumps({'cmd_id': cmd_id, 'cmd': 'update_settings', 'args': dic['config']}) cdic = dic['config'] publish.single(payload=payload, **publisher_config) -- GitLab