From 9135fbf1688b1fc989a2674ce794e8f2686886d0 Mon Sep 17 00:00:00 2001 From: Upstream Data Date: Sat, 18 Nov 2023 23:02:16 -0700 Subject: [PATCH] Fix backwards subtraction. --- custom_components/miner/number.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/miner/number.py b/custom_components/miner/number.py index f5460fd..2a23f72 100644 --- a/custom_components/miner/number.py +++ b/custom_components/miner/number.py @@ -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: