summaryrefslogtreecommitdiff
path: root/bin/mqtt_node_util.py
diff options
context:
space:
mode:
Diffstat (limited to 'bin/mqtt_node_util.py')
-rwxr-xr-xbin/mqtt_node_util.py6
1 files changed, 5 insertions, 1 deletions
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)