savant-echo 2.0.0 → 2.1.1

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.
Files changed (3) hide show
  1. checksums.yaml +5 -5
  2. data/bin/src/Savant.rb +27 -22
  3. metadata +9 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 16b0cb3fdff0294e0f8655c9445fa4c55a78df50
4
- data.tar.gz: 92227adeed112f8ea3dd2dc645ec464a95cf587a
2
+ SHA256:
3
+ metadata.gz: 8cc4bd34ec332e241f05be05e3057e7162f7edab22db6db4d2ff95de6501d81e
4
+ data.tar.gz: 0aabb5a062552499d3be527782ece7c4059820a0cea58a690b442dc9cff600a3
5
5
  SHA512:
6
- metadata.gz: 5229747110247cec4d58be9d4529516ca98ceb5d8db530d893d6d27c813dc473559209952a9aaa8f189cef9cc09dab94dfcdbc4f00fd75d22a9397ed1d5809c8
7
- data.tar.gz: 68471853a9cdf144e291ac565ec77d5814e34b852650162ac419d44851b050346a147a734c777325fc15018d4c5b9aa153a7385c2537754632e1720ce1d727ef
6
+ metadata.gz: 2ceef65f1ffebf4753a11d48928292da59db518c2daa8edaa71fd9d5c50e5a6ca8cdb24095210175651921dbcdb581db14a74f918a36902d10bbf01bef704af8
7
+ data.tar.gz: c07e61b949661b51e95759ca6c5389e356a735d0cb455dfda2cdcd93dce6ce98c8e147d2b3f7c0ce006ed35f4b860e433c3f9a057dc03d6ec957403c3cfed0cf
@@ -78,10 +78,10 @@ class Savant #< VR::ListView
78
78
 
79
79
  @builder["buttonHabridgeStatus"].label = "HA Bridge is Online\nClick to open in browser."
80
80
  @builder["buttonBackupRestore"].show
81
+
81
82
  if savantVersion?(@savantURL)
82
83
  @builder["buttonSceneSync"].label = "Savant Scene Sync"
83
- @builder["buttonSceneSync"].show
84
-
84
+ @builder["buttonSceneSync"].show
85
85
  end
86
86
  @habridgeStatus = "Online"
87
87
  end
@@ -120,11 +120,12 @@ class Savant #< VR::ListView
120
120
  login = 'RPM'
121
121
  @password = 'RPM'
122
122
  begin
123
- Net::SSH.start(ip, login, :password => @password, :paranoid => false, :timeout => 3) do |ssh|
123
+ Net::SSH.start(ip, login, :password => @password, :verify_host_key => :never, :timeout => 3) do |ssh|
124
124
  #Check host type and update sclibridge location for reference, though only Pro Host is supported
125
125
  ssh.open_channel do |ch, success|
126
126
  ch.exec("uname")
127
127
  ch.on_data do |ch, data|
128
+ puts data
128
129
  if data.to_s.include? 'Darwin'
129
130
  @scliBridge = "~/Applications/RacePointMedia/sclibridge "
130
131
  else
@@ -149,22 +150,17 @@ class Savant #< VR::ListView
149
150
  ssh.loop
150
151
  #parse the rpmSystemInfo.plist from the smart host to get host name
151
152
  elsif @scliBridge == "/usr/local/bin/sclibridge "
