Class: Sunnycarcharger::Agent::InvertorData
- Inherits:
-
Object
- Object
- Sunnycarcharger::Agent::InvertorData
- Defined in:
- lib/sunnycarcharger/agent/invertor_data.rb
Instance Attribute Summary collapse
-
#energy_consumed ⇒ Object
Returns the value of attribute energy_consumed.
-
#energy_produced ⇒ Object
Returns the value of attribute energy_produced.
-
#power_from_grid ⇒ Object
Returns the value of attribute power_from_grid.
-
#power_from_solar ⇒ Object
Returns the value of attribute power_from_solar.
-
#power_to_load ⇒ Object
Returns the value of attribute power_to_load.
-
#serial ⇒ Object
Returns the value of attribute serial.
-
#solar_energy_today ⇒ Object
Returns the value of attribute solar_energy_today.
Instance Method Summary collapse
Instance Attribute Details
#energy_consumed ⇒ Object
Returns the value of attribute energy_consumed.
4 5 6 |
# File 'lib/sunnycarcharger/agent/invertor_data.rb', line 4 def energy_consumed @energy_consumed end |
#energy_produced ⇒ Object
Returns the value of attribute energy_produced.
4 5 6 |
# File 'lib/sunnycarcharger/agent/invertor_data.rb', line 4 def energy_produced @energy_produced end |
#power_from_grid ⇒ Object
Returns the value of attribute power_from_grid.
3 4 5 |
# File 'lib/sunnycarcharger/agent/invertor_data.rb', line 3 def power_from_grid @power_from_grid end |
#power_from_solar ⇒ Object
Returns the value of attribute power_from_solar.
3 4 5 |
# File 'lib/sunnycarcharger/agent/invertor_data.rb', line 3 def power_from_solar @power_from_solar end |
#power_to_load ⇒ Object
Returns the value of attribute power_to_load.
3 4 5 |
# File 'lib/sunnycarcharger/agent/invertor_data.rb', line 3 def power_to_load @power_to_load end |
#serial ⇒ Object
Returns the value of attribute serial.
2 3 4 |
# File 'lib/sunnycarcharger/agent/invertor_data.rb', line 2 def serial @serial end |
#solar_energy_today ⇒ Object
Returns the value of attribute solar_energy_today.
3 4 5 |
# File 'lib/sunnycarcharger/agent/invertor_data.rb', line 3 def solar_energy_today @solar_energy_today end |
Instance Method Details
#as_json ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/sunnycarcharger/agent/invertor_data.rb', line 10 def as_json { serial: serial, power_from_grid: power_from_grid, power_to_load: power_to_load, power_from_solar: power_from_solar, solar_energy_today: solar_energy_today, energy_consumed: energy_consumed, energy_produced: energy_produced } end |
#power_to_grid ⇒ Object
6 7 8 |
# File 'lib/sunnycarcharger/agent/invertor_data.rb', line 6 def power_to_grid -power_from_grid end |