dji_mqtt_connect 0.1.35 → 0.1.35.2
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/config/locales/thing_product_events.en.yml +2 -0
- data/config/locales/thing_product_services.en.yml +1 -0
- data/lib/dji_mqtt_connect/factories/events/camera_photo_take_progress.rb +32 -0
- data/lib/dji_mqtt_connect/factories/events/device_format.rb +30 -0
- data/lib/dji_mqtt_connect/factories/services_messages.rb +9 -0
- data/lib/dji_mqtt_connect/factories/services_reply/live_camera_change.rb +18 -0
- data/lib/dji_mqtt_connect/factories.rb +2 -0
- data/lib/dji_mqtt_connect/messages/thing/product/events/camera_photo_take_progress.rb +44 -0
- data/lib/dji_mqtt_connect/messages/thing/product/events/device_format.rb +38 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services/live_camera_change.rb +35 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services_reply/drc_mode_enter.rb +3 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services_reply/drc_mode_exit.rb +3 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services_reply/live_camera_change.rb +9 -0
- data/lib/dji_mqtt_connect/messages/thing/product/state_message.rb +2 -1
- data/lib/dji_mqtt_connect/types.rb +1 -0
- data/lib/dji_mqtt_connect/version.rb +1 -1
- metadata +9 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6b1c329539ef66f69b2aa9fd3ca9c8a115766ac03070a44fb223736218996447
|
|
4
|
+
data.tar.gz: 3e42765a57d9a9e8cbd312583b9fed7f710ec3a32d552a58a72f59c04466faed
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5d705f19afffbe1bf734eb90e5a266d42192608c2700550abdbed685284b7ec1f48c3481c0100ebae02ade40a825ad858307e4f717de6be4dcc19e824fd6facd
|
|
7
|
+
data.tar.gz: 02ec49b14ffde6911c026e94b40061630a769b06155532c35cadcfeb5a8806ac158e05e58e52ece6cc17037eb8d808d090b1f84dd52cd455af9a8008b4706bb5
|
|
@@ -2,12 +2,14 @@ en:
|
|
|
2
2
|
dji_mqtt_connect:
|
|
3
3
|
thing_product_events_summary:
|
|
4
4
|
default: "Received %{method} event: %{result}"
|
|
5
|
+
camera_photo_take_progress: "Photo Capture Progress: %{status} (%{percent}%)"
|
|
5
6
|
charge_close: "Stop Charging: %{status} (%{step_key} %{percent}%)"
|
|
6
7
|
charge_open: "Start Charging: %{status} (%{step_key} %{percent}%)"
|
|
7
8
|
cover_close: "Cover closing: %{status} (%{current_step}/%{total_steps} %{percent}%)"
|
|
8
9
|
cover_force_close: "Force Cover Close: %{status} (%{current_step}/%{total_steps} %{percent}%)"
|
|
9
10
|
cover_open: "Cover opening: %{status} (%{current_step}/%{total_steps} %{percent}%)"
|
|
10
11
|
device_exit_homing_notify: "Device is exiting return to home: %{action} (%{reason})"
|
|
12
|
+
device_format: "Dock Data Formatting: %{status} (%{percent}%)"
|
|
11
13
|
device_reboot: "Rebooting device: %{status} (%{current_step}/%{total_steps} %{percent}%)"
|
|
12
14
|
drone_close: "Aircraft shutdown: %{status} (%{percent}%)"
|
|
13
15
|
drone_open: "Aircraft Power-on: %{status}"
|
|
@@ -13,6 +13,7 @@ en:
|
|
|
13
13
|
flighttask_recovery: "Requesting resume for all Flights"
|
|
14
14
|
flighttask_stop: "Requesting flight stop"
|
|
15
15
|
flighttask_undo: "Requesting cancellation of flights"
|
|
16
|
+
live_camera_change: "Requesting live camera change: Video %{video_id} (Camera Position %{camera_position})"
|
|
16
17
|
live_lens_change: "Requesting live lens change: %{video_type} (Video %{video_id})"
|
|
17
18
|
live_set_quality: "Requesting live quality change: %{video_quality} (Video %{video_id})"
|
|
18
19
|
live_start_push: "Requesting broadcast start: Video %{video_id}"
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Factories::EventsMessages
|
|
5
|
+
def build_thing_product_camera_photo_take_progress_events_message
|
|
6
|
+
message_data = {
|
|
7
|
+
output: {
|
|
8
|
+
ext: {
|
|
9
|
+
camera_mode: 3
|
|
10
|
+
},
|
|
11
|
+
progress: {
|
|
12
|
+
current_step: 0,
|
|
13
|
+
percent: 100
|
|
14
|
+
},
|
|
15
|
+
status: "ok"
|
|
16
|
+
},
|
|
17
|
+
result: 0
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
Thing::Product::CameraPhotoTakeProgressEventsMessage.new(
|
|
21
|
+
bid: Message.generate_bid,
|
|
22
|
+
tid: Message.generate_tid,
|
|
23
|
+
timestamp: Message.current_timestamp,
|
|
24
|
+
gateway: "GATEWAYSN",
|
|
25
|
+
_method: "camera_photo_take_progress",
|
|
26
|
+
need_reply: 1,
|
|
27
|
+
data: message_data,
|
|
28
|
+
_data: message_data
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Factories::EventsMessages
|
|
5
|
+
### Device Format ###
|
|
6
|
+
|
|
7
|
+
def build_thing_product_device_format_events_message
|
|
8
|
+
message_data = {
|
|
9
|
+
result: 0,
|
|
10
|
+
output: {
|
|
11
|
+
status: "in_progress",
|
|
12
|
+
progress: {
|
|
13
|
+
percent: 80,
|
|
14
|
+
step_key: "xxx"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
Thing::Product::DeviceFormatEventsMessage.new(
|
|
20
|
+
bid: Message.generate_bid,
|
|
21
|
+
tid: Message.generate_tid,
|
|
22
|
+
timestamp: Message.current_timestamp,
|
|
23
|
+
_method: "device_format",
|
|
24
|
+
need_reply: 1,
|
|
25
|
+
data: message_data,
|
|
26
|
+
_data: message_data
|
|
27
|
+
)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -189,6 +189,15 @@ module DjiMqttConnect
|
|
|
189
189
|
|
|
190
190
|
### Live Stream (Services Messages) ###
|
|
191
191
|
|
|
192
|
+
def build_thing_product_live_camera_change_services_message
|
|
193
|
+
Thing::Product::LiveCameraChangeServicesMessage.build(
|
|
194
|
+
data: {
|
|
195
|
+
video_id: "1ZNDH1D0010098/165-0-7/normal-0",
|
|
196
|
+
camera_position: 0
|
|
197
|
+
}
|
|
198
|
+
)
|
|
199
|
+
end
|
|
200
|
+
|
|
192
201
|
def build_thing_product_live_lens_change_services_message
|
|
193
202
|
Thing::Product::LiveLensChangeServicesMessage.build(
|
|
194
203
|
data: {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Factories
|
|
5
|
+
def build_thing_product_live_camera_change_services_reply_message
|
|
6
|
+
message_data = {result: 0}
|
|
7
|
+
|
|
8
|
+
Thing::Product::LiveCameraChangeServicesReplyMessage.new(
|
|
9
|
+
bid: Message.generate_bid,
|
|
10
|
+
tid: Message.generate_tid,
|
|
11
|
+
timestamp: Message.current_timestamp,
|
|
12
|
+
_method: "live_camera_change",
|
|
13
|
+
_data: message_data,
|
|
14
|
+
data: message_data
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Thing::Product
|
|
5
|
+
# Persistent progress updates for camera_photo_take (e.g. panorama or other persistent photo capturing).
|
|
6
|
+
# https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock3/drc.html#upload-capture-progress
|
|
7
|
+
class CameraPhotoTakeProgressEventsMessage < EventsMessage
|
|
8
|
+
attribute :_method, Types::String.enum("camera_photo_take_progress")
|
|
9
|
+
|
|
10
|
+
attribute :data do
|
|
11
|
+
attribute :result, Types::ResultCode
|
|
12
|
+
include Mixins::ResultCode
|
|
13
|
+
|
|
14
|
+
attribute :output do
|
|
15
|
+
attribute :status, Types::ServicesOutputStatus
|
|
16
|
+
|
|
17
|
+
def humanized_status
|
|
18
|
+
I18n.t(status, scope: "dji_mqtt_connect.services_output_status", default: status.titleize)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
attribute :progress do
|
|
22
|
+
# {"3000":"Panorama photo capturing is not start or is finished","3002":"Panorama photo is capturing","3005":"Panorama photo is synthesizing"}
|
|
23
|
+
# NOTE: not enum-constrained, real messages have been observed with current_step: 0, which isn't a documented value
|
|
24
|
+
attribute :current_step, Types::Integer
|
|
25
|
+
|
|
26
|
+
attribute :percent, Types::Integer.constrained(gteq: 0, lteq: 100)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
attribute? :ext do
|
|
30
|
+
# {"0":"Capturing","1":"Recording","2":"Smart Low-Light","3":"Panorama","-1":"Unsupported mode","4":"Timed Shot"}
|
|
31
|
+
attribute? :camera_mode, Types::CameraMode
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def humanized_summary_interpolation
|
|
37
|
+
super.merge(
|
|
38
|
+
status: data.output.humanized_status,
|
|
39
|
+
percent: data.output.progress.percent
|
|
40
|
+
)
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Thing::Product
|
|
5
|
+
# Dock Data Formatting Progress
|
|
6
|
+
# https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock3/cmd.html#dock-data-formatting-progress
|
|
7
|
+
class DeviceFormatEventsMessage < EventsMessage
|
|
8
|
+
attribute :_method, Types::String.enum("device_format")
|
|
9
|
+
|
|
10
|
+
attribute :data do
|
|
11
|
+
attribute :result, Types::ResultCode
|
|
12
|
+
include Mixins::ResultCode
|
|
13
|
+
|
|
14
|
+
attribute :output do
|
|
15
|
+
# {"sent":"sent","in_progress":"in progress","ok":"success","paused":"paused","rejected":"rejected","failed":"failed","canceled":"canceled or stopped","timeout":"timeout"}
|
|
16
|
+
attribute :status, Types::ServicesOutputStatus
|
|
17
|
+
include Mixins::ServicesOutputStatus
|
|
18
|
+
|
|
19
|
+
attribute :progress do
|
|
20
|
+
# {"min":"0","max":"100","step":"1"}
|
|
21
|
+
attribute :percent, Types::Integer.constrained(gteq: 0, lteq: 100)
|
|
22
|
+
|
|
23
|
+
# NOTE: step_key isn't in the documented field table for this message, only shown in the
|
|
24
|
+
# example payload with a placeholder value ("xxx"), so it's not constrained to Types::EventsProgressStepKey
|
|
25
|
+
attribute? :step_key, Types::String
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def humanized_summary_interpolation
|
|
31
|
+
super.merge(
|
|
32
|
+
status: data.output.humanized_status,
|
|
33
|
+
percent: data.output.progress.percent
|
|
34
|
+
)
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Thing::Product
|
|
5
|
+
# Switch live streaming camera
|
|
6
|
+
# https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock3/live.html#switch-live-streaming-camera
|
|
7
|
+
class LiveCameraChangeServicesMessage < ServicesMessage
|
|
8
|
+
def self.build(data:, bid: generate_bid, tid: generate_tid, timestamp: current_timestamp)
|
|
9
|
+
new(
|
|
10
|
+
bid: bid,
|
|
11
|
+
tid: tid,
|
|
12
|
+
data: data,
|
|
13
|
+
timestamp: timestamp,
|
|
14
|
+
_method: "live_camera_change"
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
CAMERA_POSITION_INSIDE_DOCK = 0
|
|
19
|
+
CAMERA_POSITION_OUTSIDE_DOCK = 1
|
|
20
|
+
|
|
21
|
+
attribute :_method, Types::String.enum("live_camera_change")
|
|
22
|
+
|
|
23
|
+
attribute :data do
|
|
24
|
+
# Formatted as {sn}/{camera_index}/{video_index}
|
|
25
|
+
attribute :video_id, Types::String
|
|
26
|
+
|
|
27
|
+
# {"0":"Inside the dock","1":"Outside the dock"}
|
|
28
|
+
attribute :camera_position, Types::Integer.enum(
|
|
29
|
+
CAMERA_POSITION_INSIDE_DOCK,
|
|
30
|
+
CAMERA_POSITION_OUTSIDE_DOCK
|
|
31
|
+
)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -5,6 +5,9 @@ module DjiMqttConnect
|
|
|
5
5
|
class DrcModeEnterServicesReplyMessage < ServicesReplyMessage
|
|
6
6
|
attribute :_method, Types::String.enum("drc_mode_enter")
|
|
7
7
|
|
|
8
|
+
# NOTE: DJI sometimes omits the timestamp for a drc_mode_enter services reply message
|
|
9
|
+
attribute? :timestamp, Types::TimestampMS
|
|
10
|
+
|
|
8
11
|
attribute :data do
|
|
9
12
|
attribute :result, Types::ResultCode
|
|
10
13
|
include Mixins::ResultCode
|
|
@@ -5,6 +5,9 @@ module DjiMqttConnect
|
|
|
5
5
|
class DrcModeExitServicesReplyMessage < ServicesReplyMessage
|
|
6
6
|
attribute :_method, Types::String.enum("drc_mode_exit")
|
|
7
7
|
|
|
8
|
+
# NOTE: DJI sometimes omits the timestamp for a drc_mode_exit services reply message
|
|
9
|
+
attribute? :timestamp, Types::TimestampMS
|
|
10
|
+
|
|
8
11
|
attribute :data do
|
|
9
12
|
attribute :result, Types::ResultCode
|
|
10
13
|
include Mixins::ResultCode
|
|
@@ -177,7 +177,8 @@ module DjiMqttConnect
|
|
|
177
177
|
attribute :available_video_number, Types::Integer
|
|
178
178
|
attribute :coexist_video_number_max, Types::Integer
|
|
179
179
|
attribute :device_list, Types::Array do
|
|
180
|
-
|
|
180
|
+
# NOTE: DJI sometimes sends a blank serial number for a device
|
|
181
|
+
attribute :sn, Types::SerialNumber | Types::Nil
|
|
181
182
|
attribute :available_video_number, Types::Integer
|
|
182
183
|
attribute :coexist_video_number_max, Types::Integer
|
|
183
184
|
attribute :camera_list, Types::Array do
|
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.35
|
|
4
|
+
version: 0.1.35.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sphere Drones
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-08-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -139,11 +139,13 @@ files:
|
|
|
139
139
|
- lib/dji_mqtt_connect/client.rb
|
|
140
140
|
- lib/dji_mqtt_connect/error.rb
|
|
141
141
|
- lib/dji_mqtt_connect/factories.rb
|
|
142
|
+
- lib/dji_mqtt_connect/factories/events/camera_photo_take_progress.rb
|
|
142
143
|
- lib/dji_mqtt_connect/factories/events/charge_close.rb
|
|
143
144
|
- lib/dji_mqtt_connect/factories/events/charge_open.rb
|
|
144
145
|
- lib/dji_mqtt_connect/factories/events/cover_close.rb
|
|
145
146
|
- lib/dji_mqtt_connect/factories/events/cover_force_close.rb
|
|
146
147
|
- lib/dji_mqtt_connect/factories/events/cover_open.rb
|
|
148
|
+
- lib/dji_mqtt_connect/factories/events/device_format.rb
|
|
147
149
|
- lib/dji_mqtt_connect/factories/events/obstacle_avoidance_notify.rb
|
|
148
150
|
- lib/dji_mqtt_connect/factories/events/ota_progress.rb
|
|
149
151
|
- lib/dji_mqtt_connect/factories/events_messages.rb
|
|
@@ -181,6 +183,7 @@ files:
|
|
|
181
183
|
- lib/dji_mqtt_connect/factories/services/photo_storage_set.rb
|
|
182
184
|
- lib/dji_mqtt_connect/factories/services/video_storage_set.rb
|
|
183
185
|
- lib/dji_mqtt_connect/factories/services_messages.rb
|
|
186
|
+
- lib/dji_mqtt_connect/factories/services_reply/live_camera_change.rb
|
|
184
187
|
- lib/dji_mqtt_connect/factories/state_messages.rb
|
|
185
188
|
- lib/dji_mqtt_connect/marshals/sys/product/status_marshal.rb
|
|
186
189
|
- lib/dji_mqtt_connect/marshals/sys/product/status_reply_marshal.rb
|
|
@@ -200,12 +203,14 @@ files:
|
|
|
200
203
|
- lib/dji_mqtt_connect/messages/sys/product/status_reply/update_topo.rb
|
|
201
204
|
- lib/dji_mqtt_connect/messages/sys/product/status_reply_message.rb
|
|
202
205
|
- lib/dji_mqtt_connect/messages/thing/product/events/airsense_warning.rb
|
|
206
|
+
- lib/dji_mqtt_connect/messages/thing/product/events/camera_photo_take_progress.rb
|
|
203
207
|
- lib/dji_mqtt_connect/messages/thing/product/events/charge_close.rb
|
|
204
208
|
- lib/dji_mqtt_connect/messages/thing/product/events/charge_open.rb
|
|
205
209
|
- lib/dji_mqtt_connect/messages/thing/product/events/cover_close.rb
|
|
206
210
|
- lib/dji_mqtt_connect/messages/thing/product/events/cover_force_close.rb
|
|
207
211
|
- lib/dji_mqtt_connect/messages/thing/product/events/cover_open.rb
|
|
208
212
|
- lib/dji_mqtt_connect/messages/thing/product/events/device_exit_homing_notify.rb
|
|
213
|
+
- lib/dji_mqtt_connect/messages/thing/product/events/device_format.rb
|
|
209
214
|
- lib/dji_mqtt_connect/messages/thing/product/events/device_log.rb
|
|
210
215
|
- lib/dji_mqtt_connect/messages/thing/product/events/device_reboot.rb
|
|
211
216
|
- lib/dji_mqtt_connect/messages/thing/product/events/drone_close.rb
|
|
@@ -301,6 +306,7 @@ files:
|
|
|
301
306
|
- lib/dji_mqtt_connect/messages/thing/product/services/ir_metering_area_set.rb
|
|
302
307
|
- lib/dji_mqtt_connect/messages/thing/product/services/ir_metering_mode_set.rb
|
|
303
308
|
- lib/dji_mqtt_connect/messages/thing/product/services/ir_metering_point_set.rb
|
|
309
|
+
- lib/dji_mqtt_connect/messages/thing/product/services/live_camera_change.rb
|
|
304
310
|
- lib/dji_mqtt_connect/messages/thing/product/services/live_lens_change.rb
|
|
305
311
|
- lib/dji_mqtt_connect/messages/thing/product/services/live_set_quality.rb
|
|
306
312
|
- lib/dji_mqtt_connect/messages/thing/product/services/live_start_push.rb
|
|
@@ -357,6 +363,7 @@ files:
|
|
|
357
363
|
- lib/dji_mqtt_connect/messages/thing/product/services_reply/ir_metering_area_set.rb
|
|
358
364
|
- lib/dji_mqtt_connect/messages/thing/product/services_reply/ir_metering_mode_set.rb
|
|
359
365
|
- lib/dji_mqtt_connect/messages/thing/product/services_reply/ir_metering_point_set.rb
|
|
366
|
+
- lib/dji_mqtt_connect/messages/thing/product/services_reply/live_camera_change.rb
|
|
360
367
|
- lib/dji_mqtt_connect/messages/thing/product/services_reply/live_lens_change.rb
|
|
361
368
|
- lib/dji_mqtt_connect/messages/thing/product/services_reply/live_set_quality.rb
|
|
362
369
|
- lib/dji_mqtt_connect/messages/thing/product/services_reply/live_start_push.rb
|