somfy_sdn 1.0.0 → 1.0.1
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 +4 -4
- data/lib/sdn/mqtt_bridge.rb +5 -4
- data/lib/sdn/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4380614e85e00d1e41bd28809bbc2b1dc698f73cb1d5cb78f84c3e7a359674fc
|
4
|
+
data.tar.gz: 87b3291290d811ccb52e20f4a0b773bd30dcab410a6421a4514f1494b9244487
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 764b92020f3f77d99d23cbf4f376ea7c66104562eafa613655cbc8e0edcd4a2d276d1666925e96e2291765dd256f070ec5df6d10876f62bbffa94b52134dfbcd
|
7
|
+
data.tar.gz: 46ebafb6663046bccb107083df5b88dc5046a997972aa66bb5a4360f4ef21a4dcab462522c7826d4de0d0061c9caea056e1229e45bad374f4f6e7c5f0ef5980a
|
data/lib/sdn/mqtt_bridge.rb
CHANGED
@@ -108,8 +108,8 @@ module SDN
|
|
108
108
|
next unless message
|
109
109
|
src = SDN::Message.print_address(message.src)
|
110
110
|
# ignore the UAI Plus and ourselves
|
111
|
-
if src != '7F.7F.7F' && !SDN::Message::is_group_address?(message.src) && !(motor = @motors[src])
|
112
|
-
motor = publish_motor(src)
|
111
|
+
if src != '7F.7F.7F' && !SDN::Message::is_group_address?(message.src) && !(motor = @motors[src.gsub('.', '')])
|
112
|
+
motor = publish_motor(src.gsub('.', ''))
|
113
113
|
puts "found new motor #{src}"
|
114
114
|
end
|
115
115
|
|
@@ -173,7 +173,7 @@ module SDN
|
|
173
173
|
if topic == "#{@base_topic}/discovery/discover/set" && value == "true"
|
174
174
|
# trigger discovery
|
175
175
|
@write_queue.push(SDN::Message::GetNodeAddr.new)
|
176
|
-
elsif (match = topic.match(%r{^#{Regexp.escape(@base_topic)}/(?<addr>\h{
|
176
|
+
elsif (match = topic.match(%r{^#{Regexp.escape(@base_topic)}/(?<addr>\h{6})/(?<property>label|down|up|stop|positionpulses|positionpercent|ip|wink|reset|(?<speed_type>upspeed|downspeed|slowspeed)|uplimit|downlimit|direction|ip(?<ip>\d+)(?<ip_type>pulses|percent)|groups)/set$}))
|
177
177
|
addr = SDN::Message.parse_address(match[:addr])
|
178
178
|
property = match[:property]
|
179
179
|
# not homie compliant; allows linking the positionpercent property
|
@@ -182,7 +182,7 @@ module SDN
|
|
182
182
|
property = value.downcase
|
183
183
|
value = "true"
|
184
184
|
end
|
185
|
-
motor = @motors[SDN::Message.print_address(addr)]
|
185
|
+
motor = @motors[SDN::Message.print_address(addr).gsub('.', '')]
|
186
186
|
is_group = SDN::Message.is_group_address?(addr)
|
187
187
|
follow_up = SDN::Message::GetMotorStatus.new(addr)
|
188
188
|
message = case property
|
@@ -444,6 +444,7 @@ module SDN
|
|
444
444
|
end
|
445
445
|
|
446
446
|
def add_group(addr)
|
447
|
+
addr = addr.gsub('.', '')
|
447
448
|
return if @groups.include?(addr)
|
448
449
|
|
449
450
|
publish("#{addr}/$name", addr)
|
data/lib/sdn/version.rb
CHANGED