netatmo 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b3ef266bbbacba6b1ff49e39751806a2a9fb53d311e514a78a27e9733c88e279
4
- data.tar.gz: '08b52dceec23cbbad2fdcd1290e6afaeda3f28ddc1e2066835536c142773c059'
3
+ metadata.gz: 99e0375dbd219402984b35b48767e8d4a25cf698615fe6543cf204fd33204709
4
+ data.tar.gz: 9e7fef534a07bf45868672945f1ff70055a7cecfa57cf6175cd5b46fc9ac8464
5
5
  SHA512:
6
- metadata.gz: f61bc4b416a962fee5d797f09bec2a427b700b5e7e1634b12f4c15beed23ed5983bbb0e0ca251fca62a650235cdedd6e0c9f38098e0d45e4a6ae807e66d8a610
7
- data.tar.gz: aff153b8ee47833d3f93e33be068c1c9e54575c9f9fbd2ec11b28adcc5c188c877026e177304695e2113c99e9c0e1d36b0083c96fd83681bf47370d1b941268b
6
+ metadata.gz: 4a941eb65f05644d174b7de5a9cdf85a857f59eff36442e0de51f8f68d8d96d939bbd7ec936760321b2a4fc973072546cd1178a99c2fe1512426fd983d1663a5
7
+ data.tar.gz: 71c58e22cea3a8bcf4a8ba0cc334ce92b5b1dad2a415ae65092bd6062b56e655d77a7aeda6b839c7ecb367a8600fc2cf630e7f5035111e07cfb0e559577fe617
@@ -6,6 +6,8 @@ module Netatmo
6
6
  attr_accessor :time, :value, :unit
7
7
 
8
8
  def initialize(data)
9
+ return if data.nil?
10
+
9
11
  self.time = Time.at(data['time_utc'])
10
12
  self.value = data['CO2'].to_f
11
13
  self.unit = 'ppm'
@@ -10,6 +10,8 @@ module Netatmo
10
10
  attr_accessor :time, :value, :unit
11
11
 
12
12
  def initialize(data)
13
+ return if data.nil?
14
+
13
15
  self.time = Time.at(data['time_utc'])
14
16
  self.value = data['health_idx'].to_i
15
17
  end
@@ -6,6 +6,8 @@ module Netatmo
6
6
  attr_accessor :time, :value, :unit
7
7
 
8
8
  def initialize(data)
9
+ return if data.nil?
10
+
9
11
  self.time = Time.at(data['time_utc'])
10
12
  self.value = data['Humidity'].to_f
11
13
  self.unit = '%'
@@ -6,6 +6,8 @@ module Netatmo
6
6
  attr_accessor :time, :value, :unit
7
7
 
8
8
  def initialize(data)
9
+ return if data.nil?
10
+
9
11
  self.time = Time.at(data['time_utc'])
10
12
  self.value = data['Noise'].to_f
11
13
  self.unit = 'dB'
@@ -10,6 +10,8 @@ module Netatmo
10
10
  attr_accessor :time, :value, :absolute_pressure, :trend, :unit
11
11
 
12
12
  def initialize(data)
13
+ return if data.nil?
14
+
13
15
  self.time = Time.at(data['time_utc'])
14
16
  self.value = data['Pressure'].to_f
15
17
  self.absolute_pressure = data['AbsolutePressure'].to_f
@@ -6,6 +6,8 @@ module Netatmo
6
6
  attr_accessor :time, :value, :sum_rain_1, :sum_rain_24
7
7
 
8
8
  def initialize(data)
9
+ return if data.nil?
10
+
9
11
  self.time = Time.at(data['time_utc'])
10
12
  self.value = data['Rain'].to_f
11
13
  self.sum_rain_1 = data['sum_rain_1'].to_f
@@ -6,6 +6,8 @@ module Netatmo
6
6
  attr_accessor :time, :value, :min, :max, :min_date, :max_date, :trend, :unit
7
7
 
8
8
  def initialize(data)
9
+ return if data.nil?
10
+
9
11
  self.time = Time.at(data['time_utc'])
10
12
  self.value = data['Temperature'].to_f
11
13
  self.min = data['min_temp'].to_f
@@ -6,6 +6,8 @@ module Netatmo
6
6
  attr_accessor :time, :wind_strength, :max_wind_strength, :max_wind_strength_date, :wind_angle, :gust_strength, :gust_angle, :wind_historic, :unit
7
7
 
8
8
  def initialize(data)
9
+ return if data.nil?
10
+
9
11
  self.time = Time.at(data['time_utc'])
10
12
  self.wind_strength = data['WindStrength'].to_f
11
13
  self.max_wind_strength = data['max_wind_str'].to_f
@@ -7,6 +7,8 @@ module Netatmo
7
7
  attr_accessor :altitude, :city, :country, :location, :timezone
8
8
 
9
9
  def initialize(data)
10
+ return if data.nil?
11
+
10
12
  self.altitude = data['altitude']
11
13
  self.city = data['city']
12
14
  self.country = data['country']
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Netatmo
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.3'
5
5
  end
@@ -29,7 +29,7 @@ module Netatmo
29
29
  self.co2 = DashboardData::CO2.new(data['dashboard_data'])
30
30
  self.humidity = DashboardData::Humidity.new(data['dashboard_data'])
31
31
  self.temperature = DashboardData::Temperature.new(data['dashboard_data'])
32
- self.noise = DashboardData::Temperature.new(data['dashboard_data'])
32
+ self.noise = DashboardData::Noise.new(data['dashboard_data'])
33
33
  self.pressure = DashboardData::Pressure.new(data['dashboard_data']) if pressure?
34
34
  end
35
35
  self.wifi_status = WifiStatus.new(data['wifi_status'])
@@ -7,8 +7,10 @@ module Netatmo
7
7
 
8
8
  def initialize(data)
9
9
  super(data)
10
+
10
11
  self.battery_vp = data['battery_vp']
11
12
  self.battery_percent = data['battery_percent']
13
+
12
14
  if type.indoor_module?
13
15
  self.battery_status = BatteryStatus::IndoorBatteryStatus.new(battery_vp)
14
16
  elsif type.outdoor_module? || type.rain_gauge?
@@ -8,6 +8,7 @@ module Netatmo
8
8
  # DeviceType: NAModule1
9
9
  def initialize(data)
10
10
  super(data)
11
+
11
12
  self.humidity = DashboardData::Humidity.new(data['dashboard_data'])
12
13
  self.temperature = DashboardData::Temperature.new(data['dashboard_data'])
13
14
  self.pressure = DashboardData::Pressure.new(data['dashboard_data']) if pressure?
@@ -8,6 +8,7 @@ module Netatmo
8
8
  # DeviceType: NAModule3
9
9
  def initialize(data)
10
10
  super(data)
11
+
11
12
  self.rain = DashboardData::Rain.new(data['dashboard_data'])
12
13
  end
13
14
  end
@@ -11,6 +11,7 @@ module Netatmo
11
11
  response['devices'].each do |device|
12
12
  devices << Device.parse(device)
13
13
  end
14
+
14
15
  self.user = Netatmo::User.new(response['user'])
15
16
  end
16
17
  end
@@ -8,6 +8,7 @@ module Netatmo
8
8
  # DeviceType: NAModule2
9
9
  def initialize(data)
10
10
  super(data)
11
+
11
12
  self.wind = DashboardData::Wind.new(data['dashboard_data'])
12
13
  end
13
14
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: netatmo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marco Roth
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-09 00:00:00.000000000 Z
11
+ date: 2020-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: easy_enum