From c9b351a08e31aa0c34892065f02f9ef710b6cd34 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Sat, 24 Feb 2024 02:00:40 +0300 Subject: mqtt changes --- bin/mqtt_node_util.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'bin/mqtt_node_util.py') diff --git a/bin/mqtt_node_util.py b/bin/mqtt_node_util.py index a685f26..657fcf9 100755 --- a/bin/mqtt_node_util.py +++ b/bin/mqtt_node_util.py @@ -54,6 +54,8 @@ if __name__ == '__main__': help='send relay state') parser.add_argument('--push-ota', type=str, metavar='OTA_FILENAME', help='push OTA, receives path to firmware.bin (not .elf!)') + parser.add_argument('--custom-ota-topic', type=str, + help='only needed for update very old devices') parser.add_argument('--no-wait', action='store_true', help='execute command and exit') @@ -86,7 +88,10 @@ if __name__ == '__main__': mqtt.add_node(mqtt_node) # must-have modules - ota_module = mqtt_node.load_module('ota') + ota_kwargs = {} + if arg.custom_ota_topic: + ota_kwargs['custom_ota_topic'] = arg.custom_ota_topic + ota_module = mqtt_node.load_module('ota', **ota_kwargs) ota_val = arg.push_ota mqtt_node.load_module('diagnostics') -- cgit v1.2.3