lex-sleepiq 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{legion-extensions-sleepiq.gemspec → lex-sleepiq.gemspec} +2 -1
- data/lib/legion/extensions/sleepiq/helpers/client.rb +4 -4
- data/lib/legion/extensions/sleepiq/runners/bed.rb +24 -7
- data/lib/legion/extensions/sleepiq/runners/family.rb +1 -1
- data/lib/legion/extensions/sleepiq/runners/foundation.rb +20 -4
- data/lib/legion/extensions/sleepiq/runners/pump.rb +2 -2
- data/lib/legion/extensions/sleepiq/runners/sleeper.rb +9 -5
- data/lib/legion/extensions/sleepiq/version.rb +1 -1
- metadata +6 -7
- data/Gemfile.lock +0 -91
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e8e532e9e80d1f4308caa997f6bf6b2b732c1cd64f73d0786ad1677abcf3dce
|
4
|
+
data.tar.gz: 3a00aecc1c6625b478242d305ed5a3c6ed768b03770a02764f72dc7f41dee923
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78ad35426caa807a854742b51cbd3f746a8203521efa964c2d2abc2ff78e65d0882b422faf6f68b6cb79ee7194006de2e34a344ba8b44f6ed62e7a5edfa64416
|
7
|
+
data.tar.gz: 783b61aef6bbf873291e462815df40c2073d6d53769a9621adf6de92eff3fb4a1905f4b94ebc0a3d94a0186eb6a36cff1a7be01117b8cd3387283511fc13c901
|
@@ -12,6 +12,7 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.description = 'Used to connect Legion to Sleep Number SleepIQ API'
|
13
13
|
spec.homepage = 'https://bitbucket.org/legion-io/lex-sleepiq'
|
14
14
|
spec.license = 'MIT'
|
15
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 2.5.0')
|
15
16
|
|
16
17
|
spec.metadata['homepage_uri'] = spec.homepage
|
17
18
|
spec.metadata['source_code_uri'] = 'https://bitbucket.org/legion-io/lex-sleepiq'
|
@@ -33,5 +34,5 @@ Gem::Specification.new do |spec|
|
|
33
34
|
spec.add_development_dependency 'rubocop-performance'
|
34
35
|
spec.add_development_dependency 'rubocop-rspec'
|
35
36
|
|
36
|
-
spec.add_dependency 'sleepiq', '>= 0.
|
37
|
+
spec.add_dependency 'sleepiq', '>= 0.3.0'
|
37
38
|
end
|
@@ -19,13 +19,13 @@ module Legion::Extensions::Sleepiq
|
|
19
19
|
|
20
20
|
def login
|
21
21
|
result = ::SleepIQ::Client.new(username: username, password: password)
|
22
|
-
Legion::Cache.set('sleepiq_sessid', result.sessid, 600)
|
22
|
+
Legion::Cache.set('sleepiq_sessid', result.sessid, ttl: 600)
|
23
23
|
@sessid = result.sessid
|
24
|
-
Legion::Cache.set('sleepiq_awsalb', result.awsalb, 600)
|
24
|
+
Legion::Cache.set('sleepiq_awsalb', result.awsalb, ttl: 600)
|
25
25
|
@awsalb = result.awsalb
|
26
|
-
Legion::Cache.set('sleepiq_key', result.key, 600)
|
26
|
+
Legion::Cache.set('sleepiq_key', result.key, ttl: 600)
|
27
27
|
@key = result.key
|
28
|
-
Legion::Cache.set('sleepiq_bedid', result.bedid, 600)
|
28
|
+
Legion::Cache.set('sleepiq_bedid', result.bedid, ttl: 600)
|
29
29
|
@bedid = result.bedid
|
30
30
|
end
|
31
31
|
|
@@ -3,20 +3,37 @@ module Legion::Extensions::Sleepiq
|
|
3
3
|
module Bed
|
4
4
|
include Legion::Extensions::Helpers::Lex
|
5
5
|
extend Legion::Extensions::Sleepiq::Helpers::Client
|
6
|
+
def sleep_number(side: 'R', **)
|
7
|
+
client.sleep_number(side)
|
8
|
+
end
|
6
9
|
|
7
|
-
def
|
10
|
+
def set_sleep_number(side: 'R', number: 50, **)
|
11
|
+
client.update_sleep_number(number, side)
|
12
|
+
end
|
8
13
|
|
9
|
-
def
|
14
|
+
def get_sleep_number_favorite(side: 'R', **)
|
15
|
+
client.sleep_number_fav(side)
|
16
|
+
end
|
10
17
|
|
11
|
-
def
|
18
|
+
def set_sleep_number_favorite(number:, side: 'R', **)
|
19
|
+
client.update_sleep_number_fav
|
20
|
+
end
|
12
21
|
|
13
|
-
def
|
22
|
+
def status(**)
|
23
|
+
client.status
|
24
|
+
end
|
14
25
|
|
15
|
-
def
|
26
|
+
def get_pause_mode(**)
|
27
|
+
client.pause_mode
|
28
|
+
end
|
16
29
|
|
17
|
-
def
|
30
|
+
def set_pause_mode(mode: 'off', **)
|
31
|
+
client.update_pause_mode(mode)
|
32
|
+
end
|
18
33
|
|
19
|
-
def
|
34
|
+
def get(**)
|
35
|
+
client.bed
|
36
|
+
end
|
20
37
|
end
|
21
38
|
end
|
22
39
|
end
|
@@ -4,7 +4,7 @@ module Legion::Extensions::Sleepiq
|
|
4
4
|
include Legion::Extensions::Helpers::Lex
|
5
5
|
extend Legion::Extensions::Sleepiq::Helpers::Client
|
6
6
|
|
7
|
-
def family_status(**
|
7
|
+
def family_status(**)
|
8
8
|
results = normalize(client.family_status)
|
9
9
|
results[:beds][0][:leftSide].delete(:lastLink)
|
10
10
|
results[:beds][0][:rightSide].delete(:lastLink)
|
@@ -4,13 +4,29 @@ module Legion::Extensions::Sleepiq
|
|
4
4
|
include Legion::Extensions::Helpers::Lex
|
5
5
|
extend Legion::Extensions::Sleepiq::Helpers::Client
|
6
6
|
|
7
|
-
def
|
7
|
+
def get_light(light: 1, **)
|
8
|
+
client.light(light)
|
9
|
+
end
|
8
10
|
|
9
|
-
def
|
11
|
+
def set_light(light:, setting: 0, **)
|
12
|
+
client.set_light(light, setting)
|
13
|
+
end
|
10
14
|
|
11
|
-
def
|
15
|
+
def preset(preset:, side: 'R', slow_speed: 0, **)
|
16
|
+
client.preset(preset, side, slow_speed)
|
17
|
+
end
|
12
18
|
|
13
|
-
def
|
19
|
+
def stop_motion(side: 'R', **)
|
20
|
+
client.stop_motion(side)
|
21
|
+
end
|
22
|
+
|
23
|
+
def status(**)
|
24
|
+
client.foundation_status
|
25
|
+
end
|
26
|
+
|
27
|
+
def system(**)
|
28
|
+
client.system
|
29
|
+
end
|
14
30
|
end
|
15
31
|
end
|
16
32
|
end
|
@@ -4,11 +4,11 @@ module Legion::Extensions::Sleepiq
|
|
4
4
|
include Legion::Extensions::Helpers::Lex
|
5
5
|
extend Legion::Extensions::Sleepiq::Helpers::Client
|
6
6
|
|
7
|
-
def pump_status(bedid: nil, **
|
7
|
+
def pump_status(bedid: nil, **)
|
8
8
|
normalize(client.pump_status)
|
9
9
|
end
|
10
10
|
|
11
|
-
def force_idle(bedid: nil, **
|
11
|
+
def force_idle(bedid: nil, **)
|
12
12
|
normalize(client.force_idle)
|
13
13
|
end
|
14
14
|
end
|
@@ -4,13 +4,17 @@ module Legion::Extensions::Sleepiq
|
|
4
4
|
include Legion::Extensions::Helpers::Lex
|
5
5
|
extend Legion::Extensions::Sleepiq::Helpers::Client
|
6
6
|
|
7
|
-
def
|
7
|
+
def sleeper(**)
|
8
|
+
client.sleeper
|
9
|
+
end
|
8
10
|
|
9
|
-
def
|
11
|
+
def sleep_data(date:, interval: 'D1', **)
|
12
|
+
client.sleep_data(date, interval)
|
13
|
+
end
|
10
14
|
|
11
|
-
def
|
12
|
-
|
13
|
-
|
15
|
+
def sleep_slice_data(date:, interval: 'D1', **)
|
16
|
+
client.sleep_slice_data(date, interval)
|
17
|
+
end
|
14
18
|
end
|
15
19
|
end
|
16
20
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lex-sleepiq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Esity
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -142,14 +142,14 @@ dependencies:
|
|
142
142
|
requirements:
|
143
143
|
- - ">="
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 0.
|
145
|
+
version: 0.3.0
|
146
146
|
type: :runtime
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 0.
|
152
|
+
version: 0.3.0
|
153
153
|
description: Used to connect Legion to Sleep Number SleepIQ API
|
154
154
|
email:
|
155
155
|
- matthewdiverson@gmail.com
|
@@ -162,11 +162,10 @@ files:
|
|
162
162
|
- ".rspec"
|
163
163
|
- ".rubocop.yml"
|
164
164
|
- Gemfile
|
165
|
-
- Gemfile.lock
|
166
165
|
- LICENSE.txt
|
167
166
|
- README.md
|
168
167
|
- Rakefile
|
169
|
-
-
|
168
|
+
- lex-sleepiq.gemspec
|
170
169
|
- lib/legion/extensions/sleepiq.rb
|
171
170
|
- lib/legion/extensions/sleepiq/actors/poll.rb
|
172
171
|
- lib/legion/extensions/sleepiq/helpers/client.rb
|
@@ -191,7 +190,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
191
190
|
requirements:
|
192
191
|
- - ">="
|
193
192
|
- !ruby/object:Gem::Version
|
194
|
-
version:
|
193
|
+
version: 2.5.0
|
195
194
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
196
195
|
requirements:
|
197
196
|
- - ">="
|
data/Gemfile.lock
DELETED
@@ -1,91 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
lex-sleepiq (0.1.2)
|
5
|
-
sleepiq (>= 0.2.2)
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: https://rubygems.org/
|
9
|
-
specs:
|
10
|
-
ast (2.4.1)
|
11
|
-
codecov (0.2.8)
|
12
|
-
json
|
13
|
-
simplecov
|
14
|
-
dalli (2.7.10)
|
15
|
-
diff-lcs (1.4.4)
|
16
|
-
docile (1.3.2)
|
17
|
-
faraday (1.0.1)
|
18
|
-
multipart-post (>= 1.2, < 3)
|
19
|
-
faraday_middleware (1.0.0)
|
20
|
-
faraday (~> 1.0)
|
21
|
-
json (2.3.1)
|
22
|
-
multipart-post (2.1.1)
|
23
|
-
parallel (1.19.2)
|
24
|
-
parser (2.7.1.4)
|
25
|
-
ast (~> 2.4.1)
|
26
|
-
rainbow (3.0.0)
|
27
|
-
rake (13.0.1)
|
28
|
-
regexp_parser (1.7.1)
|
29
|
-
rexml (3.2.4)
|
30
|
-
rspec (3.9.0)
|
31
|
-
rspec-core (~> 3.9.0)
|
32
|
-
rspec-expectations (~> 3.9.0)
|
33
|
-
rspec-mocks (~> 3.9.0)
|
34
|
-
rspec-core (3.9.2)
|
35
|
-
rspec-support (~> 3.9.3)
|
36
|
-
rspec-expectations (3.9.2)
|
37
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
38
|
-
rspec-support (~> 3.9.0)
|
39
|
-
rspec-mocks (3.9.1)
|
40
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
41
|
-
rspec-support (~> 3.9.0)
|
42
|
-
rspec-support (3.9.3)
|
43
|
-
rspec_junit_formatter (0.4.1)
|
44
|
-
rspec-core (>= 2, < 4, != 2.12.0)
|
45
|
-
rubocop (0.89.1)
|
46
|
-
parallel (~> 1.10)
|
47
|
-
parser (>= 2.7.1.1)
|
48
|
-
rainbow (>= 2.2.2, < 4.0)
|
49
|
-
regexp_parser (>= 1.7)
|
50
|
-
rexml
|
51
|
-
rubocop-ast (>= 0.3.0, < 1.0)
|
52
|
-
ruby-progressbar (~> 1.7)
|
53
|
-
unicode-display_width (>= 1.4.0, < 2.0)
|
54
|
-
rubocop-ast (0.3.0)
|
55
|
-
parser (>= 2.7.1.4)
|
56
|
-
rubocop-md (0.4.0)
|
57
|
-
rubocop (~> 0.60)
|
58
|
-
rubocop-performance (1.7.1)
|
59
|
-
rubocop (>= 0.82.0)
|
60
|
-
rubocop-rspec (1.43.1)
|
61
|
-
rubocop (~> 0.87)
|
62
|
-
ruby-progressbar (1.10.1)
|
63
|
-
simplecov (0.19.0)
|
64
|
-
docile (~> 1.1)
|
65
|
-
simplecov-html (~> 0.11)
|
66
|
-
simplecov-html (0.12.2)
|
67
|
-
sleepiq (0.2.2)
|
68
|
-
dalli
|
69
|
-
faraday
|
70
|
-
faraday_middleware
|
71
|
-
thor
|
72
|
-
thor (1.0.1)
|
73
|
-
unicode-display_width (1.7.0)
|
74
|
-
|
75
|
-
PLATFORMS
|
76
|
-
ruby
|
77
|
-
|
78
|
-
DEPENDENCIES
|
79
|
-
bundler
|
80
|
-
codecov
|
81
|
-
lex-sleepiq!
|
82
|
-
rake
|
83
|
-
rspec
|
84
|
-
rspec_junit_formatter
|
85
|
-
rubocop
|
86
|
-
rubocop-md
|
87
|
-
rubocop-performance
|
88
|
-
rubocop-rspec
|
89
|
-
|
90
|
-
BUNDLED WITH
|
91
|
-
2.1.4
|