Compare commits

..

5 Commits

Author SHA1 Message Date
UpstreamData
5e01f7517b version: bump version number. 2024-01-22 13:39:52 -07:00
b-rowan
569f659fac Merge pull request #96 from fdeh75/fix-vnish-wattage-dimension
Fix vnish wattage dimension
2024-01-22 13:38:27 -07:00
fdeh
dd9c6f1f63 Fix vnish wattage dimension
Update backend vnish.py
2024-01-22 23:17:27 +03:00
b-rowan
0958f47cfe version: bump version number. 2024-01-21 14:39:35 -07:00
b-rowan
3820b40f44 bug: Fix DataLocations defaulting to all get_config. 2024-01-21 14:39:01 -07:00
4 changed files with 14 additions and 3 deletions

View File

@@ -64,6 +64,10 @@ AVALON_DATA_LOC = DataLocations(
"_get_fault_light",
[RPCAPICommand("api_stats", "stats")],
),
str(DataOptions.UPTIME): DataFunction(
"_get_uptime",
[RPCAPICommand("api_stats", "stats")],
),
}
)

View File

@@ -70,6 +70,10 @@ VNISH_DATA_LOC = DataLocations(
"_get_fans",
[RPCAPICommand("api_stats", "stats")],
),
str(DataOptions.UPTIME): DataFunction(
"_get_uptime",
[RPCAPICommand("api_stats", "stats")],
),
}
)
@@ -163,7 +167,7 @@ class VNish(BMMiner):
if web_summary is not None:
try:
wattage = web_summary["miner"]["power_usage"]
wattage = round(wattage * 1000)
wattage = round(wattage)
return wattage
except KeyError:
pass

View File

@@ -89,6 +89,9 @@ class DataFunction:
Union[RPCAPICommand, WebAPICommand, GRPCCommand, GraphQLCommand]
] = field(default_factory=list)
def __call__(self, *args, **kwargs):
return self
DataLocations = make_dataclass(
"DataLocations",
@@ -96,7 +99,7 @@ DataLocations = make_dataclass(
(
enum_value.value,
DataFunction,
field(default_factory=lambda: DataFunction(enum_value.default_command())),
field(default_factory=DataFunction(enum_value.default_command())),
)
for enum_value in DataOptions
],

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = "pyasic"
version = "0.48.1"
version = "0.48.3"
description = "A simplified and standardized interface for Bitcoin ASICs."
authors = ["UpstreamData <brett@upstreamdata.ca>"]
repository = "https://github.com/UpstreamData/pyasic"