From 81f66b1e663811ff35412212ebbc03ac6adfcf4c Mon Sep 17 00:00:00 2001 From: Brian Wilson Date: Wed, 17 Jun 2020 13:23:11 -0400 Subject: [PATCH 1/6] should be able to request <60 >=0 mins of activity. not just 15 min increments --- raincloudy/faucet.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/raincloudy/faucet.py b/raincloudy/faucet.py index 267d754..a73f861 100644 --- a/raincloudy/faucet.py +++ b/raincloudy/faucet.py @@ -233,11 +233,17 @@ def name(self, value): def _set_manual_watering_time(self, zoneid, value): """Private method to set watering_time per zone.""" - if value not in MANUAL_WATERING_ALLOWED: - raise ValueError( - 'Valid options are: {}'.format( + if (isinstance(value, str)): + if value not in MANUAL_WATERING_ALLOWED or (value <= 0 and value > MAX_WATERING_MINUTES): + raise ValueError( + 'Valid options are: {}'.format( ', '.join(map(str, MANUAL_WATERING_ALLOWED))) - ) + ) + else: + if (value < 0 or value > MAX_WATERING_MINUTES): + raise ValueError( + 'Valid options are 0-{}'.format(MANUAL_WATERING_ALLOWED) + ) ddata = self.preupdate() attr = 'zone{}_select_manual_mode'.format(zoneid) From 6445407d693f30b173b909886742814d738f15a5 Mon Sep 17 00:00:00 2001 From: Brian Wilson Date: Wed, 17 Jun 2020 13:28:45 -0400 Subject: [PATCH 2/6] should be able to select times outside of 15 min windows, 53 minutes for instance --- raincloudy/faucet.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/raincloudy/faucet.py b/raincloudy/faucet.py index 267d754..a73f861 100644 --- a/raincloudy/faucet.py +++ b/raincloudy/faucet.py @@ -233,11 +233,17 @@ def name(self, value): def _set_manual_watering_time(self, zoneid, value): """Private method to set watering_time per zone.""" - if value not in MANUAL_WATERING_ALLOWED: - raise ValueError( - 'Valid options are: {}'.format( + if (isinstance(value, str)): + if value not in MANUAL_WATERING_ALLOWED or (value <= 0 and value > MAX_WATERING_MINUTES): + raise ValueError( + 'Valid options are: {}'.format( ', '.join(map(str, MANUAL_WATERING_ALLOWED))) - ) + ) + else: + if (value < 0 or value > MAX_WATERING_MINUTES): + raise ValueError( + 'Valid options are 0-{}'.format(MANUAL_WATERING_ALLOWED) + ) ddata = self.preupdate() attr = 'zone{}_select_manual_mode'.format(zoneid) From ef171e0d40aff6a2ebed3f8dab36b071d9b573a0 Mon Sep 17 00:00:00 2001 From: Brian Wilson Date: Wed, 17 Jun 2020 13:33:59 -0400 Subject: [PATCH 3/6] should be able to select times outside of 15 min windows, 53 minutes for instance --- raincloudy/faucet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/raincloudy/faucet.py b/raincloudy/faucet.py index a73f861..baee6b0 100644 --- a/raincloudy/faucet.py +++ b/raincloudy/faucet.py @@ -234,7 +234,7 @@ def name(self, value): def _set_manual_watering_time(self, zoneid, value): """Private method to set watering_time per zone.""" if (isinstance(value, str)): - if value not in MANUAL_WATERING_ALLOWED or (value <= 0 and value > MAX_WATERING_MINUTES): + if value not in MANUAL_WATERING_ALLOWED: raise ValueError( 'Valid options are: {}'.format( ', '.join(map(str, MANUAL_WATERING_ALLOWED))) From 8a323782f2c9b7ebd27ee8184008e53380cf18ad Mon Sep 17 00:00:00 2001 From: Brian Wilson Date: Wed, 17 Jun 2020 13:48:39 -0400 Subject: [PATCH 4/6] typo --- raincloudy/faucet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/raincloudy/faucet.py b/raincloudy/faucet.py index baee6b0..182a9c9 100644 --- a/raincloudy/faucet.py +++ b/raincloudy/faucet.py @@ -237,7 +237,7 @@ def _set_manual_watering_time(self, zoneid, value): if value not in MANUAL_WATERING_ALLOWED: raise ValueError( 'Valid options are: {}'.format( - ', '.join(map(str, MANUAL_WATERING_ALLOWED))) + ', '.join(map(str, MANUAL_WATERING_ALLOWED))) ) else: if (value < 0 or value > MAX_WATERING_MINUTES): From 2c2f0605c257d2638ab168bcda7595ae6d6732b9 Mon Sep 17 00:00:00 2001 From: Brian Wilson Date: Wed, 17 Jun 2020 14:03:39 -0400 Subject: [PATCH 5/6] typo --- raincloudy/faucet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/raincloudy/faucet.py b/raincloudy/faucet.py index 182a9c9..e5ebec4 100644 --- a/raincloudy/faucet.py +++ b/raincloudy/faucet.py @@ -233,11 +233,11 @@ def name(self, value): def _set_manual_watering_time(self, zoneid, value): """Private method to set watering_time per zone.""" - if (isinstance(value, str)): + if isinstance(value, str): if value not in MANUAL_WATERING_ALLOWED: raise ValueError( 'Valid options are: {}'.format( - ', '.join(map(str, MANUAL_WATERING_ALLOWED))) + ', '.join(map(str, MANUAL_WATERING_ALLOWED))) ) else: if (value < 0 or value > MAX_WATERING_MINUTES): From b74488f3d15ffcb0572c5ecf2406fd41e917fe7c Mon Sep 17 00:00:00 2001 From: Brian Wilson Date: Thu, 13 Jul 2023 20:38:02 -0400 Subject: [PATCH 6/6] allow untrusted certs --- raincloudy/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/raincloudy/core.py b/raincloudy/core.py index 17038b7..6795792 100644 --- a/raincloudy/core.py +++ b/raincloudy/core.py @@ -79,7 +79,7 @@ def _authenticate(self): __location__ = os.path.realpath( os.path.join(os.getcwd(), os.path.dirname(__file__))) - cert_file = Path(__location__ + "/wifiaquatimer_com_chain.cer") + #cert_file = Path(__location__ + "/wifiaquatimer_com_chain.cer") # to obtain csrftoken, remove Referer from headers headers = HEADERS.copy() @@ -88,7 +88,7 @@ def _authenticate(self): # initial GET request self.client = requests.Session() self.client.proxies = self._proxies - self.client.verify = cert_file.resolve() + #self.client.verify = cert_file.resolve() self.client.stream = True self.client.get(LOGIN_ENDPOINT, headers=headers)