From 0c1b282dc62b38143ae66ecdfe918dccf0a94791 Mon Sep 17 00:00:00 2001 From: Michael Preisach Date: Wed, 1 May 2019 00:00:14 +0200 Subject: [PATCH] protocol optimizations --- src/protocol.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/protocol.rs b/src/protocol.rs index beb9b59..e6297eb 100644 --- a/src/protocol.rs +++ b/src/protocol.rs @@ -72,7 +72,7 @@ impl Protocol { return Err("ERR Missing arguments"); } match arguments[0] { - "setsegment" => { + "set" => { if arguments.len() != 3 { self.running = false; return Err("ERR Wrong number of arguments"); @@ -88,8 +88,8 @@ impl Protocol { Err(_e) => return Err("ERR index not a number") }; let value = match arguments[2] { - "on" => true, - "off" => false, + "0" => true, + "1" => false, _ => return Err("ERR no value for segment") }; if RPI { @@ -100,7 +100,7 @@ impl Protocol { } } } - "display" => { + "show" => { //show the saved state on the display if RPI {