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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 45b9e01a685030e068077bdbaf8783a949f7d46b
4
- data.tar.gz: 702da37693c9bc7731ae6f58b0b8e6c01f070ba6
3
+ metadata.gz: 7909fcc7b5af0616196eaeb0d6b56bcb11baec62
4
+ data.tar.gz: 2362d5160b1c69265fd261e23cb5e274901379df
5
5
  SHA512:
6
- metadata.gz: 60e4413b086b60a31a16bc688dcacfb3fe5ce3c6277146fbd9c63e1c061253618bc7047591f885d3ad91cfef418f062421a6ba009c4530cff18920c9058a5d57
7
- data.tar.gz: 97bc37b5b3252f206f901b9664b2da160aca13ffe464fa3e40e51174fcb3101475082784ed0a0bf6b4c04ea6d87c7b49243f819030d47cb3e54edc44e70d64d8
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( Bravtroller::Client.new(BRAVIA_IP_ADDRESS) )
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.create( Bravtroller::Client.new(BRAVIA_IP_ADDRESS) )
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(bravia_client)
30
- @bravia_client = bravia_client
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?
@@ -16,8 +16,8 @@ module Bravtroller
16
16
  }
17
17
 
18
18
  class IrccClientFactory
19
- def initialize(client)
20
- @client = 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(bravia_client, ircc_client_factory = IrccClientFactory.new(bravia_client))
48
- @bravia_client = 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
 
@@ -1,3 +1,3 @@
1
1
  module Bravtroller
2
- VERSION = "0.1.8"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bravtroller
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Mullins