/
lightwaverf
executable file
·37 lines (37 loc) · 964 Bytes
/
lightwaverf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/ruby
require 'lightwaverf'
obj = LightWaveRF.new
case ARGV[0]
when 'help'
puts obj.help
when 'initlink'
puts obj.firmware ARGV[1]
when 'firmware'
puts obj.firmware ARGV[1]
when 'timezone'
puts obj.timezone ARGV[1]
when 'configure'
puts obj.configure ARGV[1]
when 'sequence'
puts obj.sequence ARGV[1], ARGV[2]
when 'mood'
puts obj.mood ARGV[1], ARGV[2], ARGV[3]
when 'learnmood'
puts obj.learnmood ARGV[1], ARGV[2], ARGV[3]
when 'energy'
puts obj.energy ARGV[1], ARGV[2], ARGV[3]
when 'update_timers'
puts obj.update_timers ARGV[1], ARGV[2], ARGV[3]
when 'timer'
puts obj.run_timers ARGV[1], ARGV[2]
when 'run_timers'
puts obj.run_timers ARGV[1], ARGV[2]
when 'update'
puts obj.update_config ARGV[1], ARGV[2]
when 'web'
puts obj.build_web_page ARGV[1]
when 'summarise'
puts obj.summarise ARGV[1], ARGV[2]
else
obj.send ARGV[0], ARGV[1], ARGV[2], ARGV[3]
end