ewelink 2.2.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/ewelink/api.rb +4 -0
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2392627c54c851fb5fd14194b484b56b1013b7a26e8d5bafe2a79e37dfa80464
4
- data.tar.gz: 2a5362bafa04f9e3cf212a5899b4e6183514fdff68b3146a4fa245c52e8fcadd
3
+ metadata.gz: 957d00b0d8171519a48b1cf828cbd78c21dbde34b93f2c1930273ad460d5a770
4
+ data.tar.gz: 0c636a47ac05f8428d9e099d952a0b89a512f8e199a3a85a72624c10a76590b3
5
5
  SHA512:
6
- metadata.gz: b2d3ecbf884461e11a51cf7e4efe7438f1c066cc7c076629371c96b3255b50f2a3f4e0314f6a40f9b7247adef06d69eb0b1f66b31ebcabff1c46b7def21d8291
7
- data.tar.gz: a2d064d2af9e800ef0165bf5d614e4857abb0503b1faad7e280f3f2df422f08c5c49e57e10b3202bfcac700dc667861690c0a29a44faaf13a5ae00307201fe87
6
+ metadata.gz: c20dfab19c133d80913716e7be2b20e47958e841e61d7b401f28b73e642358d80ce698d5fd22410ede0bb783114c0e91dfc7a1b4760ebab3738aaba3081275af
7
+ data.tar.gz: 07664117dfacf9f32fa7e0965199bed938da619b75b313207d702d5ad83ebc2ceacbb76b266e40f3e995114542a110061ad271630a3b007fc2e4f1cbb2bccc58
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.2.0
1
+ 2.2.1
@@ -12,6 +12,7 @@ module Ewelink
12
12
  UUID_NAMESPACE = 'e25750fb-3710-41af-b831-23224f4dd609';
13
13
  VERSION = 8
14
14
  WEB_SOCKET_PING_TOLERANCE_FACTOR = 1.5
15
+ SWITCH_STATUS_CHANGE_CHECK_TIMEOUT = 2.seconds
15
16
  WEB_SOCKET_WAIT_INTERVAL = 0.2.seconds
16
17
 
17
18
  attr_reader :email, :password, :phone_number
@@ -163,6 +164,7 @@ module Ewelink
163
164
  Ewelink.logger.debug(self.class.name) { "Turning switch #{switch[:uuid].inspect} #{on ? 'on' : 'off'}" }
164
165
  send_to_web_socket(JSON.generate(params))
165
166
  end
167
+ sleep(SWITCH_STATUS_CHANGE_CHECK_TIMEOUT)
166
168
  switch_on?(switch[:uuid]) # Waiting for switch status update
167
169
  true
168
170
  end
@@ -445,6 +447,8 @@ module Ewelink
445
447
  sleep(WEB_SOCKET_WAIT_INTERVAL)
446
448
  end
447
449
  block_given? ? yield : true
450
+ rescue
451
+ dispose_web_socket
448
452
  end
449
453
  end
450
454
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ewelink
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexis Toulotte