somfy_sdn 2.2.0 → 2.2.2

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: a00033a8ac556f5b578c6d13b678b54393376c1f0439340dbd4afbd4a2376714
4
- data.tar.gz: 1925c30fa53a68f0eb388b0ff277a00a0ae40bf2798a93ba8e9b955139b2c989
3
+ metadata.gz: 376921afa9659381b31f588319c02f35f3d539052e8eb6375b311420bcdac60e
4
+ data.tar.gz: 8c8f5644816c615d0f31dec41e615a1d5857c1f1ee94e45d83bc759616c30e04
5
5
  SHA512:
6
- metadata.gz: ce9dc75cac82bd65e4fd89908f6e6563761c5171c8dc93ab5b0e40fbe0ce0e0bb1dad7d90ef88470d90a050e7893fb1a35edb589ef2881886bf451d5962a6599
7
- data.tar.gz: b82d6d1d60509009c7ea7b7501bd9790ae16f295185cdd5c125e10754e3a96ab9ef9d8956da8d4af554f88390eb4faea2eb4bfb7d0bb7e71248c23e043bc0338
6
+ metadata.gz: 84de94b508cc42c76bab56b3a02ba61cd389277463583353c67df5798a710016e143b4607367be71db35efa052949c146476a591ef4d8a08f54a99e76833e907
7
+ data.tar.gz: 2319f36c605560ebccc80e64600a26f2fec4abb806d33bb041bb0f667c41de1f6facecf8bd93b0ec557a676b34474393c1b4fa807a3cfcc84adbbae9244e0ccc
data/exe/somfy_sdn CHANGED
@@ -3,6 +3,7 @@
3
3
 
4
4
  require "somfy_sdn"
5
5
  require "thor"
6
+ require "uri"
6
7
 
7
8
  class SomfySDNCLI < Thor
8
9
  class_option :verbose, type: :boolean, default: false, desc: "Log protocol messages"
@@ -60,7 +61,7 @@ class SomfySDNCLI < Thor
60
61
 
61
62
  def handle_global_options(port)
62
63
  SDN.logger = Logger.new(options[:log]) if options[:log]
63
- SDN.logger.level = options[:verbose] || options[:trace] ? :debug : :info
64
+ SDN.logger.level = (options[:verbose] || options[:trace]) ? :debug : :info
64
65
 
65
66
  SDN::Client.new(port).tap { |sdn| sdn.trace = options[:trace] }
66
67
  end
@@ -59,7 +59,7 @@ module SDN
59
59
  case value
60
60
  when "up", "down"
61
61
  ((motor&.node_type == :st50ilt2) ? ns::SetMotorPosition : Message::MoveTo)
62
- .new(addr, "#{value}_limit".to_sym)
62
+ .new(addr, :"#{value}_limit")
63
63
  when "stop"
64
64
  if motor&.node_type == :st50ilt2
