We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1626f17 commit 9c5317eCopy full SHA for 9c5317e
simvue/eco/emissions_monitor.py
@@ -156,10 +156,10 @@ def check_refresh(self) -> bool:
156
whether a refresh of the CO2 intensity was requested
157
from the CO2 Signal API.
158
"""
159
- if (
160
- not self.co2_intensity
161
- and not self._local_data.setdefault(self._client.country_code, {})
162
- ) or self.outdated:
+ if not self.co2_intensity and (
+ not self._local_data.setdefault(self._client.country_code, {})
+ or self.outdated
+ ):
163
self._logger.info("🌍 CO2 emission outdated, calling API.")
164
_data: CO2SignalResponse = self._client.get()
165
self._local_data[self._client.country_code] = _data.model_dump(mode="json")
0 commit comments