Class: Subduino::Parse::Energy
Constant Summary
collapse
- AC =
220
Instance Method Summary
collapse
Methods inherited from Analogic
#digital?, #ratio
Methods inherited from Digital
#digital?, #graph, #initialize, #name, #raw, #sparkline, #type
Instance Method Details
#kwh ⇒ Object
9
10
11
|
# File 'lib/subduino/parse/energy.rb', line 9
def kwh
AC * parse
end
|
#parse ⇒ Object
5
6
7
|
# File 'lib/subduino/parse/energy.rb', line 5
def parse
(@v / 10).to_i
end
|
#to_s ⇒ Object
13
14
15
|
# File 'lib/subduino/parse/energy.rb', line 13
def to_s
"#{parse} A"
end
|