From d2aae15ecc2fa5cca408a67fc52685d2ae01e4bc Mon Sep 17 00:00:00 2001 From: Johan Bloemberg Date: Sat, 13 May 2017 20:58:08 +0200 Subject: [PATCH] Test blinds commands, add then to CLI. --- rflink/__main__.py | 4 ++-- tests/test_parse.py | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/rflink/__main__.py b/rflink/__main__.py index 3ebf7e3..30c3621 100644 --- a/rflink/__main__.py +++ b/rflink/__main__.py @@ -2,7 +2,7 @@ Usage: rflink [-v | -vv] [options] - rflink [-v | -vv] [options] [--repeat ] (on | off | allon | alloff) + rflink [-v | -vv] [options] [--repeat ] (on|off|allon|alloff|up|down|stop) rflink (-h | --help) rflink --version @@ -43,7 +43,7 @@ 'repeat': RepeaterProtocol, } -ALL_COMMANDS = ['on', 'off', 'allon', 'alloff'] +ALL_COMMANDS = ['on', 'off', 'allon', 'alloff', 'up', 'down', 'stop'] def main(argv=sys.argv[1:], loop=None): diff --git a/tests/test_parse.py b/tests/test_parse.py index 4879e72..1d875bf 100644 --- a/tests/test_parse.py +++ b/tests/test_parse.py @@ -72,6 +72,10 @@ 'hardware': 'Nodo RadioFrequencyLink', 'firmware': 'RFLink Gateway', }], + ['20;05;RTS;ID=147907;SWITCH=01;CMD=UP;', { + 'id': '147907', 'switch': '01', 'protocol': 'rts', + 'command': 'up', + }] ]) def test_packet_parsing(packet, expect): """Packet should be broken up into their primitives."""