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) diff --git a/raincloudy/faucet.py b/raincloudy/faucet.py index 267d754..e5ebec4 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( - ', '.join(map(str, MANUAL_WATERING_ALLOWED))) - ) + if isinstance(value, str): + if value not in MANUAL_WATERING_ALLOWED: + 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)