Skip to content

Commit

Permalink
Improve compatibility with Python3.8+ and Play(UPC) Connect Box (#32)
Browse files Browse the repository at this point in the history
* Improve compatibility with Python3.8+ and Play(UPC) Connect Box

* fixup! Improve compatibility with Python3.8+ and Play(UPC) Connect Box

* fixup! Improve compatibility with Python3.8+ and Play(UPC) Connect Box
  • Loading branch information
krzysztof-kwitt committed Jan 9, 2024
1 parent 4c9c96f commit 3a073c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Python Client for interacting with the cable modem/router Compal CH7465LG which
is provided under different names by various ISP in Europe.

- UPC Connect Box (CH)
- Play Connect Box (PL)
- Irish Virgin Media Super Hub 3.0 (IE)
- Ziggo Connectbox (NL)
- Unitymedia Connect Box (DE)
Expand Down
6 changes: 3 additions & 3 deletions connect_box/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,8 @@ async def _async_initialize_valid_token(self) -> None:
headers=self.headers,
timeout=10,
) as response:
await response.text()
#self.token = response.cookies["sessionToken"].value
await response.read()
self.token = response.cookies["sessionToken"].value

except (asyncio.TimeoutError, aiohttp.ClientError) as err:
_LOGGER.error("Can not load login page from %s: %s", self.host, err)
Expand All @@ -531,7 +531,7 @@ async def _async_do_login_with_password(self, function: int) -> None:
allow_redirects=False,
timeout=10,
) as response:
await response.text()
await response.read()

if response.status != 200:
_LOGGER.warning("Login error with code %d", response.status)
Expand Down

0 comments on commit 3a073c9

Please sign in to comment.