From 9a6799ac6987a1c07d7513b06885e2c2726cb30e Mon Sep 17 00:00:00 2001 From: Tuen Lee Date: Wed, 27 Dec 2023 00:58:48 +0100 Subject: [PATCH] fix skip cache after code cleanup --- custom_components/polestar_api/pypolestar/polestar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/polestar_api/pypolestar/polestar.py b/custom_components/polestar_api/pypolestar/polestar.py index 81257a9..6175ffd 100644 --- a/custom_components/polestar_api/pypolestar/polestar.py +++ b/custom_components/polestar_api/pypolestar/polestar.py @@ -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