somfy_sdn 2.1.0 → 2.1.1
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/mqtt.rb +5 -5
- data/lib/sdn/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f8d93160104d744a82adfb79c64b761579252ddf02588b1c4c1f5e142dfebe7
|
4
|
+
data.tar.gz: 3732d50f4d6519687d4ddd79d31349b5b92fb5e8285880edae390c97e46b95ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c81c0299d1d20ead99c74662c78db101d627a9c17273639acdd8e3cc8a2ee11b1df4529899a2185ea088a91939375c7eef7257eb30b54e6ea4d3da7c20621d5
|
7
|
+
data.tar.gz: e843958e8465ca24b39b589d672481eee4ec9acba3d1bb43778129ee7646b496f7086a74d373ed21b1fd250b19d3457728ba2477094b10c12a689a837850931b
|
data/lib/sdn/cli/mqtt.rb
CHANGED
@@ -25,7 +25,7 @@ module SDN
|
|
25
25
|
def initialize(port, mqtt_uri, device_id: "somfy", base_topic: "homie", auto_discover: true)
|
26
26
|
@base_topic = "#{base_topic}/#{device_id}"
|
27
27
|
@mqtt = ::MQTT::Client.new(mqtt_uri)
|
28
|
-
@mqtt.set_will("#{@base_topic}/$state", "lost", true)
|
28
|
+
@mqtt.set_will("#{@base_topic}/$state", "lost", retain: true)
|
29
29
|
@mqtt.connect
|
30
30
|
|
31
31
|
@motors = {}
|
@@ -47,7 +47,7 @@ module SDN
|
|
47
47
|
|
48
48
|
read_thread = Thread.new { read }
|
49
49
|
write_thread = Thread.new { write }
|
50
|
-
@mqtt.get { |
|
50
|
+
@mqtt.get { |packet| handle_message(packet.topic, packet.payload) }
|
51
51
|
end
|
52
52
|
|
53
53
|
def publish(topic, value)
|
@@ -72,14 +72,14 @@ module SDN
|
|
72
72
|
@mqtt.subscribe("#{topic}/#")
|
73
73
|
@mqtt.unsubscribe("#{topic}/#", wait_for_ack: true)
|
74
74
|
while !@mqtt.queue_empty?
|
75
|
-
|
76
|
-
@mqtt.publish(topic, nil, retain: true)
|
75
|
+
packet = @mqtt.get
|
76
|
+
@mqtt.publish(packet.topic, nil, retain: true)
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
80
|
def publish_basic_attributes
|
81
81
|
@mqtt.batch_publish do
|
82
|
-
publish("$homie", "
|
82
|
+
publish("$homie", "4.0.0")
|
83
83
|
publish("$name", "Somfy SDN Network")
|
84
84
|
publish("$state", "init")
|
85
85
|
publish("$nodes", "FFFFFF")
|
data/lib/sdn/version.rb
CHANGED
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
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.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cody Cutrer
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: ccutrer
|
14
|
+
name: mqtt-ccutrer
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
@@ -108,7 +108,7 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '13.0'
|
111
|
-
description:
|
111
|
+
description:
|
112
112
|
email: cody@cutrer.com'
|
113
113
|
executables:
|
114
114
|
- somfy_sdn
|
@@ -142,7 +142,7 @@ homepage: https://github.com/ccutrer/somfy_sdn
|
|
142
142
|
licenses:
|
143
143
|
- MIT
|
144
144
|
metadata: {}
|
145
|
-
post_install_message:
|
145
|
+
post_install_message:
|
146
146
|
rdoc_options: []
|
147
147
|
require_paths:
|
148
148
|
- lib
|
@@ -157,8 +157,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
157
|
- !ruby/object:Gem::Version
|
158
158
|
version: '0'
|
159
159
|
requirements: []
|
160
|
-
rubygems_version: 3.1.
|
161
|
-
signing_key:
|
160
|
+
rubygems_version: 3.1.2
|
161
|
+
signing_key:
|
162
162
|
specification_version: 4
|
163
163
|
summary: Library for communication with Somfy SDN RS-485 motorized shades
|
164
164
|
test_files: []
|