From 2fd69919d766164528f0297e0a5695a3eb74ce5f Mon Sep 17 00:00:00 2001 From: Dan Cinnamon Date: Sun, 14 Jan 2018 00:23:51 -0600 Subject: [PATCH 1/2] Resolved validation issue on set temperature point method. --- src/venstarcolortouch/venstarcolortouch.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/venstarcolortouch/venstarcolortouch.py b/src/venstarcolortouch/venstarcolortouch.py index 72647ae..4f5b84c 100644 --- a/src/venstarcolortouch/venstarcolortouch.py +++ b/src/venstarcolortouch/venstarcolortouch.py @@ -215,8 +215,10 @@ def set_control(self): return False def set_setpoints(self, heattemp, cooltemp): - # Must not violate setpointdelta. - if heattemp + self.setpointdelta > cooltemp: + # Must not violate setpointdelta if we're in auto mode. + if heattemp + self.setpointdelta > cooltemp and self.mode == self.MODE_AUTO: + print("In auto mode, the cool temp must be {0} " + "degrees warmer than the heat temp.".format(self.setpointdelta)) return False self.heattemp = heattemp self.cooltemp = cooltemp From 9dbb06d74cc7391c2d19cd1de4d5e84f581e316e Mon Sep 17 00:00:00 2001 From: Dan Cinnamon Date: Sun, 14 Jan 2018 01:01:39 -0600 Subject: [PATCH 2/2] Switching order of if- auto check should be first. --- src/venstarcolortouch/venstarcolortouch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/venstarcolortouch/venstarcolortouch.py b/src/venstarcolortouch/venstarcolortouch.py index 4f5b84c..2440679 100644 --- a/src/venstarcolortouch/venstarcolortouch.py +++ b/src/venstarcolortouch/venstarcolortouch.py @@ -216,7 +216,7 @@ def set_control(self): def set_setpoints(self, heattemp, cooltemp): # Must not violate setpointdelta if we're in auto mode. - if heattemp + self.setpointdelta > cooltemp and self.mode == self.MODE_AUTO: + if self.mode == self.MODE_AUTO and heattemp + self.setpointdelta > cooltemp: print("In auto mode, the cool temp must be {0} " "degrees warmer than the heat temp.".format(self.setpointdelta)) return False