m2x-mqtt 0.1.0 → 0.2.0

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
2
  SHA1:
3
- metadata.gz: b32c44de80c644544251f8503c5de3c44c58a32e
4
- data.tar.gz: 5db185ffe40fe7ee3524474102ddee4eb508457d
3
+ metadata.gz: 6473976f9a8f12fcb6c6e8e08884a31b6e7865e0
4
+ data.tar.gz: 3e4b2ad0d14a5e5a5324da70bc54f22c145a80d5
5
5
  SHA512:
6
- metadata.gz: 7a533bbe8ca5150fdcfaebb6d1cc5eb757374453165d4d2cc50b2eb26a325df4d1160a2d9a6d15253491dd34347a8f4cde34488c1fb2ad4a9df865b838c1a24f
7
- data.tar.gz: 81e8bbe9f3161cd6e0da6a96c8f19325146f9b32dcbf9e786b5aa31fd46b2a3170828f260dbafc8aadefd5e5667c3acb1e11da2384ef232472f5feb86dc81002
6
+ metadata.gz: bdef4c3d3d59b5b1b2a7efd4aa0aeb8d4e229528327cf92280dc978426709ecc2abe0275ee948ed6cfd6ee21a7be1626a0979197132174e655db9ffbb7ad9eba
7
+ data.tar.gz: 462e780b49e185af8109e646712ebebb497ffdb8148f06d45b934efe55d4c631bb583405e1a38bbe71b81c0b5027fc233b05b9a2e9ffd2b08788d5357101c608
@@ -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
@@ -1,5 +1,5 @@
1
1
  module M2X
2
2
  class MQTT
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
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.1.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-07-04 00:00:00.000000000 Z
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)