From 41ecb5dbc6128a1109c9ddba841a6f5df9165353 Mon Sep 17 00:00:00 2001 From: Upstream Data Date: Sat, 11 Feb 2023 21:27:51 -0700 Subject: [PATCH] bug: fix a bug with power_off not working properly with the respbefore flag by faking data, hopefully will be fixed by Whatsminer in a later update. --- pyasic/API/btminer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyasic/API/btminer.py b/pyasic/API/btminer.py index d0140f85..c4b22c05 100644 --- a/pyasic/API/btminer.py +++ b/pyasic/API/btminer.py @@ -245,9 +245,9 @@ class BTMinerAPI(BaseMinerAPI): try: data = await self._send_bytes(enc_command, timeout) except (asyncio.CancelledError, asyncio.TimeoutError) as e: - if command["cmd"] in ["reboot", "restart", "power_on"]: + if command["cmd"] in ["reboot", "restart", "power_on", "power_off"]: logging.info( - f"{self} - (reboot/restart/power_on) - Whatsminers currently break this. " + f"{self} - (reboot/restart/power_on/power_off) - Whatsminers currently break this. " f"Ignoring exception. Command probably worked." ) # FAKING IT HERE