File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ def check_refresh(self) -> bool:
156156 whether a refresh of the CO2 intensity was requested
157157 from the CO2 Signal API.
158158 """
159- if not self . co2_intensity and (
159+ if (
160160 not self ._local_data .setdefault (self ._client .country_code , {})
161161 or self .outdated
162162 ):
@@ -193,12 +193,11 @@ def estimate_co2_emissions(
193193 if not (_process := self ._processes .get (process_id )):
194194 self ._processes [process_id ] = (_process := ProcessData ())
195195
196- self .check_refresh ()
197-
198196 if self .co2_intensity :
199197 _current_co2_intensity = self .co2_intensity
200198 _co2_units = "kgCO2/kWh"
201199 else :
200+ self .check_refresh ()
202201 self ._current_co2_data = CO2SignalResponse (
203202 ** self ._local_data [self ._client .country_code ]
204203 )
You can’t perform that action at this time.
0 commit comments