65
65
  ns::SetMotorPosition.new(addr,
@@ -89,7 +89,7 @@ module SDN
89
89
  when /jog-(?:pulses|ms)/
90
90
  value = value.to_i
91
91
  ((motor&.node_type == :st50ilt2) ? ns::SetMotorPosition : Message::MoveOf)
92
- .new(addr, "jog_#{value.negative? ? :up : :down}_#{match[:jog_type]}".to_sym, value.abs)
92
+ .new(addr, :"jog_#{value.negative? ? :up : :down}_#{match[:jog_type]}", value.abs)
93
93
  when "reset"
94
94
  return unless Message::SetFactoryDefault::RESET.key?(value.to_sym)
95
95
 
data/lib/sdn/cli/mqtt.rb CHANGED
@@ -311,8 +311,8 @@ module SDN
311
311
  # message priorities are:
312
312
  # 0 - control
313
313
  # 1 - follow-up (i.e. get position after control)
314
- # 2 - get basic motor info
315
- # 3 - get advanced motor info
314
+ # 2 - get motor limits
315
+ # 3 - get motor info
316
316
  # 4 - get group 1
317
317
  # 5 - get ip 1
318
318
  # 6 - get group 2
@@ -323,24 +323,27 @@ module SDN
323
323
  # The Group and IP sorting makes it so you quickly get the most commonly used group
324
324
  # and IP addresses, while the almost-never-used ones are pushed to the bottom of the list
325
325
 
326
- @queue.push(MessageAndRetries.new(Message::GetNodeLabel.new(sdn_addr), 5, 2))
326
+ @queue.push(MessageAndRetries.new(Message::GetNodeLabel.new(sdn_addr), 5, 3))
327
327
 
328
328
  case node_type
329
329
  when :st30, 0x20 # no idea why 0x20, but that's what I get
330
- @queue.push(MessageAndRetries.new(Message::GetMotorStatus.new(sdn_addr), 5, 2))
331
330
  @queue.push(MessageAndRetries.new(Message::GetMotorLimits.new(sdn_addr), 5, 2))
331
+ @queue.push(MessageAndRetries.new(Message::GetMotorStatus.new(sdn_addr), 5, 3))
332
332
  @queue.push(MessageAndRetries.new(Message::GetMotorDirection.new(sdn_addr), 5, 3))
333
333
  @queue.push(MessageAndRetries.new(Message::GetMotorRollingSpeed.new(sdn_addr), 5, 3))
334
- (1..16).each { |ip|
335
- @queue.push(MessageAndRetries.new(Message::GetMotorIP.new(sdn_addr, ip), 5, 2 * ip + 3)) }
334
+ (1..16).each do |ip|
335
+ @queue.push(MessageAndRetries.new(Message::GetMotorIP.new(sdn_addr, ip), 5, (2 * ip) + 3))
336
+ end
336
337
  when :st50ilt2
337
- @queue.push(MessageAndRetries.new(Message::ILT2::GetMotorSettings.new(sdn_addr), 5, 2))
338
338
  @queue.push(MessageAndRetries.new(Message::ILT2::GetMotorPosition.new(sdn_addr), 5, 2))
339
+ @queue.push(MessageAndRetries.new(Message::ILT2::GetMotorSettings.new(sdn_addr), 5, 3))
339
340
  (1..16).each do |ip|
340
- @queue.push(MessageAndRetries.new(Message::ILT2::GetMotorIP.new(sdn_addr, ip), 5, 2 * ip + 3))
341
+ @queue.push(MessageAndRetries.new(Message::ILT2::GetMotorIP.new(sdn_addr, ip), 5, (2 * ip) + 3))
341
342
  end
342
343
  end
343
- (1..16).each { |g| @queue.push(MessageAndRetries.new(Message::GetGroupAddr.new(sdn_addr, g), 5, 2 * g + 2)) }
344
+ (1..16).each do |g|
345
+ @queue.push(MessageAndRetries.new(Message::GetGroupAddr.new(sdn_addr, g), 5, (2 * g) + 2))
346
+ end
344
347
 
345
348
  @cond.signal
346
349
  end
@@ -130,11 +130,7 @@ module SDN
130
130
  end
131
131
  refresh
132
132
  when "l"
133
- if ilt2?
134
- sdn.ensure(Message::ILT2::SetMotorSettings.new(addr, reversed_int, @pos, @pos))
135
- else
136
- sdn.ensure(Message::SetMotorLimits.new(addr, :current_position, :down))
137
- end
133
+ sdn.ensure(Message::ILT2::SetMotorSettings.new(addr, reversed_int, @pos, @pos))
138
134
  refresh
139
135
  when "r"
140
136
  @reversed = !@reversed
data/lib/sdn/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SDN
4
- VERSION = "2.2.0"
4
+ VERSION = "2.2.2"
5
5
  end
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.2.0
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Cutrer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-23 00:00:00.000000000 Z
11
+ date: 2024-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ccutrer-serialport
@@ -81,19 +81,19 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.1'
83
83
  - !ruby/object:Gem::Dependency
84
- name: byebug
84
+ name: debug
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '9.0'
89
+ version: '1.9'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '9.0'
96
+ version: '1.9'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rake
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -187,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
187
  - !ruby/object:Gem::Version
188
188
  version: '0'
189
189
  requirements: []
190
- rubygems_version: 3.3.7
190
+ rubygems_version: 3.5.11
191
191
  signing_key:
192
192
  specification_version: 4
193
193
  summary: Library for communication with Somfy SDN RS-485 motorized shades