Squash Whatsminer LED bug

old implementation broke command syntax due to since required command parameters would be left off in certain cases.
This commit is contained in:
Colin Crossman
2022-12-13 11:42:36 -07:00
parent b9d5e7b206
commit d5e797de9e

View File

@@ -189,10 +189,7 @@ class BTMinerAPI(BaseMinerAPI):
self, command: Union[str, bytes], ignore_errors: bool = False, **kwargs
) -> dict:
logging.debug(f"{self} - (Send Privileged Command) - {command} " + f'with args {kwargs}' if len(kwargs) > 0 else '')
command = {"cmd": command}
for kwarg in kwargs:
if kwargs[kwarg]:
command[kwarg] = kwargs[kwarg]
command = {"cmd": command, **kwargs}
token_data = await self.get_token()
enc_command = create_privileged_cmd(token_data, command)