Class: Sappho::Heatmiser::Proxy::SystemConfiguration

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/sappho-heatmiser-proxy/system_configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSystemConfiguration

Returns a new instance of SystemConfiguration.



19
20
21
22
23
24
25
26
27
28
# File 'lib/sappho-heatmiser-proxy/system_configuration.rb', line 19

def initialize
  data = YAML.load_file(File.expand_path(ARGV[0] || 'heatmiser-proxy.yml'))
  @heatmiserHostname = data['heatmiser.address']
  @heatmiserPort = Integer data['heatmiser.port']
  pin = Integer data['heatmiser.pin']
  @pinLo = pin & 0xFF
  @pinHi = (pin >> 8) & 0xFF
  @sampleDelay = Integer data['heatmiser.sample.delay']
  @maxClients = Integer data['clients.max']
end

Instance Attribute Details

#heatmiserHostnameObject (readonly)

Returns the value of attribute heatmiserHostname.



17
18
19
# File 'lib/sappho-heatmiser-proxy/system_configuration.rb', line 17

def heatmiserHostname
  @heatmiserHostname
end

#heatmiserPortObject (readonly)

Returns the value of attribute heatmiserPort.



17
18
19
# File 'lib/sappho-heatmiser-proxy/system_configuration.rb', line 17

def heatmiserPort
  @heatmiserPort
end

#maxClientsObject (readonly)

Returns the value of attribute maxClients.



17
18
19
# File 'lib/sappho-heatmiser-proxy/system_configuration.rb', line 17

def maxClients
  @maxClients
end

#pinHiObject (readonly)

Returns the value of attribute pinHi.



17
18
19
# File 'lib/sappho-heatmiser-proxy/system_configuration.rb', line 17

def pinHi
  @pinHi
end

#pinLoObject (readonly)

Returns the value of attribute pinLo.



17
18
19
# File 'lib/sappho-heatmiser-proxy/system_configuration.rb', line 17

def pinLo
  @pinLo
end

#sampleDelayObject (readonly)

Returns the value of attribute sampleDelay.



17
18
19
# File 'lib/sappho-heatmiser-proxy/system_configuration.rb', line 17

def sampleDelay
  @sampleDelay
end