Fix on thermostat

This commit is contained in:
Claudio Maggioni (maggicl) 2020-04-17 21:05:17 +02:00
parent 57a6e22e2a
commit 4aa4d68738

View file

@ -39,13 +39,7 @@ public class ThermostatController {
newT.setName(t.getName()); newT.setName(t.getName());
newT.setRoomId(t.getRoomId()); newT.setRoomId(t.getRoomId());
newT.setUseExternalSensors(t.isUseExternalSensors()); newT.setUseExternalSensors(t.isUseExternalSensors());
newT.setOn(t.isTurnOn());
if (t.isTurnOn()) {
newT.setMode(Thermostat.Mode.IDLE);
thermostatService.computeState(newT);
} else {
newT.setMode(Thermostat.Mode.OFF);
}
newT = thermostatRepository.save(newT); newT = thermostatRepository.save(newT);
thermostatService.populateMeasuredTemperature(newT); thermostatService.populateMeasuredTemperature(newT);