diff options
Diffstat (limited to 'tasmotaMQTTClient.py')
| -rw-r--r-- | tasmotaMQTTClient.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tasmotaMQTTClient.py b/tasmotaMQTTClient.py index e8a43b8..07f7fae 100644 --- a/tasmotaMQTTClient.py +++ b/tasmotaMQTTClient.py @@ -73,6 +73,11 @@ parser.add_argument( required = True ) parser.add_argument( + "-p", "--password", + type = str, + help = "Password to use in scripts. If ran interactively, omit this option otherwise the password will appear in logs" +) +parser.add_argument( "-t", "--toggle", action = "store_true", help = "Toggle current power status" @@ -88,10 +93,8 @@ if __name__ == "__main__": args = vars(parser.parse_args()) if args["mqtt_host"] == "<docker>": args["mqtt_host"] = docker_net.get_mqtt_addr()[0] - if args["user"] is not None: + if args["password"] is None: args["password"] = getpass.getpass("Input password for %s@%s: " % (args["user"], args["mqtt_host"])) - else: - args["password"] = None if args["toggle"]: client = MQTTClient(args["mqtt_host"], args["friendlyname"], args["user"], args["password"], "TOGGLE") |
