onkyo_eiscp_ruby 2.1.2 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +20 -8
- data/VERSION +1 -1
- data/lib/eiscp.rb +1 -1
- data/lib/eiscp/message.rb +1 -3
- data/lib/eiscp/receiver.rb +4 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48590d7db6afad487744a9ba5d783b58c3af158c3ba73adb441c23d9f493ea3b
|
4
|
+
data.tar.gz: d2c0e99074b3ae9dd9f5b32db926262236c4aea4f640f41fae01e2e13ad04c30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e218b06b48938a41c7ce8301c8a7d697a8bae0f04eb9ba6214324ebeb1e115e769516230b48a884c535ffa191e129553d169a22eebce9ec923a8c428efc5ab56
|
7
|
+
data.tar.gz: 21113da05277c8e18dc6cfa64a4704f3495f606d6fed666f0100ed4ff457989baa09ac0252e96a403881cd0283d5cd8d919bc811c38a63ef019254fd55fdccc6
|
data/README.md
CHANGED
@@ -3,21 +3,24 @@ onkyo_eiscp_ruby
|
|
3
3
|
[](http://badge.fury.io/rb/onkyo_eiscp_ruby)
|
4
4
|
[](http://badge.fury.io/gh/mikerodrigues%2Fonkyo_eiscp_ruby)
|
5
5
|
|
6
|
-
*A Ruby implementation of eISCP for controlling Onkyo receivers.*
|
6
|
+
*A Ruby implementation of eISCP (ethernet Integra Serial Control Protocol) for controlling Onkyo receivers.*
|
7
7
|
|
8
|
-
**
|
8
|
+
**I'm still sort of updating this code. Please feel free to reach out if there's something you need that it doesn't do, I may be willing to help.**
|
9
9
|
|
10
10
|
**The python version linked below sees much more activity.**
|
11
11
|
|
12
|
-
Automatically discover receivers in the broadcast domain
|
13
12
|
|
14
|
-
|
13
|
+
Features
|
14
|
+
---------------
|
15
|
+
* Automatically discover receivers in the broadcast domain
|
16
|
+
|
17
|
+
* Send commands to receivers and parse returned messages
|
15
18
|
|
16
|
-
Open a TCP socket to receive solicited and non-solicited status updates.
|
19
|
+
* Open a TCP socket to receive solicited and non-solicited status updates.
|
17
20
|
|
18
|
-
Mock reciever (currently only responds to discovery)
|
21
|
+
* Mock reciever (currently only responds to discovery)
|
19
22
|
|
20
|
-
Human-readable commands
|
23
|
+
* Human-readable commands
|
21
24
|
|
22
25
|
**Inspired by https://github.com/miracle2k/onkyo-eiscp
|
23
26
|
|
@@ -40,7 +43,11 @@ What's missing?
|
|
40
43
|
|
41
44
|
Using the Library
|
42
45
|
-----------------
|
43
|
-
*
|
46
|
+
* Install the library
|
47
|
+
|
48
|
+
gem install onkyo_eiscp_ruby
|
49
|
+
|
50
|
+
* Require the library
|
44
51
|
|
45
52
|
require 'eiscp'
|
46
53
|
|
@@ -162,6 +169,11 @@ Using the Library
|
|
162
169
|
|
163
170
|
# Set the master volume to 45
|
164
171
|
receiver.master_volume "45"
|
172
|
+
|
173
|
+
# Change the input to TV/CD
|
174
|
+
# Note: when a command value has more than one name (an array in the YAML file)
|
175
|
+
# we default to using the first entry. So for `['cd', 'tv', 'cd']` you get:
|
176
|
+
receiver.input_selector "cd"
|
165
177
|
```
|
166
178
|
|
167
179
|
* Parse ISCP and human readable strings:
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.1.
|
1
|
+
2.1.4
|
data/lib/eiscp.rb
CHANGED
data/lib/eiscp/message.rb
CHANGED
@@ -53,13 +53,11 @@ module EISCP
|
|
53
53
|
# @param [String] value variable length ISCP command value
|
54
54
|
# @param [String] unit_type_character override default unit type character, optional
|
55
55
|
# @param [String] start_character override default start character, optional
|
56
|
-
def initialize(command: nil, value:
|
56
|
+
def initialize(command: nil, value: '', terminator: "\r\n", unit_type: '1', start: '!')
|
57
57
|
unless Dictionary.known_command?(command)
|
58
58
|
# STDERR.puts "Unknown command #{command}"
|
59
59
|
end
|
60
60
|
|
61
|
-
raise 'No value specified.' if value.nil?
|
62
|
-
|
63
61
|
@command = command
|
64
62
|
@value = value
|
65
63
|
@terminator = terminator
|
data/lib/eiscp/receiver.rb
CHANGED
@@ -133,6 +133,9 @@ module EISCP
|
|
133
133
|
# Sends an EISCP::Message object or string on the network
|
134
134
|
#
|
135
135
|
def send(eiscp)
|
136
|
+
if (@socket.nil? || @socket.closed?) then
|
137
|
+
connect
|
138
|
+
end
|
136
139
|
if eiscp.is_a? EISCP::Message
|
137
140
|
@socket.puts(eiscp.to_eiscp)
|
138
141
|
elsif eiscp.is_a? String
|
@@ -171,7 +174,7 @@ module EISCP
|
|
171
174
|
#
|
172
175
|
def human_readable_state
|
173
176
|
hash = {}
|
174
|
-
@state.each do |c, v|
|
177
|
+
@state.dup.each do |c, v|
|
175
178
|
hash[Dictionary.command_to_name(c).to_s] = (Dictionary.command_value_to_value_name(c, v) || v.to_s).to_s
|
176
179
|
end
|
177
180
|
hash
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onkyo_eiscp_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Rodrigues
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: "\n Control Onkyo receivers over the network.Use the provided binary
|
14
14
|
or\n require the library for use in your scripts.\n "
|