simbiotes 0.1.2 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5175c82cbb859c8acf4e373e14853b27c27181fa
4
- data.tar.gz: ca6226e2bdaa00d2e20cfe8e9362a785341fcfc8
3
+ metadata.gz: 0bc465def70ae3235f43b761d3dbf43ddd1a1a8f
4
+ data.tar.gz: 9ee65a351c1438e9534b017b0d2e67cd42e0868d
5
5
  SHA512:
6
- metadata.gz: ae1a9cb4215875a16ee809ee132f55004d4d28a0f8115c3a412ec338e127623cccb12a0ef900bd92db72e324e707893c1ef0224d8249ec7416b0f853b6dd132d
7
- data.tar.gz: '09d629d03704e362da4f8f8ffcc5d672c8171bef955eec3a227c9d71c64b2241560b2d8761ef372f204c4fa09da9f213b6ccb2ec9bde400efb2fa8e3dd4b8945'
6
+ metadata.gz: bea42913e29e6a28f6b1b14f87457b976acf722be890de790199e3a5b4cc23d7c2f2a0717015683db2779075ada74415b1dcdaeb054168c732e2608f888d6bf2
7
+ data.tar.gz: 328e272f07938648d6fee700008a36393fad9f037d4819e7715d31c879c2f662926f765a2222108256ed8a9f1175c47ddba0b49ea1aa8b6103756e1fc9846831
data/README.md CHANGED
@@ -102,7 +102,7 @@ This starts our communications server. If you want to stop the communications s
102
102
  $ rake comms:stop
103
103
  ```
104
104
 
105
- Note that you can only communication with devices if the local communications server is running.
105
+ Note that you can only communicate with devices if the local communications server is running.
106
106
 
107
107
  ### Creating and uploading scripts.
108
108
 
@@ -195,6 +195,11 @@ If you haven't done it already, run
195
195
  ```bash
196
196
  > rails generate simple_form:install
197
197
  ```
198
+ Then at the top of the config/initializers/simple_form.rb file put
199
+
200
+ ```ruby
201
+ require 'simple_form'
202
+ ```
198
203
 
199
204
  To install the form helpers we will use to build forms to edit device interfaces via the browser.
200
205
 
@@ -241,25 +246,36 @@ Then, once it is installed, run:
241
246
  In your Rails application, edit your config/cable.yml file to look as follows:
242
247
 
243
248
  ```yaml
244
- development:
245
- adapter: redis
249
+ development:
250
+ adapter: redis
251
+
252
+ test:
253
+ adapter: redis
254
+
255
+ production:
256
+ adapter: redis
257
+ ```
246
258
 
247
- test:
248
- adapter: redis
259
+ Add the following to your Gemfile:
249
260
 
250
- production:
251
- adapter: redis
261
+ ```ruby
262
+ gem 'jquery-rails'
263
+ ```
264
+
265
+ And run
266
+
267
+ ```bash
268
+ > bundle install
252
269
  ```
253
270
 
254
- Next, open up your app/assets/javascripts/application.js file. Make sure the end of it looks like the following:
271
+ Next, open up your app/assets/javascripts/application.js file. Make sure you add the following lines to it above the require_tree . line, if you have it.
255
272
 
256
273
  ```js
257
274
  //= require jquery
258
275
  //= require jquery_ujs
259
- //= require_tree .
260
276
  ```
261
277
 
262
- Then, restart your Rails server.
278
+ Then, restart your Rails server. Once you have done that, the values on the Thermostats page will update via push notifications.
263
279
 
264
280
 
265
281
  ## Contributing
@@ -1,12 +1,16 @@
1
- App.alert = App.cable.subscriptions.create('<%= "#{module_name}" + "Channel" %>',
2
- connected: ->
3
- # Called when the subscription is ready for use on the server
4
- return
5
- disconnected: ->
6
- # Called when the subscription has been terminated by the server
7
- return
8
- received: (data) ->
9
-
10
- # Called when there's incoming data on the websocket for this channel
11
- return
12
- )
1
+ $(document).ready ->
2
+ App.alert = App.cable.subscriptions.create('<%= "#{module_name}" + "Channel" %>',
3
+ connected: ->
4
+ # Called when the subscription is ready for use on the server
5
+ return
6
+ disconnected: ->
7
+ # Called when the subscription has been terminated by the server
8
+ return
9
+ received: (data) ->
10
+ console.log data
11
+ tr = $("#" + data["simbiotes_instance"])
12
+ td = tr.children("." + data["worker_name"] + "-" + data["model_name"] + "-" + data["interface"])
13
+ td.text(data["value"])
14
+ # Called when there's incoming data on the websocket for this channel
15
+ return
16
+ )
@@ -54,7 +54,7 @@ module <%= module_name %>
54
54
 
55
55
  # Only allow a trusted parameter "white list" through.
56
56
  def <%= module_file_name %>_params
57
- params.fetch(:<%= module_file_name %>, {}).permit(:id, :simbiotes_instance<% Simbiotes.configuration.targets[module_name].keys.each do |key| %>, :<%= key.downcase %>_attributes => <%= Simbiotes.configuration.targets[module_name][key] %><% end %>)
57
+ params.fetch(:<%= module_file_name %>_<%= module_file_name %>, {}).permit(:id, :simbiotes_instance<% Simbiotes.configuration.targets[module_name].keys.each do |key| %>, :<%= key.downcase %>_attributes => <%= Simbiotes.configuration.targets[module_name][key] %><% end %>)
58
58
  end
59
59
  end
60
60
  end
@@ -1,3 +1,3 @@
1
1
  module Simbiotes
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simbiotes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - MicroArx Corporation
@@ -221,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
221
221
  version: '0'
222
222
  requirements: []
223
223
  rubyforge_project:
224
- rubygems_version: 2.6.10
224
+ rubygems_version: 2.2.2
225
225
  signing_key:
226
226
  specification_version: 4
227
227
  summary: The easy way to integrate the IoT in your web app.