diff --git a/src/fyta_cli/fyta_client.py b/src/fyta_cli/fyta_client.py index 41f979e..82c73de 100644 --- a/src/fyta_cli/fyta_client.py +++ b/src/fyta_cli/fyta_client.py @@ -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 = { @@ -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 = { @@ -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 = {