Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Commit

Permalink
Reintroduce HA session
Browse files Browse the repository at this point in the history
  • Loading branch information
llluis authored and titilambert committed Jan 24, 2021
1 parent 00f5818 commit 84ba7e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyhydroquebec/__version__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""PyHydroQuebec version."""
VERSION = "3.0.4"
VERSION = "3.0.5"
8 changes: 4 additions & 4 deletions pyhydroquebec/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ class HydroQuebecClient():
"""PyHydroQuebec HTTP Client."""

def __init__(self, username, password, timeout=REQUESTS_TIMEOUT,
log_level='INFO'):
session=None, log_level='INFO'):
"""Initialize the client object."""
self.username = username
self.password = password
self._timeout = timeout
self._session = session
self.guid = str(uuid.uuid1())
self.reset()
self.logger = _get_logger(log_level)
self.logger.debug("Loaded llluis' pyHydroQuebec")

def reset(self):
self._customers = []
self._session = None
self.access_token = None
self.cookies = {}
self._selected_customer = None
Expand Down Expand Up @@ -135,8 +135,8 @@ def selected_customer(self):

def _get_httpsession(self):
"""Set http session."""
#if self._session is None:
self._session = aiohttp.ClientSession(requote_redirect_url=False,)
if self._session is None:
self._session = aiohttp.ClientSession(requote_redirect_url=False,)

async def login(self):
"""Log in HydroQuebec website.
Expand Down

0 comments on commit 84ba7e0

Please sign in to comment.