Beispiel #1
0
def telegram_unlockdoor(bot, update):
    gpio.output(20, False)
    bot.sendMessage(update.message.chat_id, text=emojize("Door unlocked :heavy_exclamation_mark:", use_aliases=True))
    eng_name = get_user_engname(update.message.chat_id)
    print "[{}] {} unlocked door".format(str(datetime.now()), eng_name)
    # update.message.reply_text(emojize("Door unlocked :heavy_exclamation_mark:", use_aliases=True))
    set_doorstats('Unlocked')
Beispiel #2
0
def button_unlockdoor():
    gpio.output(20, False)
    set_doorstats('Unlocked')
    print "[{}] Door Unlocked".format(str(datetime.now()))
    label_status.config(text="Doors Unlocked", bg='red')
    # lock the door after 2 secs 
    label_status.after(unlock_time, button_lockdoor)
Beispiel #3
0
def telegram_lockdoor(bot, update):
    gpio.output(20, True)
    set_doorstats('Locked')
    bot.sendMessage(update.message.chat_id, text=emojize("Door locked :white_check_mark:", use_aliases=True))
    # update.message.reply_text(emojize("Door locked :white_check_mark:", use_aliases=True))
    eng_name = get_user_engname(update.message.chat_id)
    print "[{}] {} locked door".format(str(datetime.now()), eng_name)
Beispiel #4
0
def opendoor_button_interrupt(channel):
    gpio.output(20, False)
    set_doorstats('Unlocked')
    label_status.config(text="Doors Unlocked", bg='red')
    # lock the door after 2 secs 
    label_status.after(unlock_time, button_lockdoor)
    
    print "Door Opened"
Beispiel #5
0
 def button_unlockdoor(self):
     print "Doors Unlocked", datetime.datetime.now()
     gpio.output(20, True)
     set_doorstats('Unlocked')
     self.label_status.config(text="Door Unlocked", bg='red')
     # lock the door after 2 secs
     self.label_status.after(unlock_time, self.button_lockdoor)
     bot.sendMessage(chat_id=221968006, text="Door Unlocked")
Beispiel #6
0
def telegram_unlockdoor(bot, update):
    isAdmin = check_for_admin_right(telegram_id=update.message.chat_id)

    if isAdmin is True:
        gpio.output(20, True)
        update.message.reply_text(
            emojize("Door unlocked :heavy_exclamation_mark:",
                    use_aliases=True))
        set_doorstats('Unlocked')
    else:
        update.message.reply_text(
            "Please get help from LHC Admin to unlock door")
Beispiel #7
0
def button_lockdoor():
    gpio.output(20, True)
    set_doorstats('Locked')
    print "[{}] Door Locked".format(str(datetime.now()))
    label_status.config(text="Doors Locked", bg='green')
Beispiel #8
0
def telegram_lockdoor(bot, update):

    gpio.output(20, False)
    set_doorstats('Locked')
    update.message.reply_text(
        emojize("Door locked :white_check_mark:", use_aliases=True))
Beispiel #9
0
def button_lockdoor():
    gpio.output(20, False)
    set_doorstats('Locked')
    label_status.config(text="Doors Locked", bg='green')
Beispiel #10
0
def button_unlockdoor():
    gpio.output(20, True)
    set_doorstats('Unlocked')
    label_status.config(text="Doors Unlocked", bg='red')
    # lock the door after 2 secs
    label_status.after(unlock_time, button_lockdoor)
Beispiel #11
0
 def button_lockdoor(self):
     print "Doors Locked", datetime.datetime.now()
     gpio.output(20, False)
     set_doorstats('Locked')
     self.label_status.config(text="Door Locked", bg='green')
     bot.sendMessage(chat_id=221968006, text="Door locked")