Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions shifthelper/conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,10 @@ def is_weather_outdatet():

@log_call_and_result
def is_smartfact_outdatet():
''' SMARTFACT not updated in the last 10 minutes '''
''' SMARTFACT not updated in the last 10 minutes or timestamp missing.'''
timestamp = sfc.main_page().timestamp_1
if timestamp is None:
raise ValueError('Could not get smartfact timestamp')
return True
return is_older(timestamp, timedelta(minutes=10))


Expand Down Expand Up @@ -252,11 +252,9 @@ def is_maximum_current_high():

@log_call_and_result
def is_rel_camera_temperature_high():
'''relative camera temperature > 15°C'''
'''relative camera temperature > 15°C or not available. Camera off?'''
relative_temperature = sfc.main_page().relative_camera_temperature.value
if math.isnan(relative_temperature):
raise ValueError('Could not get relative camera temperature')
return relative_temperature >= 15.0
return math.isnan(relative_temperature) or relative_temperature >= 15.0


@log_call_and_result
Expand Down