added power limit vs power draw in get_data
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
# pyasic
|
# pyasic
|
||||||
*A set of modules for interfacing with many common types of ASIC bitcoin miners, using both their API and SSH.*
|
*A set of modules for interfacing with many common types of ASIC bitcoin miners, using both their API and SSH.*
|
||||||
|
|
||||||
|
[](https://github.com/psf/black)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
To use this repo, first download it, create a virtual environment, enter the virtual environment, and install relevant packages by navigating to this directory and running ```pip install -r requirements.txt``` on Windows or ```pip3 install -r requirements.txt``` on Mac or UNIX if the first command fails.
|
To use this repo, first download it, create a virtual environment, enter the virtual environment, and install relevant packages by navigating to this directory and running ```pip install -r requirements.txt``` on Windows or ```pip3 install -r requirements.txt``` on Mac or UNIX if the first command fails.
|
||||||
|
|
||||||
@@ -60,7 +63,7 @@ You can also create your own miner without scanning if you know the IP:
|
|||||||
```python
|
```python
|
||||||
import asyncio
|
import asyncio
|
||||||
import ipaddress
|
import ipaddress
|
||||||
from pyasic.miners.miner_factory import MinerFactory
|
from pyasic.miners.miner_factory import Mine~~~~rFactory
|
||||||
|
|
||||||
|
|
||||||
async def get_miner_hashrate(ip: str):
|
async def get_miner_hashrate(ip: str):
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ class MinerData:
|
|||||||
:param center_board_chip_temp: The temp of the center board chips as an int.
|
:param center_board_chip_temp: The temp of the center board chips as an int.
|
||||||
:param right_board_temp: The temp of the right PCB as an int.
|
:param right_board_temp: The temp of the right PCB as an int.
|
||||||
:param right_board_chip_temp: The temp of the right board chips as an int.
|
:param right_board_chip_temp: The temp of the right board chips as an int.
|
||||||
:param wattage: Wattage of the miner as an int.
|
:param wattage: Current power draw of the miner as an int.
|
||||||
|
:param wattage_limit: Power limit of the miner as an int.
|
||||||
:param fan_1: The speed of the first fan as an int.
|
:param fan_1: The speed of the first fan as an int.
|
||||||
:param fan_2: The speed of the second fan as an int.
|
:param fan_2: The speed of the second fan as an int.
|
||||||
:param fan_3: The speed of the third fan as an int.
|
:param fan_3: The speed of the third fan as an int.
|
||||||
@@ -48,6 +49,7 @@ class MinerData:
|
|||||||
right_board_temp: int = 0
|
right_board_temp: int = 0
|
||||||
right_board_chip_temp: int = 0
|
right_board_chip_temp: int = 0
|
||||||
wattage: int = 0
|
wattage: int = 0
|
||||||
|
wattage_limit: int = 0
|
||||||
fan_1: int = -1
|
fan_1: int = -1
|
||||||
fan_2: int = -1
|
fan_2: int = -1
|
||||||
fan_3: int = -1
|
fan_3: int = -1
|
||||||
|
|||||||
@@ -381,7 +381,10 @@ class BOSMiner(BaseMiner):
|
|||||||
tuner = tunerstatus[0].get("TUNERSTATUS")
|
tuner = tunerstatus[0].get("TUNERSTATUS")
|
||||||
if tuner:
|
if tuner:
|
||||||
if len(tuner) > 0:
|
if len(tuner) > 0:
|
||||||
wattage = tuner[0].get("PowerLimit")
|
wattage = tuner[0].get("ApproximateMinerPowerConsumption")
|
||||||
|
wattage_limit = tuner[0].get("PowerLimit")
|
||||||
|
if wattage_limit:
|
||||||
|
data.wattage_limit = wattage_limit
|
||||||
if wattage:
|
if wattage:
|
||||||
data.wattage = wattage
|
data.wattage = wattage
|
||||||
|
|
||||||
|
|||||||
@@ -160,6 +160,7 @@ class BTMiner(BaseMiner):
|
|||||||
wattage = summary_data[0].get("Power")
|
wattage = summary_data[0].get("Power")
|
||||||
if wattage:
|
if wattage:
|
||||||
data.wattage = round(wattage)
|
data.wattage = round(wattage)
|
||||||
|
data.wattage_limit = round(wattage)
|
||||||
|
|
||||||
if devs:
|
if devs:
|
||||||
temp_data = devs.get("DEVS")
|
temp_data = devs.get("DEVS")
|
||||||
|
|||||||
Reference in New Issue
Block a user