|
@@ -178,30 +178,34 @@ class radiator_function(object):
|
178
|
178
|
self.boost_timer = None
|
179
|
179
|
self.gui_heating.set_timer('-')
|
180
|
180
|
|
|
181
|
+ def update_states(self, away_mode=None, summer_mode=None):
|
|
182
|
+ if away_mode is not None:
|
|
183
|
+ self.__away_mode__ = away_mode
|
|
184
|
+ if summer_mode is not None:
|
|
185
|
+ self.__summer_mode__ = summer_mode
|
|
186
|
+ self.gui_heating.set_away(self.__away_mode__)
|
|
187
|
+ self.gui_heating.set_summer(self.__summer_mode__)
|
|
188
|
+ self.gui_heating.set_enable(not self.__away_mode__ and not self.__summer_mode__)
|
|
189
|
+
|
181
|
190
|
def away_mode(self, device, key, value):
|
182
|
|
- self.__away_mode__ = value
|
183
|
|
- self.gui_heating.set_away(value)
|
184
|
191
|
if value is True:
|
185
|
|
- self.__summer_mode__ = False
|
186
|
|
- self.gui_heating.set_summer(False)
|
187
|
192
|
self.cancel_boost()
|
|
193
|
+ self.update_states(away_mode=value, summer_mode=False)
|
188
|
194
|
self.heating_valve.set_heating_setpoint(self.default_temperature - self.AWAY_REDUCTION)
|
189
|
195
|
else:
|
|
196
|
+ self.update_states(away_mode=value)
|
190
|
197
|
self.heating_valve.set_heating_setpoint(self.default_temperature)
|
191
|
198
|
|
192
|
199
|
def summer_mode(self, device, key, value):
|
193
|
|
- self.__summer_mode__ = value
|
194
|
|
- self.gui_heating.set_summer(value)
|
195
|
200
|
if value is True:
|
196
|
|
- self.__away_mode__ = False
|
197
|
|
- self.gui_heating.set_away(False)
|
198
|
201
|
self.cancel_boost()
|
|
202
|
+ self.update_states(away_mode=False, summer_mode=value)
|
199
|
203
|
self.heating_valve.set_heating_setpoint(self.SUMMER_TEMPERATURE)
|
200
|
204
|
else:
|
|
205
|
+ self.update_states(summer_mode=value)
|
201
|
206
|
self.heating_valve.set_heating_setpoint(self.default_temperature)
|
202
|
207
|
|
203
|
208
|
def boost(self, device, key, data):
|
204
|
|
- self.cancel_boost()
|
205
|
209
|
if self.boost_timer is None:
|
206
|
210
|
self.heating_valve.logger.info('Starting boost mode with setpoint %.1f°C.', self.BOOST_TEMPERATURE)
|
207
|
211
|
self.boost_timer = 15*60
|
|
@@ -210,19 +214,18 @@ class radiator_function(object):
|
210
|
214
|
self.boost_timer += 15 * 60
|
211
|
215
|
if self.boost_timer > 60 * 60:
|
212
|
216
|
self.boost_timer = 60 * 60
|
|
217
|
+ self.update_states(away_mode=False, summer_mode=False)
|
213
|
218
|
|
214
|
219
|
def setpoint_to_default(self, device, key, data):
|
215
|
|
- self.heating_valve.set_heating_setpoint(self.default_temperature)
|
|
220
|
+ self.set_heating_setpoint(device, key, self.default_temperature)
|
216
|
221
|
|
217
|
222
|
def set_heating_setpoint(self, device, key, data):
|
218
|
|
- self.cancel_boost()
|
219
|
223
|
self.heating_valve.set_heating_setpoint(data)
|
|
224
|
+ self.cancel_boost()
|
|
225
|
+ self.update_states(away_mode=False, summer_mode=False)
|
220
|
226
|
|
221
|
227
|
def get_radiator_setpoint(self, device, key, data):
|
222
|
228
|
self.gui_heating.set_setpoint_temperature(data)
|
223
|
|
- if self.__away_mode__:
|
224
|
|
- self.away_mode(device, self.gui_heating.KEY_AWAY, True)
|
225
|
|
- if self.__summer_mode__:
|
226
|
|
- self.summer_mode(device, self.gui_heating.KEY_SUMMER, True)
|
|
229
|
+ self.update_states()
|
227
|
230
|
if self.boost_timer is None and not self.__away_mode__ and not self.__summer_mode__:
|
228
|
231
|
self.regular_temp_setpoint = data
|