refactor: remove some duplicate classes, and rename UnknownMiner get methods.

This commit is contained in:
UpstreamData
2024-01-15 16:03:40 -07:00
parent 56dd1c80b5
commit 2b82b29690
2 changed files with 17 additions and 42 deletions

View File

@@ -206,21 +206,3 @@ class M31SPlusVG30(WhatsMiner): # noqa - ignore ABC method implementation
self.raw_model = "M31S+ VG30"
self.expected_chips = 70
self.fan_count = 2
class M31SPlusV30(WhatsMiner): # noqa - ignore ABC method implementation
def __init__(self, ip: str, api_ver: str = "0.0.0"):
super().__init__(ip, api_ver)
self.ip = ip
self.raw_model = "M31S+ V30"
self.expected_chips = 117
self.fan_count = 2
class M31SPlusV40(WhatsMiner): # noqa - ignore ABC method implementation
def __init__(self, ip: str, api_ver: str = "0.0.0"):
super().__init__(ip, api_ver)
self.ip = ip
self.raw_model = "M31S+ V40"
self.expected_chips = 123
self.fan_count = 2

View File

@@ -73,60 +73,53 @@ class UnknownMiner(BaseMiner):
### DATA GATHERING FUNCTIONS (get_{some_data}) ###
##################################################
async def get_mac(self) -> Optional[str]:
async def _get_mac(self) -> Optional[str]:
return None
async def get_version(self) -> Tuple[Optional[str], Optional[str]]:
async def _get_version(self) -> Tuple[Optional[str], Optional[str]]:
return None, None
async def get_hostname(self) -> Optional[str]:
async def _get_hostname(self) -> Optional[str]:
return None
async def get_hashrate(self) -> Optional[float]:
async def _get_hashrate(self) -> Optional[float]:
return None
async def get_hashboards(self) -> List[HashBoard]:
async def _get_hashboards(self) -> List[HashBoard]:
return []
async def get_env_temp(self) -> Optional[float]:
async def _get_env_temp(self) -> Optional[float]:
return None
async def get_wattage(self) -> Optional[int]:
async def _get_wattage(self) -> Optional[int]:
return None
async def get_wattage_limit(self) -> Optional[int]:
async def _get_wattage_limit(self) -> Optional[int]:
return None
async def get_fans(
self,
) -> List[Fan]:
async def _get_fans(self) -> List[Fan]:
return [Fan(), Fan(), Fan(), Fan()]
async def get_fan_psu(self) -> Optional[int]:
async def _get_fan_psu(self) -> Optional[int]:
return None
async def get_api_ver(self) -> Optional[str]:
async def _get_api_ver(self) -> Optional[str]:
return None
async def get_fw_ver(self) -> Optional[str]:
async def _get_fw_ver(self) -> Optional[str]:
return None
async def get_errors(self) -> List[MinerErrorData]:
async def _get_errors(self) -> List[MinerErrorData]:
return []
async def get_fault_light(self) -> bool:
async def _get_fault_light(self) -> bool:
return False
async def get_expected_hashrate(self) -> Optional[float]:
async def _get_expected_hashrate(self) -> Optional[float]:
return None
async def is_mining(self, *args, **kwargs) -> Optional[bool]:
async def _is_mining(self, *args, **kwargs) -> Optional[bool]:
return None
async def get_uptime(self, *args, **kwargs) -> Optional[int]:
async def _get_uptime(self, *args, **kwargs) -> Optional[int]:
return None
async def get_data(
self, allow_warning: bool = False, data_to_get: list = None, **kwargs
) -> MinerData:
return MinerData(ip=str(self.ip))