Example #1
0
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\'')
Example #2
0
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!")