Verified Commit 59468de5 authored by Mroik's avatar Mroik
Browse files

Small fix

parent 99101d26
...@@ -62,6 +62,7 @@ def set_closed(update: Update, context: CallbackContext): ...@@ -62,6 +62,7 @@ def set_closed(update: Update, context: CallbackContext):
def set_status(status: bool, update: Update, context: CallbackContext): def set_status(status: bool, update: Update, context: CallbackContext):
global is_open
LOGGER.debug(f"Trying to set status to {status}") LOGGER.debug(f"Trying to set status to {status}")
if check_debounce(): if check_debounce():
LOGGER.debug("Debounce triggered") LOGGER.debug("Debounce triggered")
...@@ -74,4 +75,5 @@ def set_status(status: bool, update: Update, context: CallbackContext): ...@@ -74,4 +75,5 @@ def set_status(status: bool, update: Update, context: CallbackContext):
resp = mt.bot.mqtt.publish("sede/status", payload=json.dumps( resp = mt.bot.mqtt.publish("sede/status", payload=json.dumps(
{"id": "Set from telegram", "status": OPEN if status else CLOSED} {"id": "Set from telegram", "status": OPEN if status else CLOSED}
)) ))
is_open = status
LOGGER.info(resp.mid) LOGGER.info(resp.mid)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment