seriamp 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4e48ad0a8b0c004f0e7a931eed8b923bb06329af40db33c7d89b51831591531a
4
- data.tar.gz: 292b04a8dca57285dbfea326a38b86bc6fb8e67e1ebb60215b49bdb236eecc94
3
+ metadata.gz: 7afd42caaa8f0dd5815e908b40bfccd8ca042769fea3af431ae334b3d44aa140
4
+ data.tar.gz: af4041b6faf2f07ce204a15b99d4cc51b6f4bdfacc5c016006588d096513adef
5
5
  SHA512:
6
- metadata.gz: bb8b19b6288bfe4b248aaaa1dffe26f801b64729af28923a8501222e05c8978747337c9d61b22d2794c2d6f33ebc16e831272569add01420c24ac9786674c5cd
7
- data.tar.gz: f1fe372b20b6bd95f33637c3157d6cc210d03c3cd7e6047061657095ef07abc891c6a38b85c9788d0329898ff7e4506687cc9661ca411de0582c0367a9c5f6df
6
+ metadata.gz: c09d03fe9b24e521eadffef9dc94305f61b90005e9719c349d9dba9ab7cb327a632352a62a3d2831f215374343147e3195fd958e01c4d750cce0a7ee4b7a8fda
7
+ data.tar.gz: a5a4f1b992fc6459ed7fa605daecc0715acb5e5938246b9915eb6af32415162b18650a6c45066602c22c27cf15f4879d91f63ab4b75eb05df82c02c0ee12760d
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Seriamp
4
- VERSION = '0.1.5'
4
+ VERSION = '0.1.6'
5
5
  end
@@ -79,6 +79,9 @@ module Seriamp
79
79
  end
80
80
  end
81
81
 
82
+ alias main_input_name input_name
83
+ alias last_main_input_name last_input_name
84
+
82
85
  %i(
83
86
  multi_ch_input effect pure_direct speaker_a speaker_b
84
87
  ).each do |meth|
@@ -80,6 +80,10 @@ module Seriamp
80
80
  which = 'main'
81
81
  end
82
82
  prefix = "set_#{which}"
83
+ if value.nil?
84
+ puts client.send("last_#{which}_volume_db")
85
+ return
86
+ end
83
87
  value = value.downcase
84
88
  if value == 'up'
85
89
  # Just like with remote, the first volume up or down command
@@ -90,9 +94,12 @@ module Seriamp
90
94
  client.public_send("#{which}_volume_down")
91
95
  client.public_send("#{which}_volume_down")
92
96
  else
93
- if %w(. -).include?(value)
97
+ if %w(. - mute).include?(value)
94
98
  method = "#{prefix}_mute"
95
99
  value = true
100
+ elsif value == 'unmute'
101
+ method = "#{prefix}_mute"
102
+ value = false
96
103
  else
97
104
  method = "#{prefix}_volume_db"
98
105
  if value[0] == ','
@@ -105,13 +112,16 @@ module Seriamp
105
112
  when 'input'
106
113
  which = args.shift&.downcase
107
114
  if %w(main zone2 zone3).include?(which)
108
- method = "set_#{which}_input"
109
115
  input = args.shift
110
116
  else
111
- method = 'set_main_input'
112
117
  input = which
118
+ which = 'main'
119
+ end
120
+ if input.nil?
121
+ puts client.public_send("last_#{which}_input_name")
122
+ return
113
123
  end
114
- client.public_send(method, input)
124
+ client.public_send("set_#{which}_input", input)
115
125
  when 'program'
116
126
  value = args.shift.downcase
117
127
  client.set_program(value)
data/seriamp.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "seriamp"
5
- spec.version = '0.1.5'
5
+ spec.version = '0.1.6'
6
6
  spec.authors = ['Oleg Pudeyev']
7
7
  spec.email = ['code@olegp.name']
8
8
  spec.summary = %q{Serial control for amplifiers & A/V receivers}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seriamp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleg Pudeyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-04 00:00:00.000000000 Z
11
+ date: 2022-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: serialport