dji_mqtt_connect 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/dji_mqtt_connect/client.rb +5 -0
- data/lib/dji_mqtt_connect/messages/thing/product/storage_config_get_requests_reply_message.rb +1 -1
- data/lib/dji_mqtt_connect/topics/thing/product/events.rb +21 -0
- data/lib/dji_mqtt_connect/version.rb +1 -1
- data/lib/dji_mqtt_connect.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e40cb40801a11ebd25bc5ae79c3b6b332c879cb1ddb026e5e2a4cf8c48415564
|
4
|
+
data.tar.gz: b0629c19cbc9a6e3c7378727c0fa1a0253c42def15ac0ff0602c64ea8d071357
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bc46c0f8448ae3d551c7bc99f74e432e5a253a6686aff92a7e4798867ff801bcbff895675813646a3fbf727a1d8db93c82e30613eaef14f4d8bf1c0d834624b
|
7
|
+
data.tar.gz: a91a113aa29a75f636704b2266dff13e10a2e7daeb0e1fe1f3ee4951a8cdf85b255fe88502534fe28e98a512751f6d00731f11ef029311a8281a55427c9557e5
|
data/Gemfile.lock
CHANGED
@@ -41,6 +41,11 @@ module DjiMqttConnect
|
|
41
41
|
Sys::Product::StatusReplyTopicRepository.new(self)
|
42
42
|
end
|
43
43
|
|
44
|
+
# Handles topic thing/product/#{pid}/events
|
45
|
+
def thing_product_events_topic
|
46
|
+
Thing::Product::EventsTopicRepository.new(self)
|
47
|
+
end
|
48
|
+
|
44
49
|
# Handles topic thing/product/#{pid}/osd
|
45
50
|
def thing_product_osd_topic
|
46
51
|
Thing::Product::OsdTopicRepository.new(self)
|
data/lib/dji_mqtt_connect/messages/thing/product/storage_config_get_requests_reply_message.rb
CHANGED
@@ -30,7 +30,7 @@ module DjiMqttConnect
|
|
30
30
|
attribute :credentials do
|
31
31
|
attribute :access_key_id, Types::String
|
32
32
|
attribute :access_key_secret, Types::String
|
33
|
-
attribute :expire, Types::Integer
|
33
|
+
attribute :expire, Types::Integer.constrained(gt: 0)
|
34
34
|
attribute :security_token, Types::String
|
35
35
|
end
|
36
36
|
attribute :endpoint, Types::String
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DjiMqttConnect
|
4
|
+
module Thing::Product
|
5
|
+
class EventsTopicRepository < TopicRepository
|
6
|
+
EVENTS_TOPIC_REGEX = /\Athing\/product\/(?<device_sn>.+)\/events\z/
|
7
|
+
|
8
|
+
def listen!
|
9
|
+
listen_to_topic("thing/product/+/events") do |topic, raw_message|
|
10
|
+
logger.debug(raw_message)
|
11
|
+
|
12
|
+
matched_topic = EVENTS_TOPIC_REGEX.match(topic)
|
13
|
+
raise Error, "Unknown topic: #{topic}" unless matched_topic
|
14
|
+
|
15
|
+
# Everything is Unsupported
|
16
|
+
broadcast(:unsupported_message, topic, raw_message)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/dji_mqtt_connect.rb
CHANGED
@@ -50,6 +50,7 @@ module DjiMqttConnect
|
|
50
50
|
autoload :StorageConfigGetRequestsReplyMessage, "dji_mqtt_connect/messages/thing/product/storage_config_get_requests_reply_message"
|
51
51
|
|
52
52
|
# Topics
|
53
|
+
autoload :EventsTopicRepository, "dji_mqtt_connect/topics/thing/product/events"
|
53
54
|
autoload :OsdTopicRepository, "dji_mqtt_connect/topics/thing/product/osd"
|
54
55
|
autoload :RequestsTopicRepository, "dji_mqtt_connect/topics/thing/product/requests"
|
55
56
|
autoload :RequestsReplyTopicRepository, "dji_mqtt_connect/topics/thing/product/requests_reply"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dji_mqtt_connect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sphere Drones
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-05-
|
11
|
+
date: 2023-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -139,6 +139,7 @@ files:
|
|
139
139
|
- lib/dji_mqtt_connect/topic_repository.rb
|
140
140
|
- lib/dji_mqtt_connect/topics/sys/product/status.rb
|
141
141
|
- lib/dji_mqtt_connect/topics/sys/product/status_reply.rb
|
142
|
+
- lib/dji_mqtt_connect/topics/thing/product/events.rb
|
142
143
|
- lib/dji_mqtt_connect/topics/thing/product/osd.rb
|
143
144
|
- lib/dji_mqtt_connect/topics/thing/product/requests.rb
|
144
145
|
- lib/dji_mqtt_connect/topics/thing/product/requests_reply.rb
|