Skip to content

Commit

Permalink
fix skip cache after code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Tuen Lee committed Dec 26, 2023
1 parent 3bec2e5 commit 9a6799a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/polestar_api/pypolestar/polestar.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def get_cache_data(self, query: str, field_name: str, skip_cache: bool = False):
cache_entry = self.cache_data[query]
data = cache_entry['data']
if data is not None:
if skip_cache is False or cache_entry['timestamp'] + timedelta(seconds=CACHE_TIME) > datetime.now():
if skip_cache is True or cache_entry['timestamp'] + timedelta(seconds=CACHE_TIME) > datetime.now():
return self._get_field_name_value(field_name, data)
return None

Expand Down

0 comments on commit 9a6799a

Please sign in to comment.