Skip to content

Commit

Permalink
Fix backwards subtraction.
Browse files Browse the repository at this point in the history
  • Loading branch information
UpstreamData committed Nov 19, 2023
1 parent e09dbd0 commit 9135fbf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/miner/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ async def async_set_native_value(self, value):
if isinstance(miner, BOSMiner):
max_diff = 500
try:
diff = int(self.coordinator.data["miner_sensors"]["power_limit"]) - int(value)
diff = int(value) - int(self.coordinator.data["miner_sensors"]["power_limit"])
smooth_tune = -max_diff < diff < max_diff

if smooth_tune:
Expand Down

0 comments on commit 9135fbf

Please sign in to comment.