|
49 | 49 | ), |
50 | 50 | str(DataOptions.EXPECTED_HASHRATE): DataFunction( |
51 | 51 | "_get_expected_hashrate", |
52 | | - [RPCAPICommand("rpc_stats", "stats")], |
| 52 | + [RPCAPICommand("rpc_estats", "estats")], |
53 | 53 | ), |
54 | 54 | str(DataOptions.HASHBOARDS): DataFunction( |
55 | 55 | "_get_hashboards", |
56 | | - [RPCAPICommand("rpc_stats", "stats")], |
| 56 | + [RPCAPICommand("rpc_estats", "estats")], |
57 | 57 | ), |
58 | 58 | str(DataOptions.ENVIRONMENT_TEMP): DataFunction( |
59 | 59 | "_get_env_temp", |
60 | | - [RPCAPICommand("rpc_stats", "stats")], |
| 60 | + [RPCAPICommand("rpc_estats", "estats")], |
61 | 61 | ), |
62 | 62 | str(DataOptions.WATTAGE_LIMIT): DataFunction( |
63 | 63 | "_get_wattage_limit", |
64 | | - [RPCAPICommand("rpc_stats", "stats")], |
| 64 | + [RPCAPICommand("rpc_estats", "estats")], |
65 | 65 | ), |
66 | 66 | str(DataOptions.WATTAGE): DataFunction( |
67 | 67 | "_get_wattage", |
68 | | - [RPCAPICommand("rpc_stats", "stats")], |
| 68 | + [RPCAPICommand("rpc_estats", "estats")], |
69 | 69 | ), |
70 | 70 | str(DataOptions.FANS): DataFunction( |
71 | 71 | "_get_fans", |
72 | | - [RPCAPICommand("rpc_stats", "stats")], |
| 72 | + [RPCAPICommand("rpc_estats", "estats")], |
73 | 73 | ), |
74 | 74 | str(DataOptions.FAULT_LIGHT): DataFunction( |
75 | 75 | "_get_fault_light", |
76 | | - [RPCAPICommand("rpc_stats", "stats")], |
| 76 | + [RPCAPICommand("rpc_estats", "estats")], |
77 | 77 | ), |
78 | 78 | str(DataOptions.UPTIME): DataFunction( |
79 | 79 | "_get_uptime", |
|
102 | 102 | ), |
103 | 103 | str(DataOptions.HASHRATE): DataFunction( |
104 | 104 | "_get_hashrate", |
105 | | - [RPCAPICommand("rpc_stats", "stats")], |
| 105 | + [RPCAPICommand("rpc_estats", "estats")], |
106 | 106 | ), |
107 | 107 | str(DataOptions.EXPECTED_HASHRATE): DataFunction( |
108 | 108 | "_get_expected_hashrate", |
109 | | - [RPCAPICommand("rpc_stats", "stats")], |
| 109 | + [RPCAPICommand("rpc_estats", "estats")], |
110 | 110 | ), |
111 | 111 | str(DataOptions.HASHBOARDS): DataFunction( |
112 | 112 | "_get_hashboards", |
113 | | - [RPCAPICommand("rpc_stats", "stats")], |
| 113 | + [RPCAPICommand("rpc_estats", "estats")], |
114 | 114 | ), |
115 | 115 | str(DataOptions.ENVIRONMENT_TEMP): DataFunction( |
116 | 116 | "_get_env_temp", |
117 | | - [RPCAPICommand("rpc_stats", "stats")], |
| 117 | + [RPCAPICommand("rpc_estats", "estats")], |
118 | 118 | ), |
119 | 119 | str(DataOptions.WATTAGE_LIMIT): DataFunction( |
120 | 120 | "_get_wattage_limit", |
121 | | - [RPCAPICommand("rpc_stats", "stats")], |
| 121 | + [RPCAPICommand("rpc_estats", "estats")], |
122 | 122 | ), |
123 | 123 | str(DataOptions.WATTAGE): DataFunction( |
124 | 124 | "_get_wattage", |
125 | | - [RPCAPICommand("rpc_stats", "stats")], |
| 125 | + [RPCAPICommand("rpc_estats", "estats")], |
126 | 126 | ), |
127 | 127 | str(DataOptions.FANS): DataFunction( |
128 | 128 | "_get_fans", |
129 | | - [RPCAPICommand("rpc_stats", "stats")], |
| 129 | + [RPCAPICommand("rpc_estats", "estats")], |
130 | 130 | ), |
131 | 131 | str(DataOptions.FAULT_LIGHT): DataFunction( |
132 | 132 | "_get_fault_light", |
133 | | - [RPCAPICommand("rpc_stats", "stats")], |
| 133 | + [RPCAPICommand("rpc_estats", "estats")], |
134 | 134 | ), |
135 | 135 | str(DataOptions.UPTIME): DataFunction( |
136 | 136 | "_get_uptime", |
@@ -170,58 +170,58 @@ class CGMinerAvalonNano3s(AvalonMiner, AvalonNano3s): |
170 | 170 |
|
171 | 171 | data_locations = AVALON_NANO3S_DATA_LOC |
172 | 172 |
|
173 | | - async def _get_wattage(self, rpc_stats: dict = None) -> Optional[int]: |
174 | | - if rpc_stats is None: |
| 173 | + async def _get_wattage(self, rpc_estats: dict = None) -> Optional[int]: |
| 174 | + if rpc_estats is None: |
175 | 175 | try: |
176 | | - rpc_stats = await self.rpc.stats() |
| 176 | + rpc_estats = await self.rpc.estats() |
177 | 177 | except APIError: |
178 | 178 | pass |
179 | 179 |
|
180 | | - if rpc_stats is not None: |
| 180 | + if rpc_estats is not None: |
181 | 181 | try: |
182 | | - unparsed_stats = rpc_stats["STATS"][0]["MM ID0"] |
183 | | - parsed_stats = self.parse_stats(unparsed_stats) |
184 | | - return int(parsed_stats["PS"][6]) |
| 182 | + unparsed_estats = rpc_estats["STATS"][0]["MM ID0"] |
| 183 | + parsed_estats = self.parse_estats(unparsed_estats) |
| 184 | + return int(parsed_estats["PS"][6]) |
185 | 185 | except (IndexError, KeyError, ValueError, TypeError): |
186 | 186 | pass |
187 | 187 |
|
188 | | - async def _get_hashrate(self, rpc_stats: dict = None) -> Optional[AlgoHashRate]: |
189 | | - if rpc_stats is None: |
| 188 | + async def _get_hashrate(self, rpc_estats: dict = None) -> Optional[AlgoHashRate]: |
| 189 | + if rpc_estats is None: |
190 | 190 | try: |
191 | | - rpc_stats = await self.rpc.stats() |
| 191 | + rpc_estats = await self.rpc.estats() |
192 | 192 | except APIError: |
193 | 193 | pass |
194 | 194 |
|
195 | | - if rpc_stats is not None: |
| 195 | + if rpc_estats is not None: |
196 | 196 | try: |
197 | | - unparsed_stats = rpc_stats["STATS"][0]["MM ID0"] |
198 | | - parsed_stats = self.parse_stats(unparsed_stats) |
| 197 | + unparsed_estats = rpc_estats["STATS"][0]["MM ID0"] |
| 198 | + parsed_estats = self.parse_estats(unparsed_estats) |
199 | 199 | return self.algo.hashrate( |
200 | | - rate=float(parsed_stats["GHSspd"][0]), unit=self.algo.unit.GH |
| 200 | + rate=float(parsed_estats["GHSspd"]), unit=self.algo.unit.GH |
201 | 201 | ).into(self.algo.unit.default) |
202 | 202 | except (IndexError, KeyError, ValueError, TypeError): |
203 | 203 | pass |
204 | 204 |
|
205 | | - async def _get_hashboards(self, rpc_stats: dict = None) -> List[HashBoard]: |
206 | | - hashboards = await AvalonMiner._get_hashboards(self, rpc_stats) |
| 205 | + async def _get_hashboards(self, rpc_estats: dict = None) -> List[HashBoard]: |
| 206 | + hashboards = await AvalonMiner._get_hashboards(self, rpc_estats) |
207 | 207 |
|
208 | | - if rpc_stats is None: |
| 208 | + if rpc_estats is None: |
209 | 209 | try: |
210 | | - rpc_stats = await self.rpc.stats() |
| 210 | + rpc_estats = await self.rpc.estats() |
211 | 211 | except APIError: |
212 | 212 | pass |
213 | 213 |
|
214 | | - if rpc_stats is not None: |
| 214 | + if rpc_estats is not None: |
215 | 215 |
|
216 | 216 | try: |
217 | | - unparsed_stats = rpc_stats["STATS"][0]["MM ID0"] |
218 | | - parsed_stats = self.parse_stats(unparsed_stats) |
| 217 | + unparsed_estats = rpc_estats["STATS"][0]["MM ID0"] |
| 218 | + parsed_estats = self.parse_estats(unparsed_estats) |
219 | 219 | except (IndexError, KeyError, ValueError, TypeError): |
220 | 220 | return hashboards |
221 | 221 |
|
222 | 222 | for board in range(len(hashboards)): |
223 | 223 | try: |
224 | | - board_hr = parsed_stats["GHSspd"][board] |
| 224 | + board_hr = parsed_estats["GHSspd"][board] |
225 | 225 | hashboards[board].hashrate = self.algo.hashrate( |
226 | 226 | rate=float(board_hr), unit=self.algo.unit.GH |
227 | 227 | ).into(self.algo.unit.default) |
|
0 commit comments