This commit is contained in:
gac-S_Changer
2018-09-26 17:30:28 +02:00
parent e59582ad02
commit dc21099fd6
3 changed files with 42 additions and 1 deletions

View File

@@ -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()