ambient_iot 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 02ff16a078c81ee9ed621d082760770539c02f6d48a0c077fe502f657e2f3c50
4
- data.tar.gz: b08000d6faa32e9b659e48257ac7e29ba9b25ee68612b84c8385b16fa7e6e65d
2
+ SHA1:
3
+ metadata.gz: ba3241a644893da0780e2557fee462e1b393dfc6
4
+ data.tar.gz: 4caa3fa960420362a7758cf0d43296812b5d8c0d
5
5
  SHA512:
6
- metadata.gz: 21fd9ed9b4495ef3a0f7560e03764810c0f8a3ef0d4def93a6acbf33e734a945e8c41b640c7aa24c579afd4b86f2893765171815c0ce03442e42f85ff055fde5
7
- data.tar.gz: b0b15e67574c4764765bac37ff2db097fd9ad6113264a3e7db0ebf8f463abb7ab8b9083d4b2eff530deb18c67d404147fd42997d75c2a2f730f30fa118679383
6
+ metadata.gz: a29b5558f0b320be1f427500065e6678efa9e192d7e16169f35a44955a21c271e662784d25a410f0ed10ea83cbfab37fd8f5e5147ce7f0de75a09f9435ea2c4d
7
+ data.tar.gz: 8d631e2f2d2b775371f6446a7263b8100258d7527bc4dad6187218843e28dca837d1d45366f126f0b650ffcb54779313d06500cdac111849d6073209255fd76a
data/.gitignore CHANGED
@@ -9,3 +9,5 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+ .ruby-version
13
+ *.gem
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # AmbientIot
2
2
 
