ffi-hdhomerun 0.5 → 0.6
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.
- data/lib/ffi-hdhomerun.rb +13 -1
- metadata +2 -2
data/lib/ffi-hdhomerun.rb
CHANGED
@@ -5,7 +5,7 @@ require 'pry'
|
|
5
5
|
# Documentation can be found under HDHomeRun::Tuner
|
6
6
|
#
|
7
7
|
module HDHomeRun
|
8
|
-
VERSION = "0.
|
8
|
+
VERSION = "0.6"
|
9
9
|
ERROR_STRING_UNKNOWN_VARIABLE = "ERROR: unknown getset variable"
|
10
10
|
ERROR_REGEX_TUNER_LOCKED = /^ERROR: resource locked by /
|
11
11
|
ERROR_STRING_TUNER_LOCK_EXPIRED = "ERROR: lock no longer held"
|
@@ -17,6 +17,7 @@ module HDHomeRun
|
|
17
17
|
class UnknownVariableError < Exception; end
|
18
18
|
class TunerLockedError < Exception; end
|
19
19
|
class LockExpiredError < Exception; end
|
20
|
+
class UnsupportedVersion < Exception; end
|
20
21
|
|
21
22
|
#
|
22
23
|
# Discover tuners on the network.
|
@@ -58,6 +59,17 @@ module HDHomeRun
|
|
58
59
|
end
|
59
60
|
end
|
60
61
|
|
62
|
+
# Return an array of all discoverable Tuners.
|
63
|
+
def self.tuners
|
64
|
+
raise UnsupportedVersion if ENV['FFI_HDHOMERUN_OLD_DEVICE_STRUCT']
|
65
|
+
|
66
|
+
discover.map do |data|
|
67
|
+
data[:tuner_count].times.map do |tuner|
|
68
|
+
Tuner.new(data.merge(:tuner => tuner))
|
69
|
+
end
|
70
|
+
end.flatten
|
71
|
+
end
|
72
|
+
|
61
73
|
# HDHomeRun device wrapper.
|
62
74
|
class Device
|
63
75
|
include FFI::HDHomeRun
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ffi-hdhomerun
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.6'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-01-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi
|