power: Fix Home Assistant exception
Home Assistant returns an empty response when switching a switch on or off. Will now requery the switch status and return it's result Signed-off-by: Alan Harper <alan@aussiegeek.net>
This commit is contained in:
parent
541f5e54dc
commit
d6156dee68
|
@ -699,8 +699,9 @@ class HomeAssistant(HTTPDevice):
|
|||
return res[f"state"]
|
||||
|
||||
async def _send_power_request(self, state: str) -> str:
|
||||
res = await self._send_homeassistant_command(state)
|
||||
return res[0][f"state"]
|
||||
await self._send_homeassistant_command(state)
|
||||
res = await self._send_status_request()
|
||||
return res
|
||||
|
||||
class Loxonev1(HTTPDevice):
|
||||
def __init__(self, config: ConfigHelper) -> None:
|
||||
|
|
Loading…
Reference in New Issue