smart_energy_group 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/CHANGELOG.md +4 -0
- data/README.md +10 -0
- data/lib/smart_energy_group/client.rb +11 -2
- data/lib/smart_energy_group/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4cb0a88958822979df67e495f49f7c041bf80617
|
4
|
+
data.tar.gz: 3383031983ae53cbdb2e1ce5ba9b45eb36126e0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 780933a577b9fab66308cd566209ef5b6be274bf24e240cf104609db3c1effb6b0ff8c18cf402b57b65d25f5070cc07553440e9ad817678a733bebc16795b5c0
|
7
|
+
data.tar.gz: e8d639d06f1be21b6fcbfda1089f13720662095074fc4356d3c318bdae980a81750851887d43a5b75d8e3f4420845e66cfafd5e94dfde24450c7383dfff3e3aa
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -47,6 +47,16 @@ seg.send_data(
|
|
47
47
|
)
|
48
48
|
```
|
49
49
|
|
50
|
+
If you don't have consecutive channels that you want to send you can pass an
|
51
|
+
array like so
|
52
|
+
|
53
|
+
``` ruby
|
54
|
+
seg.send_data(
|
55
|
+
'home',
|
56
|
+
:power => { 1 => 1023.6, 5 => 500.9 }
|
57
|
+
)
|
58
|
+
```
|
59
|
+
|
50
60
|
The send_data operation accepts the following options
|
51
61
|
|
52
62
|
| Option | Description |
|
@@ -38,9 +38,18 @@ module SmartEnergyGroup
|
|
38
38
|
|
39
39
|
def generate_data(options)
|
40
40
|
data = []
|
41
|
+
|
41
42
|
DATA_TYPES.keys.each do |type|
|
42
|
-
|
43
|
-
|
43
|
+
case options[type]
|
44
|
+
when Array
|
45
|
+
data += options[type].map.with_index(1) { |value, i| "(#{DATA_TYPES[type]}_#{i} #{value})" }
|
46
|
+
when Hash
|
47
|
+
data += options[type].map { |i, value| "(#{DATA_TYPES[type]}_#{i} #{value})" }
|
48
|
+
when NilClass
|
49
|
+
next
|
50
|
+
else
|
51
|
+
raise('Unsupported object type')
|
52
|
+
end
|
44
53
|
end
|
45
54
|
|
46
55
|
data.join('')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smart_energy_group
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Ferlito
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|