diff --git a/custom_components/o2/api_client.py b/custom_components/o2/api_client.py index 9b8ee25..f333b4b 100644 --- a/custom_components/o2/api_client.py +++ b/custom_components/o2/api_client.py @@ -40,7 +40,6 @@ def create_session(self, username=None, password=None): self._password = password self._token_birth = time() - return True def get_device_info(self): @@ -69,8 +68,8 @@ def get_csrf(self): return data_page_response.text.split("Liferay.authToken = '")[1].split("'")[0] def _post(self, url): - # Refresh token if its over x mins old - if time() - self._token_birth > 3600: + # Refresh token if its over 30 mins old + if time() - self._token_birth > 1800: self.create_session() csrfToken = self.get_csrf()