somfy_sdn 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 43e93c1bd91289025342d8fb230e4fc961a04001eb8a607a0114cf40c92459f3
4
- data.tar.gz: 1f29a53d8e8f697b0b6933439d42d154e439992567abdcf6f216aa5d3e7dfed3
3
+ metadata.gz: 4380614e85e00d1e41bd28809bbc2b1dc698f73cb1d5cb78f84c3e7a359674fc
4
+ data.tar.gz: 87b3291290d811ccb52e20f4a0b773bd30dcab410a6421a4514f1494b9244487
5
5
  SHA512:
6
- metadata.gz: 13a0bb6280317801ea68d5a87e1fc2105f01fb6f44423cd4e7a9f553c04d2fb8a5d2009ae663b9f46889e7955c3eec6200330ba51abbd0005b4512b00b4041ca
7
- data.tar.gz: e6bb95d108574b3ef836630721a22bf514a93d17470c6f25ecced7519c3cf646c6129121413e7f263d044b41a275f86f8ebc3050e83866b6b2e278ebc0df491e
6
+ metadata.gz: 764b92020f3f77d99d23cbf4f376ea7c66104562eafa613655cbc8e0edcd4a2d276d1666925e96e2291765dd256f070ec5df6d10876f62bbffa94b52134dfbcd
7
+ data.tar.gz: 46ebafb6663046bccb107083df5b88dc5046a997972aa66bb5a4360f4ef21a4dcab462522c7826d4de0d0061c9caea056e1229e45bad374f4f6e7c5f0ef5980a
@@ -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{2}\.\h{2}\.\h{2})/(?<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$}))
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
@@ -1,3 +1,3 @@
1
1
  module SDN
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: somfy_sdn
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Cutrer