@@ -43,7 +43,10 @@ def get_client(self):
4343 return self .client
4444
4545 def create_bitmain_client (
46- self , ip_addr : str , passwd : Optional [str ] = None , vnish_passwd : Optional [str ] = None
46+ self ,
47+ ip_addr : str ,
48+ passwd : Optional [str ] = None ,
49+ vnish_passwd : Optional [str ] = None ,
4750 ) -> None :
4851 try :
4952 self .client = BitmainHTTPClient (ip_addr , passwd , vnish_passwd )
@@ -58,50 +61,68 @@ def create_iceriver_client(
5861 except FailedConnectionError as err :
5962 logger .error (err )
6063
61- def create_whatsminer_client (self , ip_addr : str , passwd : Optional [str ] = None ) -> None :
64+ def create_whatsminer_client (
65+ self , ip_addr : str , passwd : Optional [str ] = None
66+ ) -> None :
6267 try :
6368 self .client = WhatsminerRPCClient (ip_addr , passwd )
6469 except FailedConnectionError as err :
6570 logger .error (err )
6671
67- def create_whatsminerv3_client (self , ip_addr : str , user : Optional [str ] = None , passwd : Optional [str ] = None ) -> None :
72+ def create_whatsminerv3_client (
73+ self , ip_addr : str , user : Optional [str ] = None , passwd : Optional [str ] = None
74+ ) -> None :
6875 try :
6976 self .client = WhatsminerV3Client (ip_addr , user , passwd )
7077 except FailedConnectionError as err :
7178 logger .error (err )
7279
73- def create_volcminer_client (self , ip_addr : str , passwd : Optional [str ] = None ) -> None :
80+ def create_volcminer_client (
81+ self , ip_addr : str , passwd : Optional [str ] = None
82+ ) -> None :
7483 try :
7584 self .client = VolcminerHTTPClient (ip_addr , passwd )
7685 except (FailedConnectionError , AuthenticationError ) as err :
7786 logger .error (err )
7887
79- def create_goldshell_client (self , ip_addr : str , passwd : Optional [str ] = None ) -> None :
88+ def create_goldshell_client (
89+ self , ip_addr : str , passwd : Optional [str ] = None
90+ ) -> None :
8091 try :
8192 self .client = GoldshellHTTPClient (ip_addr , passwd )
8293 except (FailedConnectionError , AuthenticationError ) as err :
8394 logger .error (err )
8495
85- def create_sealminer_client (self , ip_addr : str , passwd : Optional [str ] = None ) -> None :
96+ def create_sealminer_client (
97+ self , ip_addr : str , passwd : Optional [str ] = None
98+ ) -> None :
8699 try :
87100 self .client = SealminerHTTPClient (ip_addr , passwd )
88101 except (FailedConnectionError , AuthenticationError ) as err :
89102 logger .error (err )
90103
91- def create_elphapex_client (self , ip_addr : str , passwd : Optional [str ] = None ) -> None :
104+ def create_elphapex_client (
105+ self , ip_addr : str , passwd : Optional [str ] = None
106+ ) -> None :
92107 try :
93108 self .client = ElphapexHTTPClient (ip_addr , passwd )
94109 except (FailedConnectionError , AuthenticationError ) as err :
95110 logger .error (err )
96111
97- def create_dragonball_client (self , ip_addr : str , passwd : Optional [str ] = None ) -> None :
112+ def create_dragonball_client (
113+ self , ip_addr : str , passwd : Optional [str ] = None
114+ ) -> None :
98115 try :
99116 self .client = DragonballHTTPClient (ip_addr , passwd )
100117 except (FailedConnectionError , AuthenticationError ) as err :
101118 logger .error (err )
102119
103120 def create_client_from_type (
104- self , miner_type : str , ip_addr : str , auth : Optional [str ] = None , custom_auth : Optional [str ] = None
121+ self ,
122+ miner_type : str ,
123+ ip_addr : str ,
124+ auth : Optional [str ] = None ,
125+ custom_auth : Optional [str ] = None ,
105126 ) -> None :
106127 match miner_type :
107128 case "antminer" :
@@ -181,12 +202,14 @@ def is_dragonball(self) -> bool:
181202 return True
182203 return False
183204
184- def upgrade_whatsminer_client (self , ip : str , user : Optional [str ] = None , passwd : Optional [str ] = None ) -> None :
205+ def upgrade_whatsminer_client (
206+ self , ip : str , user : Optional [str ] = None , passwd : Optional [str ] = None
207+ ) -> None :
185208 if self .client and isinstance (self .client , WhatsminerRPCClient ):
186209 ver = self .client .get_version ()
187210 if int (ver ["Msg" ]["fw_ver" ][:6 ]) > 202412 :
188- self .close_client ()
189- self .create_whatsminerv3_client (ip , user , passwd )
211+ self .close_client ()
212+ self .create_whatsminerv3_client (ip , user , passwd )
190213
191214 def get_target_info (self , parser : Parser ) -> Dict [str , str ]:
192215 result = parser .get_target ()
0 commit comments