Skip to content

Commit

Permalink
Use f-string instead. Needed for #61 (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
DurgNomis-drol authored Sep 22, 2021
1 parent 2afffa1 commit 08dd8fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions mytoyota/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ async def _update_token(self) -> None:
self._token_expiration = datetime.now()
else:
raise ToyotaLoginError(
"Login failed, check your credentials! {}".format(response.text)
f"Login failed, check your credentials! {response.text}"
)

async def _is_token_valid(self) -> bool:
Expand All @@ -118,9 +118,7 @@ async def _is_token_valid(self) -> bool:
return True
return False

raise ToyotaLoginError(
"Error when trying to check token: {}".format(response.text)
)
raise ToyotaLoginError(f"Error when trying to check token: {response.text}")

async def request( # pylint: disable=too-many-arguments
self,
Expand Down
6 changes: 3 additions & 3 deletions mytoyota/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ def _add_bucket(self, data: dict, interval: str) -> list:
day[BUCKET].update(
{
UNIT: METRIC,
DATE: self._now.strptime(
"{} {}".format(dayofyear, year), "%j %Y"
).format(DATE_FORMAT),
DATE: self._now.strptime(f"{dayofyear} {year}", "%j %Y").format(
DATE_FORMAT
),
}
)
return data[HISTOGRAM]
Expand Down

0 comments on commit 08dd8fe

Please sign in to comment.