Added upgraderun in rpc/luxminer
This commit is contained in:
@@ -152,25 +152,15 @@ class LUXMiner(LuxOSFirmware):
|
|||||||
Upgrade the firmware on a LuxOS miner by calling the 'updaterun' API command.
|
Upgrade the firmware on a LuxOS miner by calling the 'updaterun' API command.
|
||||||
|
|
||||||
Returns: Result of the upgrade process.
|
Returns: Result of the upgrade process.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
command = "updaterun"
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = await self.rpc.send_command(command=command)
|
response = await self.rpc.upgraderun()
|
||||||
|
|
||||||
if not response:
|
logging.info(f"{self.ip}: Firmware upgrade initiated successfully.")
|
||||||
raise ValueError("No response received during the firmware upgrade process.")
|
return response
|
||||||
|
|
||||||
if response.get("status") == "success":
|
except APIError as e:
|
||||||
logging.info(f"{self.ip}: Firmware upgrade initiated successfully.")
|
logging.error(f"{self.ip}: Firmware upgrade failed: {e}")
|
||||||
return "Firmware upgrade completed successfully."
|
|
||||||
else:
|
|
||||||
logging.error(f"{self.ip}: Firmware upgrade failed. Response: {response}")
|
|
||||||
raise ValueError(f"Firmware upgrade failed. Response: {response}")
|
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
logging.error(f"An error occurred during the firmware upgrade process: {e}", exc_info=True)
|
|
||||||
raise
|
raise
|
||||||
|
|
||||||
##################################################
|
##################################################
|
||||||
|
|||||||
@@ -749,3 +749,12 @@ class LUXMinerRPCAPI(BaseMinerRPCAPI):
|
|||||||
</details>
|
</details>
|
||||||
"""
|
"""
|
||||||
return await self.send_command("wakeup", parameters=session_id)
|
return await self.send_command("wakeup", parameters=session_id)
|
||||||
|
|
||||||
|
async def upgraderun(self):
|
||||||
|
"""
|
||||||
|
Send the 'updaterun' command to the miner.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The response from the miner after sending the 'updaterun' command.
|
||||||
|
"""
|
||||||
|
return await self.send_command("updaterun")
|
||||||
Reference in New Issue
Block a user