m2x-mqtt 0.1.0 → 0.2.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 +4 -4
- data/lib/m2x/mqtt/device.rb +33 -0
- data/lib/m2x/mqtt/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6473976f9a8f12fcb6c6e8e08884a31b6e7865e0
|
4
|
+
data.tar.gz: 3e4b2ad0d14a5e5a5324da70bc54f22c145a80d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdef4c3d3d59b5b1b2a7efd4aa0aeb8d4e229528327cf92280dc978426709ecc2abe0275ee948ed6cfd6ee21a7be1626a0979197132174e655db9ffbb7ad9eba
|
7
|
+
data.tar.gz: 462e780b49e185af8109e646712ebebb497ffdb8148f06d45b934efe55d4c631bb583405e1a38bbe71b81c0b5027fc233b05b9a2e9ffd2b08788d5357101c608
|
data/lib/m2x/mqtt/device.rb
CHANGED
@@ -59,4 +59,37 @@ class M2X::MQTT::Device < M2X::MQTT::Resource
|
|
59
59
|
def post_updates(params)
|
60
60
|
@client.post("#{path}/updates", params)
|
61
61
|
end
|
62
|
+
|
63
|
+
# Post Device Update (Single Value to Multiple Streams)
|
64
|
+
#
|
65
|
+
# This method allows posting a single value to multiple streams
|
66
|
+
# belonging to a device and optionally, the device's location.
|
67
|
+
#
|
68
|
+
# All the streams should be created before posting values using this method.
|
69
|
+
#
|
70
|
+
# The `params` parameter accepts a Hash which can contain the following keys:
|
71
|
+
# - values: A Hash in which the keys are the stream names and the values
|
72
|
+
# hold the stream values.
|
73
|
+
# - location: (optional) A hash with the current location of the specified
|
74
|
+
# device.
|
75
|
+
# - timestamp: (optional) The timestamp for all the passed values and
|
76
|
+
# location. If ommited, the M2X server's time will be used.
|
77
|
+
#
|
78
|
+
# {
|
79
|
+
# values: {
|
80
|
+
# temperature: 30,
|
81
|
+
# humidity: 80
|
82
|
+
# },
|
83
|
+
# location: {
|
84
|
+
# name: "Storage Room",
|
85
|
+
# latitude: -37.9788423562422,
|
86
|
+
# longitude: -57.5478776916862,
|
87
|
+
# elevation: 5
|
88
|
+
# }
|
89
|
+
# }
|
90
|
+
#
|
91
|
+
# https://m2x.att.com/developer/documentation/v2/device#Post-Device-Update--Single-Values-to-Multiple-Streams-
|
92
|
+
def post_update(params)
|
93
|
+
@client.post("#{path}/update", params)
|
94
|
+
end
|
62
95
|
end
|
data/lib/m2x/mqtt/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: m2x-mqtt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leandro López
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-
|
13
|
+
date: 2015-08-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: mqtt
|
@@ -68,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
68
68
|
version: '0'
|
69
69
|
requirements: []
|
70
70
|
rubyforge_project:
|
71
|
-
rubygems_version: 2.4.5
|
71
|
+
rubygems_version: 2.4.5.1
|
72
72
|
signing_key:
|
73
73
|
specification_version: 4
|
74
74
|
summary: Ruby client for AT&T M2X (MQTT)
|