3
- This is a Gem library to access Ambient ( https://ambidata.io ) service which is provided by AmbientData Inc.
3
+ This is a Ruby Gem library to access Ambient ( https://ambidata.io ) service which is provided by AmbientData Inc.
4
4
  You can upload data (such as a IoT) to Ambient.
5
5
  Then Ambient draw a Graph of the data.
6
6
 
@@ -30,12 +30,15 @@ Then you can get a channel id, a write key and a read key for the channel.
30
30
 
31
31
  ### Uploading data:
32
32
 
33
- Ambient data take keys d1 to d8.
33
+ Ambient data takes keys d1 to d8.
34
34
  You set a data as a hash.
35
35
 
36
+ require 'ambient_iot'
37
+
36
38
  channel_id = 1234 # set your channel id here
37
39
  write_key = "abc.." # set write key of the channel
38
40
  client = AmbientIot::Client.new channel_id, write_key:write_key # create a client
41
+
39
42
  client << { d1:1, d2:2, d3:3} # append a data
40
43
  client.sync # send to Ambient site
41
44
 
@@ -49,10 +52,18 @@ In this case, timestamp is set by Ambient.
49
52
 
50
53
  ### Getting uploaded data:
51
54
 
55
+ require 'ambient_iot'
56
+
52
57
  channel_id = 1234 # set your channel id here
53
58
  read_key = "abc.." # set read key of the channel
54
59
  client = AmbientIot::Client.new channel_id, read_key:read_key # create a client
60
+
55
61
  client.read
62
+ # => [
63
+ # {:d1=>1, :d2=>2, :d3=>3, :created=>2018-04-27 23:13:18 +0900},
64
+ # .
65
+ # {:d1=>2, :d2=>1, :created=>2018-04-24 00:00:00 +0900}
66
+ # ]
56
67
 
57
68
  # with specific date
58
69
  client.read date:Time.new(2018, 4, 26)
@@ -63,12 +74,17 @@ In this case, timestamp is set by Ambient.
63
74
  # with number of data
64
75
  client.read n:1, step:5
65
76
 
66
- ### Getting a channel information and recent updated data
77
+ ### Getting a channel information
78
+
79
+ require 'ambient_iot'
67
80
 
68
81
  channel_id = 1234 # set your channel id here
69
82
  read_key = "abc.." # set read key of the channel
70
83
  client = AmbientIot::Client.new channel_id, read_key:read_key # create a client
71
- client.info
84
+
85
+ client.info # get
86
+ # => {:ch=>"1234", :user=>"1234", :created=>2018-04-23 22:59:06 +0900, :modified=>2018-04-27 23:23:59 +0900, :lastpost=>2018-04-27 23:13:25 +0900, :charts=>1, :chName=>"Temperature", :chDesc=>"Temperature of the room", :d1=>{:name=>"data1", :color=>"1"}, :d2=>{:name=>"data2", :color=>"2"}, :d3=>{:name=>"", :color=>"3"}, :d4=>{:name=>"", :color=>"4"}, :d5=>{:name=>"", :color=>"5"}, :d6=>{:name=>"", :color=>"6"}, :d7=>{:name=>"", :color=>"7"}, :d8=>{:name=>"", :color=>"8"}, :public=>false, :showlocation=>false, :photoid=>"", :phototitle=>"", :dataperday=>1}
87
+
72
88
 
73
89
 
74
90
  ## Contributing
@@ -32,11 +32,14 @@ gem 'ambient_iot'
32
32
  Ambientのデータはd1からd8のキーでデータ系列を表現します。
33
33
  データを与える場合Hashデータとして渡します。
34
34
 
35
+ require 'ambient_iot'
36
+
35
37
  channel_id = 1234 # チャンネル IDをセットします。
36
38
  write_key = "abc.." # チャンネルのライトキーをセットします。
37
39
  client = AmbientIot::Client.new channel_id, write_key:write_key # クライアント生成
40
+
38
41
  client << { d1:1, d2:2, d3:3} # データを追加します。
39
- client.sync # データを送信します
42
+ client.write # データを送信します
40
43
 
41
44
  時刻はデータ追加時に自動で設定されます。
42
45
  時刻を追加したくない場合は append_timestamp にfalseを設定します。
@@ -48,10 +51,18 @@ Ambientのデータはd1からd8のキーでデータ系列を表現します。
48
51
 
49
52
  ### 送信済みの最新のデータを取得する場合:
50
53
 
54
+ require 'ambient_iot'
55
+
51
56
  channel_id = 1234 # チャンネル IDをセットします。
52
57
  read_key = "abc.." # チャンネルのリードキーをセットします。
53
58
  client = AmbientIot::Client.new channel_id, read_key:read_key # クライアント生成
59
+
54
60
  client.read # 送信済みのデータを読み込みます
61
+ # => [
62
+ # {:d1=>1, :d2=>2, :d3=>3, :created=>2018-04-27 23:13:18 +0900},
63
+ # .
64
+ # {:d1=>2, :d2=>1, :created=>2018-04-24 00:00:00 +0900}
65
+ # ]
55
66
 
56
67
  # 特定の日付のデータを取得する場合
57
68
  client.read date:Time.new(2018, 4, 26)
@@ -62,12 +73,16 @@ Ambientのデータはd1からd8のキーでデータ系列を表現します。
62
73
  # データ数を指定する場合
63
74
  client.read n:1, step:5
64
75
 
65
- ### チャンネル情報や最新のデータを取得する場合
76
+ ### チャンネル情報を取得する場合
77
+
78
+ require 'ambient_iot'
66
79
 
67
80
  channel_id = 1234 # チャンネル IDをセットします。
68
81
  read_key = "abc.." # チャンネルのリードキーをセットします。
69
82
  client = AmbientIot::Client.new channel_id, read_key:read_key # クライアント生成
83
+
70
84
  client.info # 情報取得
85
+ # => {:ch=>"1234", :user=>"1234", :created=>2018-04-23 22:59:06 +0900, :modified=>2018-04-27 23:23:59 +0900, :lastpost=>2018-04-27 23:13:25 +0900, :charts=>1, :chName=>"室温", :chDesc=>"部屋の温度", :d1=>{:name=>"データ1", :color=>"1"}, :d2=>{:name=>"データ2", :color=>"2"}, :d3=>{:name=>"", :color=>"3"}, :d4=>{:name=>"", :color=>"4"}, :d5=>{:name=>"", :color=>"5"}, :d6=>{:name=>"", :color=>"6"}, :d7=>{:name=>"", :color=>"7"}, :d8=>{:name=>"", :color=>"8"}, :public=>false, :showlocation=>false, :photoid=>"", :phototitle=>"", :dataperday=>1}
71
86
 
72
87
 
73
88
  ## Contributing
@@ -14,8 +14,6 @@ Gem::Specification.new do |spec|
14
14
  spec.homepage = "https://github.com/ito-soft-design/ambient_iot"
15
15
  spec.license = "MIT"
16
16
 
17
- spec.add_runtime_dependency 'activesupport', '~> 4.2', '>= 4.2.7'
18
-
19
17
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
20
18
  f.match(%r{^(test|spec|features)/})
21
19
  end
@@ -21,5 +21,5 @@
21
21
  # THE SOFTWARE.
22
22
 
23
23
  module AmbientIot
24
- VERSION = "0.1.0"
24
+ VERSION = "0.1.1"
25
25
  end
metadata CHANGED
@@ -1,35 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ambient_iot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katsuyoshi Ito
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-04-27 00:00:00.000000000 Z
11
+ date: 2019-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: activesupport
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '4.2'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 4.2.7
23
- type: :runtime
24
- prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
26
- requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: '4.2'
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 4.2.7
33
13
  - !ruby/object:Gem::Dependency
34
14
  name: bundler
35
15
  requirement: !ruby/object:Gem::Requirement
@@ -116,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
96
  version: '0'
117
97
  requirements: []
118
98
  rubyforge_project:
119
- rubygems_version: 2.7.6
99
+ rubygems_version: 2.5.2
120
100
  signing_key:
121
101
  specification_version: 4
122
102
  summary: AmbientIot is a ruby library which helps to upload IoT data to the Ambient