This commit is contained in:
@@ -256,6 +256,31 @@ def get_pin_offset():
|
||||
log("Error getting pin offset: " + str(sys.exc_info()[1]), False)
|
||||
return 0.0
|
||||
|
||||
def is_force_dry():
|
||||
try:
|
||||
dry_mount_counter = int(get_setting("dry_mount_counter"))
|
||||
except:
|
||||
dry_mount_counter = 0
|
||||
|
||||
try:
|
||||
dry_timespan = time.time() - float( get_setting("dry_timestamp"))
|
||||
except:
|
||||
dry_timespan = 3600
|
||||
|
||||
try:
|
||||
force_dry_mount_count = int(get_setting("force_dry_mount_count"))
|
||||
if force_dry_mount_count>0 and dry_mount_counter>=force_dry_mount_count:
|
||||
return True
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
force_dry_timeout = float(get_setting("force_dry_timeout"))
|
||||
if force_dry_timeout>0 and dry_timespan>=force_dry_timeout:
|
||||
return True
|
||||
except:
|
||||
pass
|
||||
return False
|
||||
|
||||
|
||||
update()
|
||||
|
||||
Reference in New Issue
Block a user