Class: Belphanior::Servant::HomeNetwork::Insteon_2412n_x10_Codec

Inherits:
Object
  • Object
show all
Defined in:
lib/belphanior/servant/homenetwork/insteon_2412n_x10_codec.rb

Defined Under Namespace

Classes: BadCode

Constant Summary collapse

HOUSE_CODE_TABLE =
{
  "A"=>"6", "B"=>"E", "C"=>"2", "D"=>"A",
  "E"=>"1", "F"=>"9", "G"=>"5", "H"=>"D",
  "I"=>"7", "J"=>"F", "K"=>"3", "L"=>"B",
  "M"=>"0", "N"=>"8", "O"=>"4", "P"=>"C",
}
UNIT_CODE_TABLE =
{
  "1"=>"6", "2"=>"E", "3"=>"2", "4"=>"A",
  "5"=>"1", "6"=>"9", "7"=>"5", "8"=>"D",
  "9"=>"7", "10"=>"F", "11"=>"3", "12"=>"B",
  "13"=>"0", "14"=>"8", "15"=>"4", "16"=>"C",
}
COMMAND_CODE_TABLE =
{
  :all_on => "6",
  :on => "2",
  :brighter => "5",
  :off => "3",
  :all_off => "0",
  :dimmer => "4",
}
X10_PREFIX =
"0263"
ADDRESS_SUFFIX =
"00"
COMMAND_SUFFIX =
"80"

Instance Method Summary collapse

Constructor Details

#initialize(marshaller) ⇒ Insteon_2412n_x10_Codec

Returns a new instance of Insteon_2412n_x10_Codec.



31
32
33
# File 'lib/belphanior/servant/homenetwork/insteon_2412n_x10_codec.rb', line 31

def initialize(marshaller)
  @marshaller = marshaller
end

Instance Method Details

#device_brighter(identifier) ⇒ Object



43
44
45
# File 'lib/belphanior/servant/homenetwork/insteon_2412n_x10_codec.rb', line 43

def device_brighter(identifier)
  send_command(identifier, :brighter)
end

#device_dimmer(identifier) ⇒ Object



47
48
49
# File 'lib/belphanior/servant/homenetwork/insteon_2412n_x10_codec.rb', line 47

def device_dimmer(identifier)
  send_command(identifier, :dimmer)
end

#device_off(identifier) ⇒ Object



39
40
41
# File 'lib/belphanior/servant/homenetwork/insteon_2412n_x10_codec.rb', line 39

def device_off(identifier)
  send_command(identifier, :off)
end

#device_on(identifier) ⇒ Object



35
36
37
# File 'lib/belphanior/servant/homenetwork/insteon_2412n_x10_codec.rb', line 35

def device_on(identifier)
  send_command(identifier, :on)
end