power: fix formatting issues with tasmota impelmentation

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Arksine 2020-12-25 19:30:21 -05:00
parent 46de7c48c8
commit f91e425463
1 changed files with 4 additions and 3 deletions

View File

@ -351,11 +351,12 @@ class Tasmota:
if command in ["on", "off"]: if command in ["on", "off"]:
out_cmd = f"Power{self.output_id}%20{command}" out_cmd = f"Power{self.output_id}%20{command}"
elif command == "info": elif command == "info":
out_cmd = "Power{self.output_id}" out_cmd = f"Power{self.output_id}"
else: else:
raise self.server.error(f"Invalid tasmota command: {command}") raise self.server.error(f"Invalid tasmota command: {command}")
url = f"http://{self.addr}/cm?user=admin&password={self.password}&cmnd={out_cmd}" url = f"http://{self.addr}/cm?user=admin&password=" \
f"{self.password}&cmnd={out_cmd}"
data = "" data = ""
http_client = AsyncHTTPClient() http_client = AsyncHTTPClient()
try: try: