somfy_sdn 2.1.4 → 2.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sdn/cli/provisioner.rb +20 -9
- data/lib/sdn/client.rb +1 -0
- data/lib/sdn/message.rb +1 -0
- data/lib/sdn/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83eab2a162518795d82296d471608e8b9a300d34e6b81897630a06e81456ed40
|
4
|
+
data.tar.gz: d8bfc48d510c2a5b97663326bb893d5abc09fd5a4b1876a70e03a408ad446e15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c523da782a69732baf2d114fe412125d0406b96764b9119e97cfea221808c6cff702b6a3f7f8b487afba5f85c919f9a554f707405f15f175682a0072512e9ecd
|
7
|
+
data.tar.gz: 56a628ec9e87aab0667c67ad379194bb67c2f5bd0a26c9995ac5b164f4173c296566b3b749fc5823ec7d1151a2e6083add55eef4fe7bcc521a2f11c0812d29bb
|
data/lib/sdn/cli/provisioner.rb
CHANGED
@@ -70,6 +70,7 @@ module SDN
|
|
70
70
|
win.keypad = true
|
71
71
|
print_help
|
72
72
|
refresh
|
73
|
+
wait_for_stop
|
73
74
|
|
74
75
|
loop do
|
75
76
|
char = win.getch
|
@@ -170,18 +171,29 @@ r reverse motor
|
|
170
171
|
def wait_for_stop
|
171
172
|
win.setpos(13, 0)
|
172
173
|
win.addstr("Moving...\n")
|
174
|
+
|
173
175
|
loop do
|
174
176
|
win.nodelay = true
|
175
177
|
stop if win.getch == 27 # Esc
|
178
|
+
|
176
179
|
sdn.send(ns::GetMotorPosition.new(addr))
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
if
|
180
|
+
unless ilt2?
|
181
|
+
sleep 0.1
|
182
|
+
sdn.send(ns::GetMotorStatus.new(addr))
|
183
|
+
end
|
184
|
+
|
185
|
+
sdn.receive(0.1) do |message|
|
186
|
+
|
187
|
+
if message.is_a?(ns::PostMotorPosition)
|
188
|
+
last_pos = @pos
|
189
|
+
@pos = message.position_pulses
|
190
|
+
win.setpos(14, 0)
|
191
|
+
win.addstr("Position: #{@pos}\n")
|
192
|
+
end
|
193
|
+
|
194
|
+
if (ilt2? && last_pos == @pos) ||
|
195
|
+
(message.is_a?(Message::PostMotorStatus) &&
|
196
|
+
message.state != :running)
|
185
197
|
win.setpos(13, 0)
|
186
198
|
win.addstr("\n")
|
187
199
|
win.nodelay = false
|
@@ -190,7 +202,6 @@ r reverse motor
|
|
190
202
|
end
|
191
203
|
end
|
192
204
|
sleep 0.1
|
193
|
-
|
194
205
|
end
|
195
206
|
end
|
196
207
|
|
data/lib/sdn/client.rb
CHANGED
data/lib/sdn/message.rb
CHANGED
@@ -111,6 +111,7 @@ module SDN
|
|
111
111
|
def inspect
|
112
112
|
"#<%s @node_type=%s, @ack_requested=%s, @src=%s, @dest=%s%s>" % [self.class.name, node_type_to_string(node_type), ack_requested, print_address(src), print_address(dest), class_inspect]
|
113
113
|
end
|
114
|
+
alias_method :to_s, :inspect
|
114
115
|
|
115
116
|
def class_inspect
|
116
117
|
ivars = instance_variables - [:@node_type, :@ack_requested, :@src, :@dest, :@params]
|
data/lib/sdn/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: somfy_sdn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cody Cutrer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mqtt-ccutrer
|
@@ -157,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
157
|
- !ruby/object:Gem::Version
|
158
158
|
version: '0'
|
159
159
|
requirements: []
|
160
|
-
rubygems_version: 3.
|
160
|
+
rubygems_version: 3.3.7
|
161
161
|
signing_key:
|
162
162
|
specification_version: 4
|
163
163
|
summary: Library for communication with Somfy SDN RS-485 motorized shades
|