feature: add auto unit to hashrates and improve model dump for hashrates

This commit is contained in:
Brett Rowan
2024-12-20 10:16:01 -07:00
parent 89641c6316
commit 6ab9681dec
4 changed files with 34 additions and 26 deletions

View File

@@ -51,11 +51,6 @@ class HashBoard(BaseModel):
active: bool | None = None
voltage: float | None = None
@field_serializer("hashrate")
def serialize_hashrate(self, hashrate: AlgoHashRateType | None) -> float:
if hashrate is not None:
return float(hashrate)
def get(self, __key: str, default: Any = None):
try:
val = self.__getitem__(__key)