reco4life 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -2
- data/lib/reco4life.rb +7 -6
- data/lib/reco4life/version.rb +1 -1
- data/reco4life.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c82c14ee5fec5864cbb7bcf3dfa9a7ecb812e30
|
4
|
+
data.tar.gz: 4940993e395714a5f9594061e825bf817e5a8577
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3019a7f038dbdf18476a48e1f7151e0e81b095239f0387d34185f6918128c10522c772c4162572b086ae948f358e4c2df2ba1018d7487a4922786cf76b98f4b4
|
7
|
+
data.tar.gz: 9f5b9233d6b5325cba81a839eef9d1b15adb3fee2bd8924654b7615d1703256b45fcc1bf1afb8670466e923a61e22fa51723acd01ee3c5b8cafb381aa54425c5
|
data/README.md
CHANGED
data/lib/reco4life.rb
CHANGED
@@ -27,13 +27,11 @@ module Reco4life
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def turn_on(sn)
|
30
|
-
|
31
|
-
switch(sn, 1)
|
30
|
+
switch(sn, 1) unless powered_on?(sn)
|
32
31
|
end
|
33
32
|
|
34
33
|
def turn_off(sn)
|
35
|
-
|
36
|
-
switch(sn, 0)
|
34
|
+
switch(sn, 0) if powered_on?(sn)
|
37
35
|
end
|
38
36
|
|
39
37
|
def online?(sn)
|
@@ -54,8 +52,11 @@ module Reco4life
|
|
54
52
|
end
|
55
53
|
|
56
54
|
def token_valid?
|
57
|
-
|
58
|
-
|
55
|
+
@token && !token_expired?
|
56
|
+
end
|
57
|
+
|
58
|
+
def token_expired?
|
59
|
+
@token_expire_time && @token_expire_time < Time.now
|
59
60
|
end
|
60
61
|
|
61
62
|
def fetch_devices
|
data/lib/reco4life/version.rb
CHANGED
data/reco4life.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reco4life
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aaron67
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -42,14 +42,14 @@ dependencies:
|
|
42
42
|
name: http
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 2.1.0
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 2.1.0
|
55
55
|
description: Reco4life提供HTTP API来管理智能插座,封装这些接口
|