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.

This commit is contained in:
Upstream Data
2023-02-11 21:27:51 -07:00
parent 2d057ca9f6
commit 41ecb5dbc6

View File

@@ -245,9 +245,9 @@ class BTMinerAPI(BaseMinerAPI):
try: try:
data = await self._send_bytes(enc_command, timeout) data = await self._send_bytes(enc_command, timeout)
except (asyncio.CancelledError, asyncio.TimeoutError) as e: 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( 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." f"Ignoring exception. Command probably worked."
) )
# FAKING IT HERE # FAKING IT HERE