Skip to content

Commit 5bb9e18

Browse files
committed
Fix for PID not respecting sampling_period.
1 parent 7d1e6df commit 5bb9e18

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • custom_components/smart_thermostat/pid_controller

custom_components/smart_thermostat/pid_controller/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def calc(self, input_val, set_point, input_time=None, last_input_time=None):
109109
if self.mode == 'OFF': # If PID is off, don't update and return the last value
110110
return self.output
111111
if self.sampling_period != 0 and self._last_input_time is not None and \
112-
time() - self._last_input_time < self.sampling_period:
112+
time() - self._input_time < self.sampling_period:
113113
return self.output # If last sample is too young, keep last output value
114114

115115
self._last_input = self._input

0 commit comments

Comments
 (0)