ambient_iot 0.1.0 → 0.1.1
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 +5 -5
- data/.gitignore +2 -0
- data/README.md +20 -4
- data/README_ja.md +17 -2
- data/ambient_iot.gemspec +0 -2
- data/lib/ambient_iot/version.rb +1 -1
- metadata +3 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ba3241a644893da0780e2557fee462e1b393dfc6
|
4
|
+
data.tar.gz: 4caa3fa960420362a7758cf0d43296812b5d8c0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a29b5558f0b320be1f427500065e6678efa9e192d7e16169f35a44955a21c271e662784d25a410f0ed10ea83cbfab37fd8f5e5147ce7f0de75a09f9435ea2c4d
|
7
|
+
data.tar.gz: 8d631e2f2d2b775371f6446a7263b8100258d7527bc4dad6187218843e28dca837d1d45366f126f0b650ffcb54779313d06500cdac111849d6073209255fd76a
|
data/.gitignore
CHANGED
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
|
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
|
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
|
-
|
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
|
data/README_ja.md
CHANGED
@@ -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.
|
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
|
data/ambient_iot.gemspec
CHANGED
@@ -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
|
data/lib/ambient_iot/version.rb
CHANGED
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.
|
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:
|
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.
|
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
|