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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bc465def70ae3235f43b761d3dbf43ddd1a1a8f
|
4
|
+
data.tar.gz: 9ee65a351c1438e9534b017b0d2e67cd42e0868d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
-
|
245
|
-
|
249
|
+
development:
|
250
|
+
adapter: redis
|
251
|
+
|
252
|
+
test:
|
253
|
+
adapter: redis
|
254
|
+
|
255
|
+
production:
|
256
|
+
adapter: redis
|
257
|
+
```
|
246
258
|
|
247
|
-
|
248
|
-
adapter: redis
|
259
|
+
Add the following to your Gemfile:
|
249
260
|
|
250
|
-
|
251
|
-
|
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
|
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
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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
|
data/lib/simbiotes/version.rb
CHANGED
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.
|
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.
|
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.
|