Fixed error when reading Tasmota status response
Signed-off-by: Matthias Neumayr <matt.neumayr@gmail.com>
This commit is contained in:
parent
4415a3c858
commit
a2327a093b
|
@ -383,7 +383,7 @@ class Tasmota:
|
|||
async def refresh_status(self):
|
||||
try:
|
||||
res = await self._send_tasmota_command("info")
|
||||
state = res[f"Power{self.output_id}"].lower()
|
||||
state = res[f"POWER{self.output_id}"].lower()
|
||||
except Exception:
|
||||
self.state = "error"
|
||||
msg = f"Error Refeshing Device Status: {self.name}"
|
||||
|
@ -394,7 +394,7 @@ class Tasmota:
|
|||
async def set_power(self, state):
|
||||
try:
|
||||
res = await self._send_tasmota_command(state)
|
||||
state = res[f"Power{self.output_id}"].lower()
|
||||
state = res[f"POWER{self.output_id}"].lower()
|
||||
except Exception:
|
||||
self.state = "error"
|
||||
msg = f"Error Setting Device Status: {self.name} to {state}"
|
||||
|
|
Loading…
Reference in New Issue