bravtroller 0.1.8 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/bravtroller/authenticator.rb +8 -2
- data/lib/bravtroller/remote.rb +4 -4
- data/lib/bravtroller/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7909fcc7b5af0616196eaeb0d6b56bcb11baec62
|
4
|
+
data.tar.gz: 2362d5160b1c69265fd261e23cb5e274901379df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fe9839df14a72d3f349a7dd0b8c2770e3da72826febc8a312b6dfcc8f66c96483d9db037949ef3c685a4dce24fd7ba6f0a5fcb808de47686878e117e303c134
|
7
|
+
data.tar.gz: c5fe36a3cdb447e850eb7e53b5dd703309e909ff3abb749d360ce26438f6f6f26773322e6fb8ba10b900cf9ace81f25891699f9508464f9b11e4d431bc0d0c75
|
data/README.md
CHANGED
@@ -36,7 +36,7 @@ My TV requires that a device authenticate with it before controlling it remotely
|
|
36
36
|
require 'bravtroller/client'
|
37
37
|
require 'bravtroller/authenticator'
|
38
38
|
|
39
|
-
auth = Bravtroller::Authenticator.new(
|
39
|
+
auth = Bravtroller::Authenticator.new(BRAVIA_IP_ADDRESS)
|
40
40
|
|
41
41
|
a.authorized?
|
42
42
|
# => false
|
@@ -60,7 +60,7 @@ The below example assumes Bravtroller has already been authenticated:
|
|
60
60
|
require 'bravtroller/client'
|
61
61
|
require 'bravtroller/remote'
|
62
62
|
|
63
|
-
remote = Bravtroller::Remote.
|
63
|
+
remote = Bravtroller::Remote.new(BRAVIA_IP_ADDRESS)
|
64
64
|
|
65
65
|
remote.buttons
|
66
66
|
# => ["PowerOff", "Input", "GGuide", "EPG", "Favorites", "Display", "Home", "Options", "Return", "Up", "Down", "Right", "Left", "Confirm", "Red", "Green", "Yellow", "Blue", "Num1", "Num2", "Num3", "Num4", "Num5", "Num6", "Num7", "Num8", "Num9", "Num0", "Num11", "Num12", "VolumeUp", "VolumeDown", "Mute", "ChannelUp", "ChannelDown", "SubTitle", "ClosedCaption", "Enter", "DOT", "Analog", "Teletext", "Exit", "Analog2", "*AD", "Digital", "Analog?", "BS", "CS", "BSCS", "Ddata", "PicOff", "Tv_Radio", "Theater", "SEN", "InternetWidgets", "InternetVideo", "Netflix", "SceneSelect", "Mode3D", "iManual", "Audio", "Wide", "Jump", "PAP", "MyEPG", "ProgramDescription", "WriteChapter", "TrackID", "TenKey", "AppliCast", "acTVila", "DeleteVideo", "PhotoFrame", "TvPause", "KeyPad", "Media", "SyncMenu", "Forward", "Play", "Rewind", "Prev", "Stop", "Next", "Rec", "Pause", "Eject", "FlashPlus", "FlashMinus", "TopMenu", "PopUpMenu", "RakurakuStart", "OneTouchTimeRec", "OneTouchView", "OneTouchRec", "OneTouchStop", "DUX", "FootballMode", "Social"]
|
@@ -26,8 +26,14 @@ module Bravtroller
|
|
26
26
|
version: '1.0'
|
27
27
|
}
|
28
28
|
|
29
|
-
def initialize(
|
30
|
-
|
29
|
+
def initialize(host)
|
30
|
+
if host.is_a?(String)
|
31
|
+
@bravia_client = Bravtroller::Client.new(host)
|
32
|
+
elsif host.is_a?(Bravtroller::Client)
|
33
|
+
@bravia_client = host
|
34
|
+
else
|
35
|
+
raise "Unsupported type for host: #{host.class}"
|
36
|
+
end
|
31
37
|
end
|
32
38
|
|
33
39
|
def authorized?
|
data/lib/bravtroller/remote.rb
CHANGED
@@ -16,8 +16,8 @@ module Bravtroller
|
|
16
16
|
}
|
17
17
|
|
18
18
|
class IrccClientFactory
|
19
|
-
def initialize(
|
20
|
-
@client =
|
19
|
+
def initialize(host)
|
20
|
+
@client = Bravtroller::Client.new(host)
|
21
21
|
end
|
22
22
|
|
23
23
|
def create
|
@@ -44,8 +44,8 @@ module Bravtroller
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
-
def initialize(
|
48
|
-
@bravia_client =
|
47
|
+
def initialize(host, ircc_client_factory = IrccClientFactory.new(host))
|
48
|
+
@bravia_client = Bravtroller::Client.new(host)
|
49
49
|
@ircc_client_factory = ircc_client_factory
|
50
50
|
end
|
51
51
|
|
data/lib/bravtroller/version.rb
CHANGED