File tree Expand file tree Collapse file tree 1 file changed +0
-13
lines changed
Expand file tree Collapse file tree 1 file changed +0
-13
lines changed Original file line number Diff line number Diff line change 1717_LOGGER = logging .getLogger (__name__ )
1818timestamp = _timestamp # keep public name for tests
1919
20- DERIVATIVE_DECAY = 0.8
2120DERIVATIVE_ALPHA1 = 0.8
2221DERIVATIVE_ALPHA2 = 0.6
2322DERIVATIVE_RAW_CAP = 5.0
24- INTEGRAL_MAX_INTERVAL = 900.0
25- DERIVATIVE_MAX_INTERVAL = 180.0
2623
2724STORAGE_VERSION = 1
2825STORAGE_KEY_INTEGRAL = "integral"
@@ -209,11 +206,7 @@ def _update_integral(self, state: TemperatureState) -> None:
209206 if self .ki is None :
210207 return
211208
212- # Cap the integration interval so long gaps don't over-accumulate.
213- delta_time = min (delta_time , INTEGRAL_MAX_INTERVAL )
214209 self ._integral += self .ki * state .error * delta_time
215-
216- # Clamp integral to the heating curve bounds.
217210 self ._integral = clamp_to_range (self ._integral , self ._heating_curve .value )
218211
219212 # Record the timestamp used for this integration step.
@@ -247,12 +240,6 @@ def _update_derivative(self, state: TemperatureState) -> None:
247240 self ._last_derivative_updated = state .last_changed .timestamp ()
248241 return
249242
250- if delta_time > DERIVATIVE_MAX_INTERVAL :
251- self ._raw_derivative *= DERIVATIVE_DECAY
252- self ._last_temperature = state .current
253- self ._last_derivative_updated = state .last_changed .timestamp ()
254- return
255-
256243 derivative = - temperature_delta / delta_time
257244
258245 # Apply the first low-pass filter.
You can’t perform that action at this time.
0 commit comments