onkyo_eiscp_ruby 0.0.3 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +182 -32
- data/VERSION +1 -1
- data/bin/mock_receiver.rb +25 -0
- data/bin/onkyo.rb +85 -25
- data/bin/{onkyo-server.rb → onkyo_server.rb} +2 -1
- data/eiscp-commands.yaml +3911 -3900
- data/lib/eiscp.rb +8 -5
- data/lib/eiscp/dictionary.rb +54 -0
- data/lib/eiscp/dictionary/dictionary_generators.rb +63 -0
- data/lib/eiscp/dictionary/dictionary_helpers.rb +121 -0
- data/lib/eiscp/message.rb +98 -74
- data/lib/eiscp/parser.rb +24 -0
- data/lib/eiscp/parser/dynamic_value_parser.rb +9 -0
- data/lib/eiscp/parser/eiscp_parser.rb +37 -0
- data/lib/eiscp/parser/human_readable_parser.rb +29 -0
- data/lib/eiscp/parser/iscp_parser.rb +28 -0
- data/lib/eiscp/receiver.rb +158 -135
- data/lib/eiscp/receiver/command_methods.rb +28 -0
- data/lib/eiscp/receiver/discovery.rb +49 -0
- data/onkyo_eiscp_ruby.gemspec +15 -13
- data/test/tc_dictionary.rb +45 -0
- data/test/tc_message.rb +11 -12
- data/test/tc_parser.rb +34 -0
- data/test/tc_receiver.rb +4 -3
- metadata +23 -12
- data/lib/eiscp/command.rb +0 -99
- data/lib/eiscp/mock_receiver.rb +0 -22
- data/test/tc_command.rb +0 -43
data/test/tc_command.rb
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
require_relative "../lib/eiscp/command.rb"
|
2
|
-
require_relative "../lib/eiscp/message.rb"
|
3
|
-
require "test/unit"
|
4
|
-
|
5
|
-
class TestCommand < Test::Unit::TestCase
|
6
|
-
|
7
|
-
def test_command_to_name
|
8
|
-
assert_equal(Command.command_to_name("PWR"), "system-power")
|
9
|
-
end
|
10
|
-
|
11
|
-
def test_command_name_to_command
|
12
|
-
assert_equal(Command.command_name_to_command("system-power"), "PWR")
|
13
|
-
end
|
14
|
-
|
15
|
-
def test_command_value_to_value_name
|
16
|
-
assert_equal(Command.command_value_to_value_name("PWR", "01"), "on")
|
17
|
-
end
|
18
|
-
|
19
|
-
def test_command_value_name_to_value
|
20
|
-
assert_equal(Command.command_value_name_to_value("PWR", "on"), "01")
|
21
|
-
end
|
22
|
-
|
23
|
-
def test_description_from_command_name
|
24
|
-
assert_equal(Command.description_from_command_name("system-power"), "System Power Command")
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_description_from_command
|
28
|
-
assert_equal(Command.description_from_command("PWR"), "System Power Command")
|
29
|
-
end
|
30
|
-
|
31
|
-
def test_parse_system_power
|
32
|
-
assert_equal(Command.parse('system-power on'), EISCP::Message.parse('PWR01'))
|
33
|
-
end
|
34
|
-
|
35
|
-
def test_parse_zone2_system_power
|
36
|
-
assert_equal(Command.parse('zone2 power on'), EISCP::Message.parse('ZPW01'))
|
37
|
-
end
|
38
|
-
|
39
|
-
def test_parse_volume_as_integer
|
40
|
-
assert_equal(Command.parse('main-volume 25'), EISCP::Message.parse('MVL19'))
|
41
|
-
end
|
42
|
-
|
43
|
-
end
|