def v0_get_thermostat_configurations(self, fields=None):
     # TODO: implement the new v1 config format
     thermostats = Thermostat.select()
     return [
         thermostat.to_v0_format(mode='heating', fields=fields)
         for thermostat in thermostats
     ]
 def refresh_thermostats_from_db(self):
     for thermostat in Thermostat.select():
         thermostat_pid = self.thermostat_pids.get(thermostat.number)
         if thermostat_pid is None:
             thermostat_pid = ThermostatPid(thermostat,
                                            self._pump_valve_controller)
             thermostat_pid.subscribe_state_changes(
                 self.v0_event_thermostat_changed)
             self.thermostat_pids[thermostat.number] = thermostat_pid
         thermostat_pid.update_thermostat(thermostat)
         thermostat_pid.tick()
 def v0_get_cooling_configurations(self, fields=None):
     thermostats = Thermostat.select()
     return [
         thermostat.to_v0_format(mode='cooling', fields=fields)
         for thermostat in thermostats
     ]