add fan_psu to MinerData, only works for whatsminers.
This commit is contained in:
@@ -49,6 +49,7 @@ class MinerData:
|
|||||||
fan_2: The speed of the second fan as an int.
|
fan_2: The speed of the second fan as an int.
|
||||||
fan_3: The speed of the third fan as an int.
|
fan_3: The speed of the third fan as an int.
|
||||||
fan_4: The speed of the fourth fan as an int.
|
fan_4: The speed of the fourth fan as an int.
|
||||||
|
fan_psu: The speed of the PSU on the fan if the miner collects it.
|
||||||
left_chips: The number of chips online in the left board as an int.
|
left_chips: The number of chips online in the left board as an int.
|
||||||
center_chips: The number of chips online in the left board as an int.
|
center_chips: The number of chips online in the left board as an int.
|
||||||
right_chips: The number of chips online in the left board as an int.
|
right_chips: The number of chips online in the left board as an int.
|
||||||
@@ -76,19 +77,20 @@ class MinerData:
|
|||||||
center_board_hashrate: float = 0.0
|
center_board_hashrate: float = 0.0
|
||||||
right_board_hashrate: float = 0.0
|
right_board_hashrate: float = 0.0
|
||||||
temperature_avg: int = field(init=False)
|
temperature_avg: int = field(init=False)
|
||||||
env_temp: float = 0.0
|
env_temp: float = -1.0
|
||||||
left_board_temp: int = 0
|
left_board_temp: int = -1
|
||||||
left_board_chip_temp: int = 0
|
left_board_chip_temp: int = -1
|
||||||
center_board_temp: int = 0
|
center_board_temp: int = -1
|
||||||
center_board_chip_temp: int = 0
|
center_board_chip_temp: int = -1
|
||||||
right_board_temp: int = 0
|
right_board_temp: int = -1
|
||||||
right_board_chip_temp: int = 0
|
right_board_chip_temp: int = -1
|
||||||
wattage: int = 0
|
wattage: int = -1
|
||||||
wattage_limit: int = 0
|
wattage_limit: int = -1
|
||||||
fan_1: int = -1
|
fan_1: int = -1
|
||||||
fan_2: int = -1
|
fan_2: int = -1
|
||||||
fan_3: int = -1
|
fan_3: int = -1
|
||||||
fan_4: int = -1
|
fan_4: int = -1
|
||||||
|
fan_psu: int = -1
|
||||||
left_chips: int = 0
|
left_chips: int = 0
|
||||||
center_chips: int = 0
|
center_chips: int = 0
|
||||||
right_chips: int = 0
|
right_chips: int = 0
|
||||||
@@ -192,7 +194,7 @@ class MinerData:
|
|||||||
self.center_board_chip_temp,
|
self.center_board_chip_temp,
|
||||||
self.right_board_chip_temp,
|
self.right_board_chip_temp,
|
||||||
]:
|
]:
|
||||||
if temp and not temp == 0:
|
if temp and not temp == -1:
|
||||||
total_temp += temp
|
total_temp += temp
|
||||||
temp_count += 1
|
temp_count += 1
|
||||||
if not temp_count > 0:
|
if not temp_count > 0:
|
||||||
|
|||||||
@@ -260,7 +260,9 @@ class BTMiner(BaseMiner):
|
|||||||
miner_data = None
|
miner_data = None
|
||||||
for i in range(PyasicSettings().miner_get_data_retries):
|
for i in range(PyasicSettings().miner_get_data_retries):
|
||||||
try:
|
try:
|
||||||
miner_data = await self.api.multicommand("summary", "devs", "pools")
|
miner_data = await self.api.multicommand(
|
||||||
|
"summary", "devs", "pools", "get_psu"
|
||||||
|
)
|
||||||
if miner_data:
|
if miner_data:
|
||||||
break
|
break
|
||||||
except APIError:
|
except APIError:
|
||||||
@@ -272,6 +274,7 @@ class BTMiner(BaseMiner):
|
|||||||
summary = miner_data.get("summary")[0]
|
summary = miner_data.get("summary")[0]
|
||||||
devs = miner_data.get("devs")[0]
|
devs = miner_data.get("devs")[0]
|
||||||
pools = miner_data.get("pools")[0]
|
pools = miner_data.get("pools")[0]
|
||||||
|
psu_data = miner_data.get("get_psu")[0]
|
||||||
|
|
||||||
if summary:
|
if summary:
|
||||||
summary_data = summary.get("SUMMARY")
|
summary_data = summary.get("SUMMARY")
|
||||||
@@ -287,6 +290,9 @@ class BTMiner(BaseMiner):
|
|||||||
if summary_data[0].get("Power Limit"):
|
if summary_data[0].get("Power Limit"):
|
||||||
wattage_limit = summary_data[0]["Power Limit"]
|
wattage_limit = summary_data[0]["Power Limit"]
|
||||||
|
|
||||||
|
if summary_data[0].get("Power Fanspeed"):
|
||||||
|
data.fan_psu = summary_data[0]["Power Fanspeed"]
|
||||||
|
|
||||||
data.fan_1 = summary_data[0]["Fan Speed In"]
|
data.fan_1 = summary_data[0]["Fan Speed In"]
|
||||||
data.fan_2 = summary_data[0]["Fan Speed Out"]
|
data.fan_2 = summary_data[0]["Fan Speed Out"]
|
||||||
|
|
||||||
@@ -312,6 +318,12 @@ class BTMiner(BaseMiner):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if psu_data:
|
||||||
|
psu = psu_data.get("Msg")
|
||||||
|
if psu:
|
||||||
|
if psu.get("fan_speed"):
|
||||||
|
data.fan_psu = psu["fan_speed"]
|
||||||
|
|
||||||
if devs:
|
if devs:
|
||||||
temp_data = devs.get("DEVS")
|
temp_data = devs.get("DEVS")
|
||||||
if temp_data:
|
if temp_data:
|
||||||
|
|||||||
Reference in New Issue
Block a user