added power limit vs power draw in get_data

This commit is contained in:
upstreamdata
2022-07-07 14:34:21 -06:00
parent 082240bdb6
commit 3ec147990b
4 changed files with 12 additions and 3 deletions

View File

@@ -1,5 +1,8 @@
# pyasic
*A set of modules for interfacing with many common types of ASIC bitcoin miners, using both their API and SSH.*
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
## 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.
@@ -60,7 +63,7 @@ You can also create your own miner without scanning if you know the IP:
```python
import asyncio
import ipaddress
from pyasic.miners.miner_factory import MinerFactory
from pyasic.miners.miner_factory import Mine~~~~rFactory
async def get_miner_hashrate(ip: str):

View File

@@ -17,7 +17,8 @@ class MinerData:
: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_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_2: The speed of the second 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_chip_temp: int = 0
wattage: int = 0
wattage_limit: int = 0
fan_1: int = -1
fan_2: int = -1
fan_3: int = -1

View File

@@ -381,7 +381,10 @@ class BOSMiner(BaseMiner):
tuner = tunerstatus[0].get("TUNERSTATUS")
if tuner:
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:
data.wattage = wattage

View File

@@ -160,6 +160,7 @@ class BTMiner(BaseMiner):
wattage = summary_data[0].get("Power")
if wattage:
data.wattage = round(wattage)
data.wattage_limit = round(wattage)
if devs:
temp_data = devs.get("DEVS")