insnergy-api-ruby-client 0.14.0 → 0.15.0

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
  SHA1:
3
- metadata.gz: 7a30c6bfc994855b02db2e550374b1198a8caa22
4
- data.tar.gz: '0729e068623f42c59f849a4fb8a8b9da686caa5a'
3
+ metadata.gz: 2b28471bd699512bf03850f9f45ea7fcd86dfa56
4
+ data.tar.gz: 210898772cbcc2e148e7fb5668906d6756d38f1a
5
5
  SHA512:
6
- metadata.gz: 3a9a4f197ecab38d7e89b5afae026f75e242cb736d4dd83df7901d656e525d593eb620d167d3609d151978a5caeeac22d045c545b3f415e1ef17d714eda8880f
7
- data.tar.gz: 384afcaa711c9f8e00742bfe336e5d8aadd79d1c44bb6ee20c226c7882a3c7f596f5aabc2bc11dc1f45ac23c29c3b255eb0f5fb027c8ccc77395382ad53155fe
6
+ metadata.gz: 75e6ec10b9b5dc2b94b4c1cec2764926f19f19e510dcea85625fcdc2795a1bfd4607e552d46d13c0ce5bdd38389804588849b90cf8bf6e0d586322523f0fa6c0
7
+ data.tar.gz: c0a7ef9593cc4fef1a5020a3f86f8ddc074eaac164df5862357aa909f21ea6d30160783e3ca2188b2766e442a17e1e2338b42d735c30933c699abdcf46ae52bb
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.14.0
1
+ 0.15.0
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: insnergy-api-ruby-client 0.14.0 ruby lib
5
+ # stub: insnergy-api-ruby-client 0.15.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "insnergy-api-ruby-client"
9
- s.version = "0.14.0"
9
+ s.version = "0.15.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["kaogaau"]
14
- s.date = "2016-12-21"
14
+ s.date = "2017-01-09"
15
15
  s.description = "The ruby gem about In-Snergy Family"
16
16
  s.email = "kaogaau@gmail.com"
17
17
  s.extra_rdoc_files = [
@@ -138,7 +138,7 @@ module Insnergy
138
138
  end
139
139
 
140
140
  def widget_info_value
141
- @widget_dev_type_name
141
+ self."#{@widget_dev_type_name}"
142
142
  end
143
143
 
144
144
  def co_meter
@@ -9,14 +9,14 @@ RSpec.configure do |config|
9
9
  end
10
10
 
11
11
  describe Insnergy::Client do
12
- before(:all) do #itri-tomato.project@insnergy.com
13
- domain = 'https://if3.insnergy.com'
14
- oauth_key = 'aac61d6e-b9df-4cf6-a44e-dbba0518b339'
15
- oauth_secert = 'ffaa37d1-74eb-42db-a555-91aa59d4f540'
16
- refresh_token = 'a8f1cea8-ff8e-4e88-b280-551eafe894a7'
17
- @insnergy = Insnergy::Client::Token.new(domain: domain, oauth_key: oauth_key, oauth_secert: oauth_secert, refresh_token: refresh_token)
18
- end
19
-
12
+ #before(:all) do #itri-tomato.project@insnergy.com
13
+ # domain = 'https://if3.insnergy.com'
14
+ # oauth_key = 'aac61d6e-b9df-4cf6-a44e-dbba0518b339'
15
+ # oauth_secert = 'ffaa37d1-74eb-42db-a555-91aa59d4f540'
16
+ # refresh_token = 'a8f1cea8-ff8e-4e88-b280-551eafe894a7'
17
+ # @insnergy = Insnergy::Client::Token.new(domain: domain, oauth_key: oauth_key, oauth_secert: oauth_secert, refresh_token: refresh_token)
18
+ #end
19
+ =begin
20
20
  describe Insnergy::Client::Token do
21
21
  before(:all) do
22
22
  @access_token = @insnergy.access_token
@@ -141,24 +141,47 @@ describe Insnergy::Client do
141
141
  end
142
142
  end
143
143
  end
144
-
144
+ =end
145
145
  describe Insnergy::Client::Control do
146
- before(:all) do
147
- @device_id = 'II09000D6F0003BBAE83'
148
- @control = Insnergy::Client::Control.new(client: @insnergy, device_id: @device_id, action: 'on')
149
- end
146
+ #before(:all) do
147
+ # @device_id = 'II09000D6F0003BBAE83'
148
+ # @control = Insnergy::Client::Control.new(client: @insnergy, device_id: @device_id, action: 'on')
149
+ #end
150
150
 
151
151
  describe "#initialize" do
152
152
  context "when initialize a new object" do
153
153
  it "must exist response" do
154
- @control_response = @control.response
155
- expect(@control_response).not_to eq(nil)
154
+ domain = 'https://if3.insnergy.com'
155
+ #oauth_key = 'aac61d6e-b9df-4cf6-a44e-dbba0518b339'
156
+ #oauth_secert = 'ffaa37d1-74eb-42db-a555-91aa59d4f540'
157
+ #refresh_token = 'a8f1cea8-ff8e-4e88-b280-551eafe894a7'
158
+ #device_id = 'RS06000D6F0003BB8B88'
159
+ uid = 'itri-tomato.project@insnergy.com'
160
+ token = '4069e83d-cb14-4fed-8d40-10b6f1fa3934'
161
+ device_id = "RS06000D6F0003BB8B88#01|II09000D6F0003BBAE83|RS06000D6F0003BB8B88#01|II09000D6F0003BBAE83".split('|').map{|ele| ele.split('#').first}
162
+ #insnergy = Insnergy::Client::Token.new(domain: domain, oauth_key: oauth_key, oauth_secert: oauth_secert, refresh_token: refresh_token)
163
+ Client = Struct.new(:domain, :access_token, :user_id)
164
+ insnergy = Client.new(domain, token, uid)
165
+
166
+ #insnergy = Insnergy::Client::Token.new(domain: domain, oauth_key: oauth_key, oauth_secert: oauth_secert, refresh_token: refresh_token)
167
+ #p insnergy
168
+ p device_id
169
+ control_response = Array.new()
170
+ 10.times do
171
+ device_id.each do |ele|
172
+ control = Insnergy::Client::Control.new(client: insnergy, device_id: ele, action: 'on')
173
+ puts '....'
174
+ control_response << control.response
175
+ end
176
+ end
177
+ p control_response
178
+ #expect(@control_response).not_to eq(nil)
156
179
  end
157
180
 
158
- it "response'structre must exist relay_status and br on" do
159
- @control_response = @control.response
160
- expect(@control_response['relay_status']).to eq('on')
161
- end
181
+ #it "response'structre must exist relay_status and br on" do
182
+ #@control_response = @control.response
183
+ #expect(@control_response['relay_status']).to eq('on')
184
+ #end
162
185
  end
163
186
  end
164
187
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: insnergy-api-ruby-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kaogaau
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-21 00:00:00.000000000 Z
11
+ date: 2017-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client