bug: fix inf and nan parsing issues by replacing them with 0

This commit is contained in:
Upstream Data
2024-10-29 09:35:19 -06:00
parent b0d063d6ed
commit 0f09fb49fc

View File

@@ -268,12 +268,8 @@ If you are sure you want to use this command please use API.send_command("{comma
# fix an error with a btminer return having a missing comma. (2023-01-06 version)
str_data = str_data.replace('""temp0', '","temp0')
# fix an error with Avalonminers returning inf and nan
str_data = str_data.replace("info", "1nfo")
str_data = str_data.replace("inf", "0")
str_data = str_data.replace("1nfo", "info")
str_data = str_data.replace("nano", "n4no")
str_data = str_data.replace("nan", "0")
str_data = str_data.replace("n4no", "nano")
str_data = str_data.replace('"inf"', "0")
str_data = str_data.replace('"nan"', "0")
# fix whatever this garbage from avalonminers is `,"id":1}`
if str_data.startswith(","):