From 2500ec386979ae9a607bf3ed6ec58d8f0442886d Mon Sep 17 00:00:00 2001 From: UpstreamData <75442874+UpstreamData@users.noreply.github.com> Date: Thu, 29 Jun 2023 18:10:10 -0600 Subject: [PATCH] bug: fix possible None return from some bosminer webcommands. --- pyasic/web/bosminer.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pyasic/web/bosminer.py b/pyasic/web/bosminer.py index 33495bae..ab1aa14b 100644 --- a/pyasic/web/bosminer.py +++ b/pyasic/web/bosminer.py @@ -76,7 +76,7 @@ class BOSMinerWebAPI(BaseWebAPI): async def multicommand( self, *commands: Union[dict, str], allow_warning: bool = True - ): + ) -> dict: luci_commands = [] gql_commands = [] for cmd in commands: @@ -88,6 +88,11 @@ class BOSMinerWebAPI(BaseWebAPI): luci_data = await self.luci_multicommand(*luci_commands) gql_data = await self.gql_multicommand(*gql_commands) + if gql_data is None: + gql_data = {} + if luci_data is None: + luci_data = {} + data = dict(**luci_data, **gql_data) return data