ladder_drive 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +7 -2
- data/ladder_drive.gemspec +1 -0
- data/lib/ladder_drive/config.rb +1 -0
- data/lib/ladder_drive/config_target.rb +1 -0
- data/lib/ladder_drive/plc_device.rb +11 -0
- data/lib/ladder_drive/protocol/keyence/kv_protocol.rb +0 -10
- data/lib/ladder_drive/protocol/mitsubishi/fx_protocol.rb +0 -10
- data/lib/ladder_drive/protocol/mitsubishi/mc_protocol.rb +0 -10
- data/lib/ladder_drive/protocol/omron/c_mode_protocol.rb +224 -0
- data/lib/ladder_drive/protocol/omron/fins_tcp_protocol.rb +378 -0
- data/lib/ladder_drive/protocol/omron/omron.rb +28 -0
- data/lib/ladder_drive/protocol/omron/omron_device.rb +139 -0
- data/lib/ladder_drive/protocol/protocol.rb +14 -5
- data/lib/ladder_drive/tasks/build.rb +1 -1
- data/lib/ladder_drive/version.rb +1 -1
- data/plugins/ambient_plugin.rb +187 -0
- data/plugins/plc_mapper_plugin.rb +27 -15
- data/plugins/trello_plugin.rb +11 -6
- metadata +8 -3
data/plugins/trello_plugin.rb
CHANGED
@@ -80,25 +80,26 @@ class TrelloPlugin < Plugin
|
|
80
80
|
|
81
81
|
@config[:events].each do |event|
|
82
82
|
begin
|
83
|
-
|
83
|
+
event_id = event.object_id
|
84
84
|
triggered = false
|
85
85
|
now = Time.now
|
86
86
|
device = nil
|
87
87
|
|
88
88
|
case event[:trigger][:type]
|
89
89
|
when "interval"
|
90
|
-
t = @times[
|
90
|
+
t = @times[event_id] || now
|
91
91
|
triggered = t <= now
|
92
92
|
if triggered
|
93
93
|
triggered = true
|
94
94
|
t += event[:trigger][:interval] || 300
|
95
|
-
@times[
|
95
|
+
@times[event_id] = t
|
96
96
|
end
|
97
97
|
else
|
98
98
|
device = plc.device_by_name event[:trigger][:device]
|
99
99
|
v = device.send event[:trigger][:value_type], event[:trigger][:text_length] || 8
|
100
|
-
|
101
|
-
|
100
|
+
@values[event_id] ||= {}
|
101
|
+
unless @values[event_id][device.name] == v
|
102
|
+
@values[event_id][device.name] = v
|
102
103
|
case event[:trigger][:type]
|
103
104
|
when "raise"
|
104
105
|
triggered = !!v
|
@@ -116,6 +117,8 @@ class TrelloPlugin < Plugin
|
|
116
117
|
|
117
118
|
rescue => e
|
118
119
|
p e
|
120
|
+
puts $!
|
121
|
+
puts $@
|
119
122
|
end
|
120
123
|
end
|
121
124
|
end
|
@@ -137,7 +140,7 @@ class TrelloPlugin < Plugin
|
|
137
140
|
next unless board
|
138
141
|
|
139
142
|
card_name = event[:card_name].dup || ""
|
140
|
-
card_name.gsub!(/__value__/, arg[:value] || "")
|
143
|
+
card_name.gsub!(/__value__/, arg[:value] || "") if arg[:value].is_a? String
|
141
144
|
next if (card_name || "").empty?
|
142
145
|
|
143
146
|
list_name = event[:list_name]
|
@@ -155,6 +158,8 @@ class TrelloPlugin < Plugin
|
|
155
158
|
rescue => e
|
156
159
|
# TODO: Resend if it fails.
|
157
160
|
p e
|
161
|
+
puts $!
|
162
|
+
puts $@
|
158
163
|
end
|
159
164
|
end
|
160
165
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ladder_drive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Katsuyoshi Ito
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -190,6 +190,10 @@ files:
|
|
190
190
|
- lib/ladder_drive/protocol/mitsubishi/mc_protocol.rb
|
191
191
|
- lib/ladder_drive/protocol/mitsubishi/mitsubishi.rb
|
192
192
|
- lib/ladder_drive/protocol/mitsubishi/qdevice.rb
|
193
|
+
- lib/ladder_drive/protocol/omron/c_mode_protocol.rb
|
194
|
+
- lib/ladder_drive/protocol/omron/fins_tcp_protocol.rb
|
195
|
+
- lib/ladder_drive/protocol/omron/omron.rb
|
196
|
+
- lib/ladder_drive/protocol/omron/omron_device.rb
|
193
197
|
- lib/ladder_drive/protocol/protocol.rb
|
194
198
|
- lib/ladder_drive/tasks/build.rb
|
195
199
|
- lib/ladder_drive/uploader.rb
|
@@ -226,6 +230,7 @@ files:
|
|
226
230
|
- lib/plc/raspberrypi/raspberrypi.rb
|
227
231
|
- lib/plc/raspberrypi/raspberrypi_plc.rb
|
228
232
|
- lib/plc/raspberrypi/raspberrypi_plc_server.rb
|
233
|
+
- plugins/ambient_plugin.rb
|
229
234
|
- plugins/blank_plugin.rb
|
230
235
|
- plugins/google_drive_plugin.rb
|
231
236
|
- plugins/ifttt_plugin.rb
|
@@ -253,7 +258,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
253
258
|
requirements:
|
254
259
|
- - ">="
|
255
260
|
- !ruby/object:Gem::Version
|
256
|
-
version:
|
261
|
+
version: 2.3.3
|
257
262
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
258
263
|
requirements:
|
259
264
|
- - ">="
|