commit 7d79bf68b1901e62d9e9d11bed2c78ed001f1d31 parent ca7e83f3f88150864a4dd5344f0f164aee42af16 Author: Sebastiano Tronto <sebastiano@tronto.net> Date: Sun, 28 May 2023 22:13:31 +0200 [REFACTOR] Simplified conditional Diffstat:
M | thermostat.py | | | 7 | ++----- |
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/thermostat.py b/thermostat.py @@ -10,11 +10,8 @@ class Thermostat: return int(datetime.now().strftime("%H")) def GetCurrentRequiredTemperature(self): - if self.setPoint != None: - if self.GetCurrentTime() >= self.setPoint[0]: - return self.setPoint[1] - else: - return 10 + if self.setPoint != None and self.GetCurrentTime() >= self.setPoint[0]: + return self.setPoint[1] return 10 def AddSetPoint(self, hour, temperature):