本文整理汇总了Python中output.Output.state方法的典型用法代码示例。如果您正苦于以下问题:Python Output.state方法的具体用法?Python Output.state怎么用?Python Output.state使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类output.Output
的用法示例。
在下文中一共展示了Output.state方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: len
# 需要导入模块: from output import Output [as 别名]
# 或者: from output.Output import state [as 别名]
print temperature, humidity
# Where are we in time?
delta = (datetime.now() - starttime).seconds / 60
# Find our cycle position
if delta > cycle[cycleposition]:
cycleposition += 3
starttime = datetime.now()
# Infinitely wrap our cycle
if cycleposition >= len(cycle):
cycleposition = 0
# Grab current cycle parameters
humiditymin = cycle[cycleposition+1]
humiditymax = cycle[cycleposition+2]
if humidity < humiditymin and output.state == False:
output.state = True
elif humidity > humiditymax and output.state == True:
output.state = False
# Wait for a while
time.sleep(2)
# Update graphs occasionally
if (datetime.now() - last_drawn).seconds > args.graphupdate:
last_drawn = datetime.now()
sensor.graph = False
graph.draw()
sensor.graph = True