Compare commits

..

No commits in common. "c042597b65dc21483d34001b1f614edec94b026c" and "abdb3fe00c0d36290c47cc5570ef9407df6f6ace" have entirely different histories.

2 changed files with 3 additions and 3 deletions

2
.gitignore vendored
View File

@ -1,4 +1,4 @@
dist/ dist/
build/ build/
__pycache__/ __pycache__/
greenhouse.egg-info/ *.egg-info/

View File

@ -76,11 +76,11 @@ class GreenControl(Thread):
off_time = now.replace(hour=int(off_time_pattern[0]), minute=int(off_time_pattern[1]), second=0, microsecond=0) off_time = now.replace(hour=int(off_time_pattern[0]), minute=int(off_time_pattern[1]), second=0, microsecond=0)
if now > on_time and now <= off_time and not self.__water_state: if now > on_time and now <= off_time and not self.__water_state:
GPIO.output(self.__pin, 0) GPIO.output(self.__pin, 1)
self.__water_state = True self.__water_state = True
log.info("Switch water on by time") log.info("Switch water on by time")
elif now > off_time and self.__water_state: elif now > off_time and self.__water_state:
GPIO.output(self.__pin, 1) GPIO.output(self.__pin, 0)
self.__water_state = False self.__water_state = False
log.info("Switch water off by time") log.info("Switch water off by time")
sleep(1) sleep(1)