nature_remo 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 694f4b3df41d47958681db2d465e4b72a21208ce8d38e047c037e302be6fd053
4
- data.tar.gz: 88dc1b590ff2760458b6af375c03e0462e86c73a7efac8fa4b045ae8854abcd2
3
+ metadata.gz: bb50bdebd34cc875e2cf98003aad3b543fdd37cf26311bb993f57accd405679b
4
+ data.tar.gz: 59fcc5b9058d15603910ef5483dccac5df1b8906dcbec7b1a58d28088e3e4404
5
5
  SHA512:
6
- metadata.gz: dee4d7c0b46518164a0f98b8fbc3205daea529c5b1d173acbafcb2c22f73676690c12a15df7261140fbbd0cf19e1e5ecbdd54d76b5a0bbe85a1ae00eda7bc821
7
- data.tar.gz: 9786925228bfc3558f4d8fd5c3907f2c1f2a58566004145470545baae95c6177bcfaa95e98847d523309895eb8144f0f2828c0f09a0bef084b78634104605109
6
+ metadata.gz: 711cae411e7aef044eadf21a5b617ceb7ace321798e61c9ccc04daff5b3ef9c4dcd3e2ef6294d27986ebaf98c3230d2950ad31f83c999be9800df90439530460
7
+ data.tar.gz: cfaf3d488257724a554a7718ec9a4b174ce41f2a34d8e41df132758f0e72893aa1948e58cf0967f2aad6c7c48760caa0530e410f3a9ce05bbbc9bf7ebe760edf
@@ -38,14 +38,21 @@ module NatureRemo
38
38
  end
39
39
 
40
40
  desc 'aircon TEMP MODE', 'Control Air conditioner'
41
- def aircon mode = nil, temp = nil, volume = nil
41
+ def aircon temp = nil, mode = nil, volume = nil
42
+ if temp.match /[a-z]/
43
+ mode = temp
44
+ temp = nil
45
+ end
46
+
42
47
  aircon_id = []
43
48
  appliances_body.each_with_index do |a, i|
44
49
  aircon_id << get_appliance_id(i) if a["type"] == "AC"
45
50
  end
51
+
46
52
  if aircon_id.length == 1
47
53
  client.aircon_setting aircon_id.first, temp, mode, volume
48
- # This method supports only one air conditioner
54
+ else
55
+ puts "This method supports only one air conditioner"
49
56
  end
50
57
  end
51
58
 
@@ -42,7 +42,7 @@ module NatureRemo
42
42
  end
43
43
  end
44
44
 
45
- def aircon_setting appliance, mode = nil, temp = nil, volume = nil
45
+ def aircon_setting appliance, temp = nil, mode = nil, volume = nil
46
46
  @client.post do |req|
47
47
  req.url "/1/appliances/#{appliance}/aircon_settings"
48
48
  req.body = {
@@ -1,3 +1,3 @@
1
1
  module NatureRemo
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nature_remo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ichi-t
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-28 00:00:00.000000000 Z
11
+ date: 2018-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler