some changes
This commit is contained in:
parent
b601b47a75
commit
37b88a1e1c
9
main.py
9
main.py
@ -106,6 +106,7 @@ def msg_status(update: Update, context: CallbackContext) -> None:
|
||||
relay.connect()
|
||||
|
||||
status = relay.status()
|
||||
logging.info('status:' + status)
|
||||
status = 'Включен' if status == 'on' else 'Выключен'
|
||||
|
||||
reply(update, status)
|
||||
@ -118,8 +119,8 @@ def msg_on(update: Update, context: CallbackContext) -> None:
|
||||
relay = RelayClient()
|
||||
relay.connect()
|
||||
|
||||
resp = relay.on()
|
||||
reply(update, resp)
|
||||
relay.on()
|
||||
reply(update, 'Готово')
|
||||
except Exception as e:
|
||||
handle_exc(update, e)
|
||||
|
||||
@ -129,8 +130,8 @@ def msg_off(update: Update, context: CallbackContext) -> None:
|
||||
relay = RelayClient()
|
||||
relay.connect()
|
||||
|
||||
resp = relay.off()
|
||||
reply(update, resp)
|
||||
relay.off()
|
||||
reply(update, 'Готово')
|
||||
except Exception as e:
|
||||
handle_exc(update, e)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user