Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
836defc216 | ||
|
|
f8f777b5b5 |
@@ -190,22 +190,23 @@ class MinerData:
|
|||||||
tags = ["ip", "mac", "model", "hostname"]
|
tags = ["ip", "mac", "model", "hostname"]
|
||||||
for attribute in self:
|
for attribute in self:
|
||||||
if attribute in tags:
|
if attribute in tags:
|
||||||
tag_data.append(f'"{attribute}"="{self[attribute]}"')
|
escaped_data = self[attribute].replace(" ", "\\ ")
|
||||||
|
tag_data.append(f"{attribute}={escaped_data}")
|
||||||
continue
|
continue
|
||||||
if isinstance(self[attribute], str):
|
if isinstance(self[attribute], str):
|
||||||
field_data.append(f'"{attribute}"="{self[attribute]}"')
|
field_data.append(f'{attribute}="{self[attribute]}"')
|
||||||
continue
|
continue
|
||||||
if isinstance(self[attribute], bool):
|
if isinstance(self[attribute], bool):
|
||||||
field_data.append(f'"{attribute}"={str(self[attribute]).lower()}')
|
field_data.append(f"{attribute}={str(self[attribute]).lower()}")
|
||||||
continue
|
continue
|
||||||
if isinstance(self[attribute], int):
|
if isinstance(self[attribute], int):
|
||||||
field_data.append(f'"{attribute}"={self[attribute]}i')
|
field_data.append(f"{attribute}={self[attribute]}i")
|
||||||
continue
|
continue
|
||||||
if isinstance(self[attribute], float):
|
if isinstance(self[attribute], float):
|
||||||
field_data.append(f'"{attribute}"={self[attribute]}')
|
field_data.append(f"{attribute}={self[attribute]}")
|
||||||
continue
|
continue
|
||||||
if attribute == "fault_light" and not self[attribute]:
|
if attribute == "fault_light" and not self[attribute]:
|
||||||
field_data.append(f'"{attribute}"=false')
|
field_data.append(f"{attribute}=false")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
tags_str = ",".join(tag_data)
|
tags_str = ",".join(tag_data)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "pyasic"
|
name = "pyasic"
|
||||||
version = "0.16.5"
|
version = "0.16.6"
|
||||||
description = "A set of modules for interfacing with many common types of ASIC bitcoin miners, using both their API and SSH."
|
description = "A set of modules for interfacing with many common types of ASIC bitcoin miners, using both their API and SSH."
|
||||||
authors = ["UpstreamData <brett@upstreamdata.ca>"]
|
authors = ["UpstreamData <brett@upstreamdata.ca>"]
|
||||||
repository = "https://github.com/UpstreamData/pyasic"
|
repository = "https://github.com/UpstreamData/pyasic"
|
||||||
|
|||||||
Reference in New Issue
Block a user