def check_pir( pin ):
global minUITimer
with thermostatLock:
if GPIO.input( pirPin ):
log( LOG_LEVEL_INFO, CHILD_DEVICE_PIR, MSG_SUBTYPE_TRIPPED, "1" )
if minUITimer != None:
Clock.unschedule( show_minimal_ui )
minUITimer = Clock.schedule_once( show_minimal_ui, minUITimeout )
ignore = False
now = datetime.datetime.now().time()
if pirIgnoreFrom > pirIgnoreTo:
if now >= pirIgnoreFrom or now < pirIgnoreTo:
ignore = True
else:
if now >= pirIgnoreFrom and now < pirIgnoreTo:
ignore = True
if screenMgr.current == "minimalUI" and not( ignore ):
screenMgr.current = "thermostatUI"
log( LOG_LEVEL_DEBUG, CHILD_DEVICE_SCREEN, MSG_SUBTYPE_TEXT, "Full" )
else:
log( LOG_LEVEL_DEBUG, CHILD_DEVICE_PIR, MSG_SUBTYPE_TRIPPED, "0" )
# Minimal UI Display functions and classes
评论列表
文章目录