Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/fyta_cli/fyta_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ async def get_plants(self) -> dict[int, str]:
self.session = ClientSession()
self._close_session = True

if self.expiration.timestamp() > datetime.now().timestamp():
if self.expiration.timestamp() < datetime.now().timestamp():
await self.login() # get new access token, if current token expired

header = {
Expand Down Expand Up @@ -170,7 +170,7 @@ async def get_plant_data(self, plant_id: int) -> dict[str, Any]:
self.session = ClientSession()
self._close_session = True

if self.expiration.timestamp() > datetime.now().timestamp():
if self.expiration.timestamp() < datetime.now().timestamp():
await self.login() # get new access token, if current token expired

header = {
Expand Down Expand Up @@ -210,7 +210,7 @@ async def get_plant_data(self, plant_id: int) -> dict[str, Any]:
async def get_plant_image(self, image_url) -> tuple[str | None, bytes] | None:
"""Fetch the user image from the API."""

if self.expiration.timestamp() > datetime.now().timestamp():
if self.expiration.timestamp() < datetime.now().timestamp():
await self.login() # get new access token, if current token expired

header = {
Expand Down