Class: NatureRemoE::Client
- Inherits:
-
Object
- Object
- NatureRemoE::Client
- Defined in:
- lib/nature_remo_e/client.rb
Constant Summary collapse
- BASE_URL =
'https://api.nature.global'
- API_VERSION =
'1'
Instance Method Summary collapse
- #coefficient ⇒ Object
- #cumulative_electric_energy_effective_digits ⇒ Object
- #cumulative_electric_energy_unit ⇒ Object
- #echonetlite_properties ⇒ Object
-
#initialize(token) ⇒ Client
constructor
A new instance of Client.
- #measured_instantaneous ⇒ Object
- #normal_direction_cumulative_electric_energy ⇒ Object
- #reverse_direction_cumulative_electric_energy ⇒ Object
Constructor Details
#initialize(token) ⇒ Client
Returns a new instance of Client.
11 12 13 |
# File 'lib/nature_remo_e/client.rb', line 11 def initialize(token) @token = token end |
Instance Method Details
#coefficient ⇒ Object
21 22 23 |
# File 'lib/nature_remo_e/client.rb', line 21 def coefficient echonetlite_properties[:coefficient] end |
#cumulative_electric_energy_effective_digits ⇒ Object
25 26 27 |
# File 'lib/nature_remo_e/client.rb', line 25 def cumulative_electric_energy_effective_digits echonetlite_properties[:cumulative_electric_energy_effective_digits] end |
#cumulative_electric_energy_unit ⇒ Object
33 34 35 |
# File 'lib/nature_remo_e/client.rb', line 33 def cumulative_electric_energy_unit echonetlite_properties[:cumulative_electric_energy_unit] end |
#echonetlite_properties ⇒ Object
15 16 17 18 19 |
# File 'lib/nature_remo_e/client.rb', line 15 def echonetlite_properties device[:smart_meter][:echonetlite_properties].to_h do |echonetlite_property| [echonetlite_property[:name].to_sym, echonetlite_property[:val].to_i] end end |
#measured_instantaneous ⇒ Object
41 42 43 |
# File 'lib/nature_remo_e/client.rb', line 41 def measured_instantaneous echonetlite_properties[:measured_instantaneous] end |
#normal_direction_cumulative_electric_energy ⇒ Object
29 30 31 |
# File 'lib/nature_remo_e/client.rb', line 29 def normal_direction_cumulative_electric_energy echonetlite_properties[:normal_direction_cumulative_electric_energy] end |
#reverse_direction_cumulative_electric_energy ⇒ Object
37 38 39 |
# File 'lib/nature_remo_e/client.rb', line 37 def reverse_direction_cumulative_electric_energy echonetlite_properties[:reverse_direction_cumulative_electric_energy] end |