예제 #1
0
파일: devmon.py 프로젝트: psicom/devbot
def check_status_match(bot):
    global alert
    if alert:
        state = status.query_api()
        leases = get_leases()
        if ('OPEN' in state) and (leases == 0):
            bot.msg('#devlol', 'Warning: status is set to \'OPEN\', but no activity detected!')
            bot.msg('#devlol', '\'.status close\' or \'.alert off\'')
예제 #2
0
파일: door.py 프로젝트: psicom/devbot
def door(bot, trigger):
    data = json.loads(status.query_api(mode=""))
    if data["sensors"]["door_locked"][0]["value"]:
        bot.reply("The door is locked!")
    else:
        bot.reply("The door is unlocked!")