class Belphanior::Servant::HomeNetwork::Insteon_2412n_Marshaller

Attributes

host[RW]

Public Class Methods

new(host, network_class=nil) click to toggle source
# File lib/belphanior/servant/homenetwork/insteon_2412n_marshaller.rb, line 11
def initialize(host, network_class=nil)
  @host = host
  if network_class
    @network_class = network_class
  else
    @network_class = Net::HTTP
  end
end

Public Instance Methods

send(command) click to toggle source
# File lib/belphanior/servant/homenetwork/insteon_2412n_marshaller.rb, line 19
def send(command)
  @network_class.start(@host, 80) {|http|
    # I don't know what the prefix and suffix here mean;
    # they were determined empirically by examining the output
    # from the 2412N's built-in web GUI
    http.post("/3?"+command+"=I=3", "")
  }
end