From 71c6f08cb6db75031b5f2d4e3b19b560f2f629a7 Mon Sep 17 00:00:00 2001 From: Nicolas Mounet Date: Thu, 5 Nov 2020 01:06:36 +0100 Subject: [PATCH] Adding hours of temperature changes to the state_change_times in the Model class --- cara/models.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cara/models.py b/cara/models.py index 32f1fa65..0f404dfa 100644 --- a/cara/models.py +++ b/cara/models.py @@ -391,6 +391,10 @@ class Model: state_change_times = set() state_change_times.update(self.infected.presence.transition_times()) state_change_times.update(self.ventilation.active.transition_times()) + if isinstance(self.ventilation,WindowOpening): + state_change_times.update(self.ventilation.inside_temp.interval().transition_times()) + state_change_times.update(self.ventilation.outside_temp.interval().transition_times()) + return sorted(state_change_times) def last_state_change(self, time: float):