aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjwansek <eddie.atten.ea29@gmail.com>2023-12-16 23:04:49 +0000
committerjwansek <eddie.atten.ea29@gmail.com>2023-12-16 23:04:49 +0000
commitd399ef3df2ac08cfc6b58fa50abc3e4ad1cf4af6 (patch)
tree01c17991a94409e04fc6ecad26de86e3b3aafd38
parent8ff27687d163423726f50f2a94fd59ac93cbb0b6 (diff)
downloadTasmotaCLI-d399ef3df2ac08cfc6b58fa50abc3e4ad1cf4af6.tar.gz
TasmotaCLI-d399ef3df2ac08cfc6b58fa50abc3e4ad1cf4af6.zip
Added default MQTT
-rw-r--r--README.md17
-rw-r--r--tasmota-mqtt-client.py2
2 files changed, 16 insertions, 3 deletions
diff --git a/README.md b/README.md
index 7639e70..4f15e6e 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,10 @@
# TasmotaCLI
-Quick CLI script for turning on and off Tasmota-flashed plugs
+Quick CLI script for turning on and off Tasmota-flashed plugs. Has scripts for both using the HTTP and MQTT APIs.
## Command line usage
```
-usage: tasmota-cli.py [-h] -d DEVICE_HOST [-u USER] [-t]
+usage: tasmota-http-cli.py [-h] -d DEVICE_HOST [-u USER] [-t]
optional arguments:
-h, --help show this help message and exit
@@ -14,6 +14,19 @@ optional arguments:
-t, --toggle Toggle current power status
```
+```
+usage: tasmota-mqtt-client.py [-h] [-m MQTT_HOST] -u USER [-t] -n FRIENDLYNAME
+
+optional arguments:
+ -h, --help show this help message and exit
+ -m MQTT_HOST, --mqtt-host MQTT_HOST
+ MQTT Server
+ -u USER, --user USER Username to login with
+ -t, --toggle Toggle current power status
+ -n FRIENDLYNAME, --friendlyname FRIENDLYNAME
+ Device friendly name
+```
+
## Example output
```
diff --git a/tasmota-mqtt-client.py b/tasmota-mqtt-client.py
index 849ae9d..c4be92a 100644
--- a/tasmota-mqtt-client.py
+++ b/tasmota-mqtt-client.py
@@ -61,7 +61,7 @@ parser.add_argument(
"-m", "--mqtt-host",
type = str,
help = "MQTT Server",
- required = True
+ default = "172.18.0.2",
)
parser.add_argument(
"-u", "--user",