Skip to content

Commit f5aeb2b

Browse files
committed
Call shifter not expert in case no temperature or timestamp could be found
1 parent 1052753 commit f5aeb2b

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

shifthelper/conditions.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,10 @@ def is_weather_outdatet():
209209

210210
@log_call_and_result
211211
def is_smartfact_outdatet():
212-
''' SMARTFACT not updated in the last 10 minutes '''
212+
''' SMARTFACT not updated in the last 10 minutes or timestamp missing.'''
213213
timestamp = sfc.main_page().timestamp_1
214214
if timestamp is None:
215-
raise ValueError('Could not get smartfact timestamp')
215+
return True
216216
return is_older(timestamp, timedelta(minutes=10))
217217

218218

@@ -252,11 +252,9 @@ def is_maximum_current_high():
252252

253253
@log_call_and_result
254254
def is_rel_camera_temperature_high():
255-
'''relative camera temperature > 15°C'''
255+
'''relative camera temperature > 15°C or not available. Camera off?'''
256256
relative_temperature = sfc.main_page().relative_camera_temperature.value
257-
if math.isnan(relative_temperature):
258-
raise ValueError('Could not get relative camera temperature')
259-
return relative_temperature >= 15.0
257+
return math.isnan(relative_temperature) or relative_temperature >= 15.0
260258

261259

262260
@log_call_and_result

0 commit comments

Comments
 (0)