aca-device-modules 1.0.4 → 1.0.5
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/lib/aca-device-modules/version.rb +1 -1
- data/modules/aca/lifter_logic_auto.rb +71 -0
- data/modules/aca/lifter_logic_manual.rb +105 -0
- data/modules/aca/pc_control.rb +111 -111
- data/modules/axis/camera/vapix.rb +10 -3
- data/modules/biamp/nexia.rb +149 -128
- data/modules/bss/blu100.rb +8 -8
- data/modules/chiyu/cyt.rb +6 -1
- data/modules/clipsal/c_bus.rb +233 -235
- data/modules/epson/projector/esc_vp21.rb +232 -232
- data/modules/extron/mixer/dmp44.rb +174 -174
- data/modules/extron/mixer/dmp64.rb +192 -181
- data/modules/extron/switcher/dxp.rb +210 -210
- data/modules/global_cache/gc100.rb +6 -2
- data/modules/kramer/switcher/protocol3000.rb +209 -209
- data/modules/kramer/switcher/vs_hdmi.rb +111 -110
- data/modules/nec/display/all.rb +440 -443
- data/modules/nec/projector/np_series.rb +609 -597
- data/modules/panasonic/camera/he50.rb +1 -1
- data/modules/panasonic/projector/tcp.rb +239 -234
- data/modules/philips/dynalite.rb +196 -0
- data/modules/samsung/displays/md_series.rb +34 -16
- data/modules/screen_technics/connect.rb +53 -53
- data/modules/sony/display/id_talk.rb +275 -275
- data/modules/sony/projector/pj_talk.rb +257 -257
- data/modules/vaddio/camera/clear_view_ptz_telnet.rb +7 -3
- metadata +6 -3
@@ -12,7 +12,7 @@ class Panasonic::Camera::He50
|
|
12
12
|
|
13
13
|
def on_update
|
14
14
|
defaults({
|
15
|
-
delay:
|
15
|
+
delay: 150, # As per the manual page 8
|
16
16
|
keepalive: false,
|
17
17
|
inactivity_timeout: 1.5, # seconds before closing the connection if no response
|
18
18
|
connect_timeout: 2 # max seconds for the initial connection to the device
|
@@ -2,249 +2,254 @@ module Panasonic; end
|
|
2
2
|
module Panasonic::Projector; end
|
3
3
|
|
4
4
|
|
5
|
+
# Default Web UI Access
|
6
|
+
# Username: admin1
|
7
|
+
# Password: panasonic
|
8
|
+
|
9
|
+
|
5
10
|
require 'digest/md5'
|
6
11
|
|
7
12
|
#
|
8
13
|
# Port: 1024
|
9
14
|
#
|
10
15
|
class Panasonic::Projector::Tcp
|
11
|
-
|
16
|
+
include ::Orchestrator::Constants
|
12
17
|
include ::Orchestrator::Transcoder
|
13
18
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
19
|
+
def on_load
|
20
|
+
# Response time is slow
|
21
|
+
defaults({
|
22
|
+
timeout: 2000,
|
23
|
+
delay_on_receive: 1000
|
24
|
+
})
|
25
|
+
|
26
|
+
config({
|
27
|
+
tokenize: true,
|
28
|
+
delimiter: "\r",
|
29
|
+
wait_ready: 'NTCONTROL'
|
30
|
+
})
|
31
|
+
|
32
|
+
@check_scheduled = false
|
33
|
+
self[:power] = false
|
34
|
+
self[:stable_state] = true # Stable by default (allows manual on and off)
|
35
|
+
|
36
|
+
# Meta data for inquiring interfaces
|
37
|
+
self[:type] = :projector
|
38
|
+
|
39
|
+
# The projector drops the connection when there is no activity
|
40
|
+
schedule.every('60s') do
|
41
|
+
power?({:priority => 0}) if self[:connected]
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def on_update
|
46
|
+
end
|
47
|
+
|
48
|
+
def connected
|
49
|
+
end
|
50
|
+
|
51
|
+
def disconnected
|
52
|
+
end
|
53
|
+
|
54
|
+
|
55
|
+
COMMANDS = {
|
56
|
+
power_on: :PON,
|
57
|
+
power_off: :POF,
|
58
|
+
power_query: :QPW,
|
59
|
+
freeze: :OFZ,
|
60
|
+
input: :IIS,
|
61
|
+
mute: :OSH,
|
62
|
+
lamp: :"Q$S"
|
63
|
+
}
|
64
|
+
COMMANDS.merge!(COMMANDS.invert)
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
#
|
69
|
+
# Power commands
|
70
|
+
#
|
71
|
+
def power(state, opt = nil)
|
72
|
+
self[:stable_state] = false
|
73
|
+
if is_affirmative?(state)
|
74
|
+
self[:power_target] = On
|
75
|
+
do_send(:power_on, {:retries => 10, :name => :power, delay_on_receive: 8000})
|
76
|
+
logger.debug "-- panasonic Proj, requested to power on"
|
77
|
+
do_send(:lamp)
|
78
|
+
else
|
79
|
+
self[:power_target] = Off
|
80
|
+
do_send(:power_off, {:retries => 10, :name => :power, delay_on_receive: 8000})
|
81
|
+
logger.debug "-- panasonic Proj, requested to power off"
|
82
|
+
do_send(:lamp)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
def power?(options = {}, &block)
|
87
|
+
options[:emit] = block if block_given?
|
88
|
+
do_send(:lamp, options)
|
89
|
+
end
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
#
|
94
|
+
# Input selection
|
95
|
+
#
|
96
|
+
INPUTS = {
|
97
|
+
:hdmi => :HD1,
|
98
|
+
:hdmi2 => :HD2,
|
99
|
+
:vga => :RG1,
|
100
|
+
:vga2 => :RG2,
|
101
|
+
:miracast => :MC1
|
102
|
+
}
|
103
|
+
INPUTS.merge!(INPUTS.invert)
|
104
|
+
|
105
|
+
|
106
|
+
def switch_to(input)
|
107
|
+
input = input.to_sym
|
108
|
+
return unless INPUTS.has_key? input
|
109
|
+
|
110
|
+
# Projector doesn't automatically unmute
|
111
|
+
unmute if self[:mute]
|
112
|
+
|
113
|
+
do_send(:input, INPUTS[input], {:retries => 10, delay_on_receive: 2000})
|
114
|
+
logger.debug "-- panasonic LCD, requested to switch to: #{input}"
|
115
|
+
|
116
|
+
self[:input] = input # for a responsive UI
|
117
|
+
end
|
118
|
+
|
119
|
+
|
120
|
+
#
|
121
|
+
# Mute Audio and Video
|
122
|
+
#
|
123
|
+
def mute(val = true)
|
124
|
+
actual = val ? 1 : 0
|
125
|
+
logger.debug "-- panasonic Proj, requested to mute"
|
126
|
+
do_send(:mute, actual) # Audio + Video
|
127
|
+
end
|
128
|
+
|
129
|
+
def unmute
|
130
|
+
logger.debug "-- panasonic Proj, requested to unmute"
|
131
|
+
do_send(:mute, 0)
|
132
|
+
end
|
133
|
+
|
134
|
+
|
135
|
+
ERRORS = {
|
136
|
+
:ERR1 => '1: Undefined control command'.freeze,
|
137
|
+
:ERR2 => '2: Out of parameter range'.freeze,
|
138
|
+
:ERR3 => '3: Busy state or no-acceptable period'.freeze,
|
139
|
+
:ERR4 => '4: Timeout or no-acceptable period'.freeze,
|
140
|
+
:ERR5 => '5: Wrong data length'.freeze,
|
141
|
+
:ERRA => 'A: Password mismatch'.freeze,
|
142
|
+
:ER401 => '401: Command cannot be executed'.freeze,
|
143
|
+
:ER402 => '402: Invalid parameter is sent'.freeze
|
144
|
+
}
|
145
|
+
|
146
|
+
|
147
|
+
def received(data, resolve, command) # Data is default received as a string
|
148
|
+
logger.debug "panasonic Proj sent: #{data}"
|
149
|
+
|
150
|
+
# This is the ready response
|
151
|
+
if data[0] == ' '
|
152
|
+
@mode = data[1]
|
153
|
+
if @mode == '1'
|
154
|
+
@pass = "#{setting(:username) || 'admin1'}:#{setting(:password) || 'panasonic'}:#{data.strip.split(/\s+/)[-1]}"
|
155
|
+
@pass = Digest::MD5.hexdigest(@pass)
|
156
|
+
end
|
157
|
+
|
158
|
+
else
|
159
|
+
data = data[2..-1]
|
160
|
+
|
161
|
+
# Error Response
|
162
|
+
if data[0] == 'E'
|
163
|
+
error = data.to_sym
|
164
|
+
self[:last_error] = ERRORS[error]
|
165
|
+
|
166
|
+
# Check for busy or timeout
|
167
|
+
if error == :ERR3 || error == :ERR4
|
168
|
+
logger.warn "Panasonic Proj busy: #{self[:last_error]}"
|
169
|
+
return :retry
|
170
|
+
else
|
171
|
+
logger.error "Panasonic Proj error: #{self[:last_error]}"
|
172
|
+
return :abort
|
173
|
+
end
|
174
|
+
end
|
170
175
|
|
171
176
|
resp = data.split(':')
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
177
|
+
cmd = COMMANDS[resp[0].to_sym]
|
178
|
+
val = resp[1]
|
179
|
+
|
180
|
+
case cmd
|
181
|
+
when :power_on
|
182
|
+
self[:power] = true
|
183
|
+
when :power_off
|
184
|
+
self[:power] = false
|
185
|
+
when :power_query
|
186
|
+
self[:power] = val.to_i == 1
|
187
|
+
when :freeze
|
188
|
+
self[:frozen] = val.to_i == 1
|
189
|
+
when :input
|
190
|
+
self[:input] = INPUTS[val.to_sym]
|
191
|
+
when :mute
|
192
|
+
self[:mute] = val.to_i == 1
|
193
|
+
else
|
194
|
+
if command && command[:name] == :lamp
|
195
|
+
ival = resp[0].to_i
|
196
|
+
self[:power] = ival == 1 || ival == 2
|
197
|
+
self[:warming] = ival == 1
|
198
|
+
self[:cooling] = ival == 3
|
199
|
+
|
200
|
+
if (self[:warming] || self[:cooling]) && !@check_scheduled && !self[:stable_state]
|
201
|
+
@check_scheduled = true
|
202
|
+
schedule.in('13s') do
|
203
|
+
@check_scheduled = false
|
204
|
+
logger.debug "-- checking panasonic state"
|
205
|
+
power?({:priority => 0}) do
|
206
|
+
state = self[:power]
|
207
|
+
if state != self[:power_target]
|
208
|
+
if self[:power_target] || !self[:cooling]
|
209
|
+
power(self[:power_target])
|
210
|
+
end
|
211
|
+
elsif self[:power_target] && self[:cooling]
|
212
|
+
power(self[:power_target])
|
213
|
+
else
|
214
|
+
self[:stable_state] = true
|
215
|
+
switch_to(self[:input]) if self[:power_target] == On && !self[:input].nil?
|
216
|
+
end
|
217
|
+
end
|
218
|
+
end
|
219
|
+
end
|
220
|
+
end
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
:success
|
225
|
+
end
|
226
|
+
|
227
|
+
|
228
|
+
protected
|
229
|
+
|
230
|
+
|
231
|
+
def do_send(command, param = nil, options = {})
|
232
|
+
if param.is_a? Hash
|
233
|
+
options = param
|
234
|
+
param = nil
|
235
|
+
end
|
236
|
+
|
237
|
+
# Default to the command name if name isn't set
|
238
|
+
options[:name] = command unless options[:name]
|
239
|
+
|
240
|
+
if param.nil?
|
241
|
+
pj = "#{COMMANDS[command]}"
|
242
|
+
else
|
243
|
+
pj = "#{COMMANDS[command]}:#{param}"
|
244
|
+
end
|
245
|
+
|
246
|
+
if @mode == '0'
|
247
|
+
send("00#{pj}\r", options)
|
248
|
+
else
|
249
|
+
send("#{@pass}00#{pj}\r", options)
|
250
|
+
end
|
251
|
+
|
252
|
+
nil
|
253
|
+
end
|
249
254
|
end
|
250
255
|
|