Browse Source

protocol optimizations

master
Michael Preisach 7 years ago
parent
commit
0c1b282dc6
  1. 8
      src/protocol.rs

8
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 {

Loading…
Cancel
Save