diff --git a/pyasic/miners/backends/luxminer.py b/pyasic/miners/backends/luxminer.py index f7fc4caa..2a534b92 100644 --- a/pyasic/miners/backends/luxminer.py +++ b/pyasic/miners/backends/luxminer.py @@ -147,22 +147,25 @@ class LUXMiner(LuxOSFirmware): async def get_config(self) -> MinerConfig: return self.config - async def upgrade_firmware(self) -> bool: + async def upgrade_firmware(self) -> tuple[bool, str]: """ Upgrade the firmware on a LuxOS miner by calling the 'updaterun' API command. Returns: + tuple[bool, str]: A tuple containing: bool: True if the firmware upgrade was successfully initiated, False otherwise. + str: A status message describing the result of the operation. """ try: await self.rpc.upgraderun() - - logging.info(f"{self.ip}: Firmware upgrade initiated successfully.") - return True + status = f"{self.ip}: Firmware upgrade initiated successfully." + logging.info(status) + return True, status except APIError as e: - logging.error(f"{self.ip}: Firmware upgrade failed: {e}") - return False + status = f"{self.ip}: Firmware upgrade failed: {e}" + logging.error(status) + return False, status ################################################## ### DATA GATHERING FUNCTIONS (get_{some_data}) ###