aca-device-modules 1.0.1 → 1.0.2

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
  SHA1:
3
- metadata.gz: ff402a8981cd00ad194800fedd2d640c8d523fc4
4
- data.tar.gz: 4ea818c14ca5d2fa95ae79e1bb64a8267d70076c
3
+ metadata.gz: cf585e02ffea0aa04a948f0ab7b1c28fc4f1da1d
4
+ data.tar.gz: e6814389e38268242ff011cc80134e0fc65968e8
5
5
  SHA512:
6
- metadata.gz: 187d638e7b2d043344da2004d0484d8ef7df8dff6747b67ebc3e90ad708d9b464254304c1e624eb3bffcb949f6b32d51036eb07b98695bca2153f10ff2a85acf
7
- data.tar.gz: 583975c1ae6bf240d3f63fc88320b74c4abf18f1be8d26fe2c4eb69fdf48fb8bb3608c37914dbf36e363856e32409deb2cd03ce52dbbd0b48b6d461d3b7bc1f8
6
+ metadata.gz: f526e473152508cba0fc38e77ef119c6ad1425ab2f4b4ce3d53cc13853b31f78a124e463268eee67d7e6ba083f3121a942d61c62f9decc9bfbfc67510f69a998
7
+ data.tar.gz: 6b72b57ee0e7dcbcde43e4c8cf69ae4397db4b8eddaff70edd244eb899315fd84adb61154f65486d17f3b0abc6f6e0ed3331422be8a0956bce38e80695617f80
@@ -1,3 +1,3 @@
1
1
  module AcaDeviceModules
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
@@ -57,8 +57,9 @@ class Biamp::Nexia
57
57
  do_send('SETD', self[:device_id], 'FDRLVL', fader_id, 1, level)
58
58
  end
59
59
 
60
- def mute(fader_id)
61
- do_send('SETD', self[:device_id], 'FDRMUTE', fader_id, 1, 1)
60
+ def mute(fader_id, val = true)
61
+ actual = val ? 1 : 0
62
+ do_send('SETD', self[:device_id], 'FDRMUTE', fader_id, 1, actual)
62
63
  end
63
64
 
64
65
  def unmute(fader_id)
@@ -16,7 +16,6 @@ class GlobalCache::Gc100
16
16
  end
17
17
 
18
18
  def on_update
19
- self[:config_indexed] = false
20
19
  end
21
20
 
22
21
  #
@@ -24,10 +23,9 @@ class GlobalCache::Gc100
24
23
  # config => {:relay => {0 => '2:1',1 => '2:2',2 => '2:3',3 => '3:1'}} etc
25
24
  #
26
25
  def connected
27
- unless self[:config_indexed]
28
- self[:config] = {}
29
- do_send('getdevices', :max_waits => 100)
30
- end
26
+ @config = nil
27
+ self[:config_indexed] = false
28
+ do_send('getdevices', :max_waits => 100)
31
29
 
32
30
  @polling_timer = schedule.every('60s') do
33
31
  logger.debug "-- Polling GC100"
@@ -96,28 +94,27 @@ class GlobalCache::Gc100
96
94
 
97
95
  type = type.downcase.to_sym
98
96
 
99
- update_status(:config) do |value|
100
- value ||= {}
101
- value[type] ||= {}
102
- current = value[type].length
103
-
104
- dev_index = 1
105
- (current..(current + number.to_i - 1)).each do |index|
106
- port = "#{address}:#{dev_index}"
107
- value[type][index] = port
108
- value[port] = [type, index]
109
- dev_index += 1
110
- end
111
-
112
- value
97
+ value = @config || {}
98
+ value[type] ||= {}
99
+ current = value[type].length
100
+
101
+ dev_index = 1
102
+ (current..(current + number.to_i - 1)).each do |index|
103
+ port = "#{address}:#{dev_index}"
104
+ value[type][index] = port
105
+ value[port] = [type, index]
106
+ dev_index += 1
113
107
  end
108
+ @config = value
109
+
114
110
  return :ignore
115
111
 
116
112
  when :endlistdevices
113
+ self[:num_relays] = @config[:relay].length unless @config[:relay].nil?
114
+ self[:num_ir] = @config[:ir].length unless @config[:ir].nil?
115
+ self[:config] = @config
116
+ @config = nil
117
117
  self[:config_indexed] = true
118
- config = self[:config]
119
- self[:num_relays] = config[:relay].length unless config[:relay].nil?
120
- self[:num_ir] = config[:ir].length unless config[:ir].nil?
121
118
 
122
119
  return :success
123
120
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aca-device-modules
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen von Takach
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-07 00:00:00.000000000 Z
11
+ date: 2014-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails