From 94f02f64d5dc2091d21037815a8f946446235596 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Tue, 23 Mar 2021 04:25:23 +0300 Subject: update sms commands --- main.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 30fccea..86dd972 100644 --- a/main.py +++ b/main.py @@ -12,15 +12,15 @@ trusted_phone = '' def sms_handler(sms: SMS, api: WebAPI): global trusted_phone - print(f'from: {sms.phone}') - print(f'text: {sms.text}') + # print(f'from: {sms.phone}') + # print(f'text: {sms.text}') if sms.phone == trusted_phone: text = sms.text.lower().strip() - if text == 'you shall reboot': + if text == 'you shall reboot!': api.reboot() - elif text == 'show me some status': + elif text == 'yo, get me some status': info = api.device_information() signal = api.device_signal() buf = [] @@ -37,6 +37,12 @@ def sms_handler(sms: SMS, api: WebAPI): if buf != '': api.send_sms(phone=trusted_phone, content=buf) + elif text == 'switch it off': + api.dataswitch(False) + + elif text == 'switch it on': + api.dataswitch(True) + def main(): global trusted_phone -- cgit v1.2.3