From e73ca5a0963a3be3cfb0f3bfe6da689cfef252ea Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Wed, 17 Nov 2021 11:49:15 +0100 Subject: [PATCH] Added 'No ventilation' option to expert app fixes #112 --- cara/apps/expert.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cara/apps/expert.py b/cara/apps/expert.py index 664f97b3..ef19f8c4 100644 --- a/cara/apps/expert.py +++ b/cara/apps/expert.py @@ -434,7 +434,7 @@ class ModelWidgets(View): widget.layout.visible = False ventilation_w = widgets.ToggleButtons( - options=ventilation_widgets.keys(), + options=['Natural', 'Mechanical', 'No ventilation'] ) def toggle_ventilation(value): @@ -532,6 +532,7 @@ class CARAStateBuilder(state.StateBuilder): states={ 'Natural': self.build_generic(models.WindowOpening), 'Mechanical': self.build_generic(models.HVACMechanical), + 'No ventilation': self.build_generic(models.AirChange), }, state_builder=self, ) @@ -539,6 +540,10 @@ class CARAStateBuilder(state.StateBuilder): s._states['Mechanical'].dcs_update_from( models.HVACMechanical(models.PeriodicInterval(period=24*60, duration=24*60), 500.) ) + # Initialise the No ventilation state + s._states['No ventilation'].dcs_update_from( + models.AirChange(active=models.PeriodicInterval(period=120, duration=120), air_exch=0.) + ) return s