From 94afba2bb100504c19c271ea10ae7a95058d3e08 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Thu, 7 Sep 2023 00:38:21 +0300 Subject: mqtt_node_util: add --legacy-relay option --- bin/mqtt_node_util.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/mqtt_node_util.py b/bin/mqtt_node_util.py index 420a87e..cf451fd 100755 --- a/bin/mqtt_node_util.py +++ b/bin/mqtt_node_util.py @@ -23,6 +23,7 @@ if __name__ == '__main__': help='mqtt modules to include') parser.add_argument('--switch-relay', choices=[0, 1], type=int, help='send relay state') + parser.add_argument('--legacy-relay', action='store_true') parser.add_argument('--push-ota', type=str, metavar='OTA_FILENAME', help='push OTA, receives path to firmware.bin') @@ -45,7 +46,10 @@ if __name__ == '__main__': if arg.modules: for m in arg.modules: - module_instance = mqtt_node.load_module(m) + kwargs = {} + if m == 'relay' and arg.legacy_relay: + kwargs['legacy_topics'] = True + module_instance = mqtt_node.load_module(m, **kwargs) if m == 'relay' and arg.switch_relay is not None: module_instance.switchpower(arg.switch_relay == 1) -- cgit v1.2.3