README.md in helium-ruby-0.9.0 vs README.md in helium-ruby-0.10.0

- old
+ new

@@ -6,18 +6,18 @@ [![Gem Version](https://badge.fury.io/rb/helium-ruby.svg)](https://badge.fury.io/rb/helium-ruby) A Ruby gem for building applications with the Helium API. [Helium](https://www.helium.com/) is an integrated platform of smart sensors, communication, edge and cloud compute that enables numerous sensing applications. For more information about the underlying REST API, check out [the Helium docs](https://docs.helium.com/). -## Helium Documentation and Community Support +## Helium Documentation and Community Support -* **helium-ruby docs** - Documentation for the gem's source can be found [here](https://helium.github.io/helium-ruby/): +* **helium-ruby docs** - Documentation for the gem's source can be found [here](https://helium.github.io/helium-ruby/): -* **Helium Docs** Complete documenation for all parts of Helium can be found at [docs.helium.com](https://docs/helium.com). +* **Helium Docs** Complete documenation for all parts of Helium can be found at [docs.helium.com](https://docs/helium.com). -* **chat.helium.com** - If you have questions or ideas about how to use this code - or any part of Helium - head over the [chat.helium.com](https://chat.helium.com). We're standing by to help. +* **chat.helium.com** - If you have questions or ideas about how to use this code - or any part of Helium - head over the [chat.helium.com](http://chat.helium.com). We're standing by to help. ## Installation Add this line to your application's Gemfile: @@ -183,10 +183,19 @@ # => 22.2916633036437 ``` A full list of aggregation types and sizes can be found here: https://docs.helium.com/docs/timeseries#aggregations. +#### Creating Timeseries data + +Data points can be written to a sensor's timeseries data. + +```ruby +sensor.timeseries.create(port: "power level", value: "over 9000", timestamp: DateTime.now) +# => #<Helium::DataPoint:0x007f88634b9e50 @params={"attributes"=>{"value"=>"over 9000", "timestamp"=>"2016-09-26T23:19:01Z", "port"=>"power level"}, "relationships"=>{"sensor"=>{"data"=>{"id"=>"071488bb-3050-4849-8984-ca9e683cfc91", "type"=>"sensor"}}}, "id"=>"fd557521-8f59-457f-a75e-d0ce2c58dc1a", "meta"=>{"created"=>"2016-09-26T23:19:06.695036Z"}, "type"=>"data-point"}, @id="fd557521-8f59-457f-a75e-d0ce2c58dc1a", @type="data-point", @created_at="2016-09-26T23:19:06.695036Z", @updated_at=nil, @timestamp="2016-09-26T23:19:01Z", @value="over 9000", @port="power level"> +``` + ### Elements #### Get all Elements ```ruby @@ -202,9 +211,18 @@ #### Update an Element ```ruby element.update(name: "A New Name") # => #<Helium::Element:0x007faf732c2548 @id="1b686e82-bd4a-4aac-9d7b-9bdbe1e9a7de", @name="A New Name", @mac="6081f9fffe00033f", @created_at="2015-08-12T23:19:34.175932Z", @updated_at="2015-08-12T23:19:34.174828Z", @versions=nil> +``` + +#### Creating Timeseries data + +Data points can be written to an element's timeseries data. + +```ruby +element.timeseries.create(port: "power level", value: "over 9000", timestamp: DateTime.now) +# => #<Helium::DataPoint:0x007f88634b9e50 @params={"attributes"=>{"value"=>"over 9000", "timestamp"=>"2016-09-26T23:19:01Z", "port"=>"power level"}, "relationships"=>{"sensor"=>{"data"=>{"id"=>"071488bb-3050-4849-8984-ca9e683cfc91", "type"=>"sensor"}}}, "id"=>"fd557521-8f59-457f-a75e-d0ce2c58dc1a", "meta"=>{"created"=>"2016-09-26T23:19:06.695036Z"}, "type"=>"data-point"}, @id="fd557521-8f59-457f-a75e-d0ce2c58dc1a", @type="data-point", @created_at="2016-09-26T23:19:06.695036Z", @updated_at=nil, @timestamp="2016-09-26T23:19:01Z", @value="over 9000", @port="power level"> ``` ### Labels Sensors can be grouped together under a named label.