amon 0.7.0 → 0.8.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.
- data/README.md +1 -1
- data/lib/amon/device.rb +10 -0
- data/lib/amon/reading.rb +9 -0
- data/lib/amon/version.rb +1 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -3,7 +3,7 @@ Ruby Client for the AMEE AMON API
|
|
3
3
|
|
4
4
|
This is a Ruby client library for the [AMEE](http://www.amee.com/) <abbr title="AMEE Monitoring Object Notation">AMON</abbr> <abbr title="Application Programming Interface">API</abbr>. _More details and links to be inserted once information about the API is publicly available_.
|
5
5
|
|
6
|
-
This is version 0.
|
6
|
+
This is version 0.8.0 and is built to support AMON V3: https://github.com/AMEE/amon
|
7
7
|
|
8
8
|
## Installation ##
|
9
9
|
|
data/lib/amon/device.rb
CHANGED
@@ -16,6 +16,11 @@ module AMON
|
|
16
16
|
@uuid ||= json['deviceId']
|
17
17
|
end
|
18
18
|
|
19
|
+
# @return <String> The deviceId for the device's parent device
|
20
|
+
def parent_uuid
|
21
|
+
@parent_uuid ||= json['parentId']
|
22
|
+
end
|
23
|
+
|
19
24
|
# @return <String> The description for the device
|
20
25
|
def description
|
21
26
|
@description ||= json['description']
|
@@ -31,6 +36,11 @@ module AMON
|
|
31
36
|
@metadata ||= Metadata.new(self, json['metadata'])
|
32
37
|
end
|
33
38
|
|
39
|
+
# @return <String> The metadata "customer_ref" field; convenience method
|
40
|
+
def customer_ref
|
41
|
+
@customer_ref ||= metadata.customer_ref
|
42
|
+
end
|
43
|
+
|
34
44
|
# @return [Array<Reading>] The readings for the device
|
35
45
|
def readings
|
36
46
|
@readings ||= json['readings'].map { |reading| Reading.new(self, reading) }
|
data/lib/amon/reading.rb
CHANGED
@@ -22,6 +22,15 @@ module AMON
|
|
22
22
|
# @return [Numeric] The accuracy of the reading
|
23
23
|
field :accuracy
|
24
24
|
|
25
|
+
# @return [Numeric] The frequency of the reading
|
26
|
+
field :frequency
|
27
|
+
|
28
|
+
# @return [Numeric] The expected minimum of the readings
|
29
|
+
field :min
|
30
|
+
|
31
|
+
# @return [Numeric] The expected maximum of the readings
|
32
|
+
field :max
|
33
|
+
|
25
34
|
# @return ["instant", "duration"] Whether this reading records measurement
|
26
35
|
# values taken at a specific point in time ('instant'), or taken as an
|
27
36
|
# average over a period of time ('duration')
|
data/lib/amon/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 63
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 8
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.8.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- AMEE
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-10-
|
18
|
+
date: 2012-10-23 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: json
|