diff --git a/pyasic/miners/backends/espminer.py b/pyasic/miners/backends/espminer.py index d3826a5f..0b54b9f7 100644 --- a/pyasic/miners/backends/espminer.py +++ b/pyasic/miners/backends/espminer.py @@ -115,11 +115,18 @@ class ESPMiner(BaseMiner): if web_system_info is not None: try: - expected_hashrate = ( - web_system_info.get("smallCoreCount") - * web_system_info.get("asicCount") - * web_system_info.get("frequency") - ) + small_core_count = web_system_info.get("smallCoreCount") + asic_count = web_system_info.get("asicCount") + frequency = web_system_info.get("frequency") + + if asic_count is None: + try: + asic_info = await self.web.asic_info() + asic_count = asic_info.get("asicCount") + except APIError: + pass + + expected_hashrate = small_core_count * asic_count * frequency return self.algo.hashrate( rate=float(expected_hashrate), unit=self.algo.unit.MH diff --git a/pyasic/web/espminer.py b/pyasic/web/espminer.py index aa33ffb9..8ce1b5de 100644 --- a/pyasic/web/espminer.py +++ b/pyasic/web/espminer.py @@ -96,3 +96,6 @@ class ESPMinerWebAPI(BaseWebAPI): async def update_settings(self, **config): return await self.send_command("system", patch=True, **config) + + async def asic_info(self): + return await self.send_command("system/asic")