Class: Iremocon

Inherits:
Object
  • Object
show all
Defined in:
lib/iremocon.rb,
lib/iremocon/version.rb

Defined Under Namespace

Classes: ConnectionError

Constant Summary collapse

VERSION =
"0.0.1"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host, port = 51013) ⇒ Iremocon

Returns a new instance of Iremocon.



7
8
9
10
11
# File 'lib/iremocon.rb', line 7

def initialize(host, port = 51013)
  @host = host
  @port = port
  connect
end

Instance Attribute Details

#hostObject (readonly)

Returns the value of attribute host.



5
6
7
# File 'lib/iremocon.rb', line 5

def host
  @host
end

#portObject (readonly)

Returns the value of attribute port.



5
6
7
# File 'lib/iremocon.rb', line 5

def port
  @port
end

#telnetObject (readonly)

Returns the value of attribute telnet.



5
6
7
# File 'lib/iremocon.rb', line 5

def telnet
  @telnet
end

Instance Method Details

#auObject



13
14
15
# File 'lib/iremocon.rb', line 13

def au
  command("au")
end

#ccObject



25
26
27
# File 'lib/iremocon.rb', line 25

def cc
  command("cc")
end

#ic(channel) ⇒ Object



21
22
23
# File 'lib/iremocon.rb', line 21

def ic(channel)
  command("ic", channel)
end

#is(channel) ⇒ Object



17
18
19
# File 'lib/iremocon.rb', line 17

def is(channel)
  command("is", channel)
end

#td(timer_id) ⇒ Object



37
38
39
# File 'lib/iremocon.rb', line 37

def td(timer_id)
  command("td", timer_id)
end

#tgObject



45
46
47
# File 'lib/iremocon.rb', line 45

def tg
  command("tg")
end

#tlObject



33
34
35
# File 'lib/iremocon.rb', line 33

def tl
  command("tl")
end

#tm(channel, time, interval = 0) ⇒ Object



29
30
31
# File 'lib/iremocon.rb', line 29

def tm(channel, time, interval = 0)
  command("tm", channel, time.to_i, interval)
end

#ts(time) ⇒ Object



41
42
43
# File 'lib/iremocon.rb', line 41

def ts(time)
  command("ts", time.to_i)
end

#vrObject



49
50
51
# File 'lib/iremocon.rb', line 49

def vr
  command("vr")
end