diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2021-03-23 03:08:36 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2021-03-23 03:08:36 +0300 |
commit | f42ce7e1431f58545350eca401e26b4cf8f43461 (patch) | |
tree | 722e857bd83a612a5c746845a75942bc2d149565 /main.py | |
parent | 848cef4ce06350b5d4f6213a94363b4cebd92068 (diff) |
test sms handler
Diffstat (limited to 'main.py')
-rw-r--r-- | main.py | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -1,6 +1,16 @@ +import pathlib + from argparse import ArgumentParser from pprint import pprint -from e3372 import WebAPI +from e3372 import WebAPI, SMSHandler, SMS + + +config_dir = pathlib.Path.home() + '/.e3372-sms-handler' + + +def sms_handler(sms: SMS): + print(f'from: {sms.phone}') + print(f'text: {sms.content}') def main(): @@ -15,6 +25,9 @@ def main(): client = WebAPI(args.ip) client.auth() + smshandler = SMSHandler(api=client, config_dir=config_dir) + smshandler.process(sms_handler) + # info = client.device_information() # signal = client.device_signal() |