Skip to content

Commit 624a3c5

Browse files
wilfredallynb-rowan
authored andcommitted
feature: revise atmset input params
1 parent 2ec8054 commit 624a3c5

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

pyasic/rpc/luxminer.py

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,28 @@ async def atm(self) -> dict:
161161
"""
162162
return await self.send_command("atm")
163163

164-
async def atmset(self, command: str) -> dict:
164+
async def atmset(
165+
self,
166+
enabled: bool = None,
167+
startup_minutes: int = None,
168+
post_ramp_minutes: int = None,
169+
temp_window: int = None,
170+
min_profile: str = None,
171+
max_profile: str = None,
172+
prevent_oc: bool = None,
173+
) -> dict:
165174
"""Sets the ATM configuration.
166175
<details>
167176
<summary>Expand</summary>
168177
169178
Parameters:
170-
command: comma-separated list of key-value pairs, in the format key=value
179+
enabled: Enable or disable ATM
180+
startup_minutes: Minimum time (minutes) before ATM starts at system startup
181+
post_ramp_minutes: Minimum time (minutes) before ATM starts after ramping
182+
temp_window: Number of degrees below "Hot" temperature where ATM begins adjusting profiles
183+
min_profile: Lowest profile to use (e.g. "145MHz", "+1", "-2"). Empty string for unbounded
184+
max_profile: Highest profile to use (e.g. "395MHz", "+1", "-2")
185+
prevent_oc: When turning off ATM, revert to default profile if in higher profile
171186
172187
Returns:
173188
A dictionary containing status information about the ATM configuration update:
@@ -179,7 +194,22 @@ async def atmset(self, command: str) -> dict:
179194
- When: Timestamp
180195
</details>
181196
"""
182-
return await self.send_privileged_command("atmset", command)
197+
atmset_data = []
198+
if enabled is not None:
199+
atmset_data.append(f"enabled={str(enabled).lower()}")
200+
if startup_minutes is not None:
201+
atmset_data.append(f"startup_minutes={startup_minutes}")
202+
if post_ramp_minutes is not None:
203+
atmset_data.append(f"post_ramp_minutes={post_ramp_minutes}")
204+
if temp_window is not None:
205+
atmset_data.append(f"temp_window={temp_window}")
206+
if min_profile is not None:
207+
atmset_data.append(f"min_profile={min_profile}")
208+
if max_profile is not None:
209+
atmset_data.append(f"max_profile={max_profile}")
210+
if prevent_oc is not None:
211+
atmset_data.append(f"prevent_oc={str(prevent_oc).lower()}")
212+
return await self.send_privileged_command("atmset", *atmset_data)
183213

184214
async def check(self, command: str) -> dict:
185215
"""Check if the command `command` exists in LUXMiner.

0 commit comments

Comments
 (0)