class PjLink::Client

Attributes

gateway[RW]
password[RW]

Public Class Methods

new(address, password=nil) click to toggle source
# File lib/pj_link/client.rb, line 8
def initialize(address, password=nil)
  @gateway = Gateway.new(*address.split(':'))
  @password = password
end

Public Instance Methods

av_mute_off() click to toggle source
# File lib/pj_link/client.rb, line 49
def av_mute_off
  command 'AVMT 30'
end
av_mute_on() click to toggle source
# File lib/pj_link/client.rb, line 45
def av_mute_on
  command 'AVMT 31'
end
command(cmd) click to toggle source
# File lib/pj_link/client.rb, line 13
def command(cmd)
  gateway.send_message(cmd, @password)
end
device_name() click to toggle source
# File lib/pj_link/client.rb, line 69
def device_name
  command 'NAME ?'
end
inputs() click to toggle source
# File lib/pj_link/client.rb, line 53
def inputs
  command('INST ?').split.sort
end
lamp_hours() click to toggle source
# File lib/pj_link/client.rb, line 65
def lamp_hours
  command('LAMP ?').split.map(&:to_i)
end
manufacturer() click to toggle source
# File lib/pj_link/client.rb, line 73
def manufacturer
  command 'INF1 ?'
end
mute_off() click to toggle source
# File lib/pj_link/client.rb, line 41
def mute_off
  command 'AVMT 20'
end
mute_on() click to toggle source
# File lib/pj_link/client.rb, line 37
def mute_on
  command 'AVMT 21'
end
mute_status() click to toggle source
# File lib/pj_link/client.rb, line 61
def mute_status
  command('AVMT ?').to_i
end
other_info() click to toggle source
# File lib/pj_link/client.rb, line 85
def other_info
  command 'INFO ?'
end
power_off() click to toggle source
# File lib/pj_link/client.rb, line 21
def power_off
  command 'POWR 0'
end
power_on() click to toggle source
# File lib/pj_link/client.rb, line 17
def power_on
  command 'POWR 1'
end
power_status() click to toggle source
# File lib/pj_link/client.rb, line 25
def power_status
  command('POWR ?').to_i
end
product() click to toggle source
# File lib/pj_link/client.rb, line 77
def product
  command 'INF2 ?'
end
set_input(input) click to toggle source
# File lib/pj_link/client.rb, line 57
def set_input(input)
  command "INPT #{input}"
end
video_mute_off() click to toggle source
# File lib/pj_link/client.rb, line 33
def video_mute_off
  command 'AVMT 10'
end
video_mute_on() click to toggle source
# File lib/pj_link/client.rb, line 29
def video_mute_on
  command 'AVMT 11'
end