Skip to content

Commit

Permalink
Update pyecotrend_ista.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludy87 committed Jun 15, 2024
1 parent adaa219 commit 2fc2c3a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/pyecotrend_ista/pyecotrend_ista.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ def __init__(
"""

if hass_dir:
warnings.warn("The 'hass_dir' parameter is deprecated and will be removed in a future release.", DeprecationWarning)
warnings.warn(
"The 'hass_dir' parameter is deprecated and will be removed in a future release.", DeprecationWarning
)

self._accessToken: str | None = None
self._refreshToken: str | None = None
Expand Down Expand Up @@ -823,7 +825,7 @@ def get_raw(self, obj_uuid: str | None = None) -> dict[str, Any]:
try:
raw = response.json()
if "key" in raw:
raise LoginError(f"Login fail, check your input! {raw["key"]}")
raise LoginError("Login fail, check your input! %s", raw["key"])
except requests.Timeout as error:
self._LOGGER.debug("TimeoutError: %s", error)
except requests.JSONDecodeError as err:
Expand Down Expand Up @@ -903,7 +905,10 @@ def demo_user_login(self) -> dict[str, Any]:
"""
try:
self._header["User-Agent"] = self.getUA()
with self.session.get(DEMO_USER_TOKEN, headers=self._header, ) as r:
with self.session.get(
DEMO_USER_TOKEN,
headers=self._header,
) as r:
r.raise_for_status()
try:
return r.json()
Expand Down

0 comments on commit 2fc2c3a

Please sign in to comment.