class Component::Temp

Temp loader class

Public Instance Methods

update() click to toggle source

For temp, will read the files: -input (current temp) -label (name of sensor) -crit (critical max temperature) -crit_hyst (critical hysteresis temp) Permanent values are crit, crit_hyst, and label

   # File lib/radeonnoise/parts.rb
64 def update
65   # Fill in all the data, only fill the permanent ones
66   # on the first load.
67   #
68   # Label should be stripped of trailing spaces, and
69   # all other values should be converted to a float and
70   # divided by 1000, to change back into degrees Celsius
71   @current.each do |k,v|
72     @current[k][:critical] ||= File.read("#{@path}/#{k}_crit").to_f / 1000
73     @current[k][:hysteresis] ||= File.read("#{@path}/#{k}_crit_hyst").to_f / 1000
74     @current[k][:label] ||= File.read("#{@path}/#{k}_label").strip
75     @current[k][:current] = File.read("#{@path}/#{k}_input").to_f / 1000
76   end 
77 end