152
- ssh.open_channel do |ch, success|
153
- ch.exec("strings 'GNUstep/Library/ApplicationSupport/RacePointMedia/userConfig.rpmConfig/rpmSystemInfo.plist'")
154
- ch.on_data do |ch, data|
155
- if data.to_s.include? 'DOCTYPE'
156
- x = data.split("RPMUserDefinedName</key><string>")
157
- y = x[1].split("</string>")
158
- x = x[1].split("VERSION</key><integer>")
159
- x = x[1].split("</integer>")
160
- elsif data.to_s.include? 'module'
161
- x = data.split('module')
162
- x = x[1].split("\n")
163
- @str = @scliBridge + "readstate \"" + x[0][1..-1] + ".SoftwareVersion\""
164
- end
165
- end
166
- end
167
- ssh.loop
153
+ # test to see if remote files exist and transfer them if they do
154
+ fileExists = ssh.exec!("[ -f 'GNUstep/Library/ApplicationSupport/RacePointMedia/rpmSystemInfo.plist' ] && echo 'true' || echo 'false'")
155
+ unless fileExists == 'false'
156
+ ssh.scp.download!('GNUstep/Library/ApplicationSupport/RacePointMedia/rpmSystemInfo.plist', '/tmp/')
157
+ x = `plutil -p /tmp/RPMSystemInfo.plist`
158
+ x = x.split(%q{"RPMSystemName" => "})
159
+ x = x[1].split(%q{"})
160
+ @savantHostName = x[0]
161
+ @str = @scliBridge + "readstate \'" + @savantHostName + ".SoftwareVersion\'"
162
+ end
163
+ alert "Only Pro Hosts are supported."
168
164
  end
169
165
  #Use host name to query SoftwareVersion state from host
170
166
  ssh.open_channel do |ch, success|
@@ -174,9 +170,18 @@ class Savant #< VR::ListView
174
170
  end
175
171
  end
176
172
  ssh.loop
173
+ if @version.include?("Deallocating")
174
+ tmpArray = @version.split("\n")
175
+ @version = tmpArray[2].chomp
176
+ end
177
177
  end
178
+ puts "Host version: " + @version
178
179
  #return true if version is 8.3 or later
179
- if @version.to_r > 8.2 && !@version.empty?
180
+ if @version.include?("-")
181
+ tmpArray = @version.split("-")
182
+ @version = tmpArray[0].chomp
183
+ end
184
+ if Gem::Version.new(@version) > Gem::Version.new('8.2.0') && !@version.empty?
180
185
  return true
181
186
  else
182
187
  return false
@@ -261,7 +266,7 @@ class Savant #< VR::ListView
261
266
  #Check that folder contains correct files
262
267
  if File.file?(backupDir + "/device.db") && File.file?(backupDir + "/habridge.config")
263
268
  begin
264
- Net::SSH.start(@savantURL, login, :password => @password, :paranoid => false, :timeout => 3) do |ssh|
269
+ Net::SSH.start(@savantURL, login, :password => @password, :verify_host_key => :never, :timeout => 3) do |ssh|
265
270
  # test to see if remote folder exists, if so, transfer files and restart harbridge
266
271
  dirExists = ssh.exec!("[ -d ~/habridge/data ] && echo 'true' || echo 'false'")
267
272
  if dirExists == 'true'
@@ -291,7 +296,7 @@ class Savant #< VR::ListView
291
296
  backupDir = File.dirname(backupDir)
292
297
  end
293
298
  begin
294
- Net::SSH.start(@savantURL, login, :password => @password, :paranoid => false, :timeout => 3) do |ssh|
299
+ Net::SSH.start(@savantURL, login, :password => @password, :verify_host_key => :never, :timeout => 3) do |ssh|
295
300
  # test to see if remote files exist and transfer them if they do
296
301
  fileExists = ssh.exec!("[ -f ~/habridge/data/device.db ] && echo 'true' || echo 'false'")
297
302
  if fileExists == 'true'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: savant-echo
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Corey Miller
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir:
10
10
  - bin
11
11
  cert_chain: []
12
- date: 2018-06-07 00:00:00.000000000 Z
12
+ date: 2018-12-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: net-scp
@@ -75,22 +75,22 @@ dependencies:
75
75
  name: require_all
76
76
  requirement: !ruby/object:Gem::Requirement
77
77
  requirements:
78
- - - "~>"
79
- - !ruby/object:Gem::Version
80
- version: '1.2'
81
78
  - - ">="
82
79
  - !ruby/object:Gem::Version
83
80
  version: 1.2.0
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: '1.2'
84
84
  type: :runtime
85
85
  prerelease: false
86
86
  version_requirements: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - "~>"
89
- - !ruby/object:Gem::Version
90
- version: '1.2'
91
88
  - - ">="
92
89
  - !ruby/object:Gem::Version
93
90
  version: 1.2.0
91
+ - - "~>"
92
+ - !ruby/object:Gem::Version
93
+ version: '1.2'
94
94
  description: Savant Integration with Amazon Echo
95
95
  email: cmiller@premieresystems.com
96
96
  executables:
@@ -127,8 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
127
  - !ruby/object:Gem::Version
128
128
  version: '0'
129
129
  requirements: []
130
- rubyforge_project: nowarning
131
- rubygems_version: 2.4.8
130
+ rubygems_version: 3.0.1
132
131
  signing_key:
133
132
  specification_version: 4
134
133
  summary: Savant Alexa