Class: NatureRemoE::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/nature_remo_e/client.rb

Constant Summary collapse

BASE_URL =
'https://api.nature.global'
API_VERSION =
'1'

Instance Method Summary collapse

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

#coefficientObject



21
22
23
# File 'lib/nature_remo_e/client.rb', line 21

def coefficient
  echonetlite_properties[:coefficient]
end

#cumulative_electric_energy_effective_digitsObject



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_unitObject



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_propertiesObject



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_instantaneousObject



41
42
43
# File 'lib/nature_remo_e/client.rb', line 41

def measured_instantaneous
  echonetlite_properties[:measured_instantaneous]
end

#normal_direction_cumulative_electric_energyObject



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_energyObject



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