Skip to content

Commit

Permalink
Merge branch 'dev_grpc'
Browse files Browse the repository at this point in the history
# Conflicts:
#	pyasic/web/bosminer.py
#	pyproject.toml
  • Loading branch information
UpstreamData committed Oct 30, 2023
2 parents 255b06a + d2f71e8 commit 717b942
Show file tree
Hide file tree
Showing 19 changed files with 1,336 additions and 209 deletions.
27 changes: 14 additions & 13 deletions pyasic/API/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ async def send_command(
data = self._load_api_data(data)

# check for if the user wants to allow errors to return
if not ignore_errors:
# validate the command succeeded
validation = self._validate_command_output(data)
if not validation[0]:
if allow_warning:
logging.warning(
f"{self.ip}: API Command Error: {command}: {validation[1]}"
)
validation = self._validate_command_output(data)
if not validation[0]:
if not ignore_errors:
# validate the command succeeded
raise APIError(validation[1])
if allow_warning:
logging.warning(
f"{self.ip}: API Command Error: {command}: {validation[1]}"
)

logging.debug(f"{self} - (Send Command) - Received data.")
return data
Expand All @@ -118,11 +118,12 @@ async def multicommand(self, *commands: str, allow_warning: bool = True) -> dict
data = await self.send_command(command, allow_warning=allow_warning)
except APIError as e:
# try to identify the error
if ":" in e.message:
err_command = e.message.split(":")[0]
if err_command in commands:
commands.remove(err_command)
continue
if e.message is not None:
if ":" in e.message:
err_command = e.message.split(":")[0]
if err_command in commands:
commands.remove(err_command)
continue
return {command: [{}] for command in commands}
logging.debug(f"{self} - (Multicommand) - Received data")
data["multicommand"] = True
Expand Down
2 changes: 1 addition & 1 deletion pyasic/miners/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ async def get_data(
)

gathered_data = await self._get_data(
allow_warning, include=include, exclude=exclude
allow_warning=allow_warning, include=include, exclude=exclude
)
for item in gathered_data:
if gathered_data[item] is not None:
Expand Down
194 changes: 0 additions & 194 deletions pyasic/web/bosminer.py

This file was deleted.

Loading

0 comments on commit 717b942

Please sign in to comment.