thermostat.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:RaspberryPiThermostat 作者: scottpav 项目源码 文件源码
def get_status_string():
    with thermostatLock:
        sched = "None"

        if holdControl.state == "down":
            sched = "Hold"
        elif useTestSchedule:
            sched = "Test"
        elif heatControl.state == "down":
            sched = "Heat"
        elif coolControl.state == "down":
            sched = "Cool"

        return "[b]System:[/b]\n  " + \
               "Heat:     " + ( "[color=00ff00][b]On[/b][/color]" if GPIO.input( heatPin ) else "Off" ) + "\n  " + \
               "Cool:      " + ( "[color=00ff00][b]On[/b][/color]" if GPIO.input( coolPin ) else "Off" ) + "\n  " + \
               "Fan:       " + ( "[color=00ff00][b]On[/b][/color]" if GPIO.input( fanPin ) else "Auto" ) + "\n  " + \
               "Sched:   " + sched
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号