bug: fix some bugs.

This commit is contained in:
UpstreamData
2023-03-02 16:17:32 -07:00
parent e65b718699
commit 841a546505
10 changed files with 90 additions and 208 deletions

View File

@@ -14,6 +14,7 @@
# limitations under the License. -
# ------------------------------------------------------------------------------
import json
import urllib.parse
import warnings
from typing import Union
@@ -61,9 +62,10 @@ class InnosiliconWebAPI(BaseWebAPI):
f"http://{self.ip}/api/{command}",
headers={"Authorization": "Bearer " + self.jwt},
timeout=5,
data=parameters,
json=parameters,
)
json_data = response.json()
print(json_data)
if (
not json_data.get("success")
and "token" in json_data
@@ -104,3 +106,6 @@ class InnosiliconWebAPI(BaseWebAPI):
async def get_error_detail(self):
return await self.send_command("getErrorDetail")
async def pools(self):
return await self.send_command("pools")