Class: Simms::ElectricityConfigBeacon

Inherits:
Beacon
  • Object
show all
Defined in:
lib/simms/electricity_config_beacon.rb

Constant Summary

Constants inherited from Beacon

Beacon::CG_ELECTRIC, Beacon::CG_GLOBAL, Beacon::CG_HVAC, Beacon::CG_IRRIGATION, Beacon::CG_PULSER, Beacon::CG_SENSOR, Beacon::DC_CONFIG, Beacon::DC_DATA, Beacon::DC_GLOBAL_CONFIG

Instance Attribute Summary

Attributes inherited from Beacon

#command_group_id, #device_command_id, #timestamp, #uuid

Instance Method Summary collapse

Methods inherited from Beacon

class_for, #config?, #data?, #group, #initialize, #type

Constructor Details

This class inherits a constructor from Simms::Beacon

Instance Method Details

#ct_ampsObject



6
7
8
# File 'lib/simms/electricity_config_beacon.rb', line 6

def ct_amps
  @bytes.uint16(6)
end

#nominal_voltageObject



10
11
12
# File 'lib/simms/electricity_config_beacon.rb', line 10

def nominal_voltage
  @bytes.uint16(8)
end

#phase_typeObject



14
15
16
# File 'lib/simms/electricity_config_beacon.rb', line 14

def phase_type
  @bytes.uint8(10)
end

#phase_type_descriptionObject

Human-readable description of the phase type



19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/simms/electricity_config_beacon.rb', line 19

def phase_type_description
  case phase_type
  when 0 then
    '3 Phase With Neutral, Display L-N'
  when 1 then
    '3 Phase With Neutral, Display L-L'
  when 2 then
    'Single Split Phase A+B with Neutral, Display L-N'
  when 3 then 
    'Single Phase A to Neutral, Display L-N'
  else
    'Unknown phase type!'
  end
end