Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions raincloudy/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)

Expand Down
16 changes: 11 additions & 5 deletions raincloudy/faucet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down