dji_mqtt_connect 0.1.35.1 → 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 +1 -0
- data/config/locales/thing_product_services.en.yml +1 -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/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 +6 -1
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
|
|
@@ -9,6 +9,7 @@ en:
|
|
|
9
9
|
cover_force_close: "Force Cover Close: %{status} (%{current_step}/%{total_steps} %{percent}%)"
|
|
10
10
|
cover_open: "Cover opening: %{status} (%{current_step}/%{total_steps} %{percent}%)"
|
|
11
11
|
device_exit_homing_notify: "Device is exiting return to home: %{action} (%{reason})"
|
|
12
|
+
device_format: "Dock Data Formatting: %{status} (%{percent}%)"
|
|
12
13
|
device_reboot: "Rebooting device: %{status} (%{current_step}/%{total_steps} %{percent}%)"
|
|
13
14
|
drone_close: "Aircraft shutdown: %{status} (%{percent}%)"
|
|
14
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,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,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,7 +1,7 @@
|
|
|
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
|
|
@@ -145,6 +145,7 @@ files:
|
|
|
145
145
|
- lib/dji_mqtt_connect/factories/events/cover_close.rb
|
|
146
146
|
- lib/dji_mqtt_connect/factories/events/cover_force_close.rb
|
|
147
147
|
- lib/dji_mqtt_connect/factories/events/cover_open.rb
|
|
148
|
+
- lib/dji_mqtt_connect/factories/events/device_format.rb
|
|
148
149
|
- lib/dji_mqtt_connect/factories/events/obstacle_avoidance_notify.rb
|
|
149
150
|
- lib/dji_mqtt_connect/factories/events/ota_progress.rb
|
|
150
151
|
- lib/dji_mqtt_connect/factories/events_messages.rb
|
|
@@ -182,6 +183,7 @@ files:
|
|
|
182
183
|
- lib/dji_mqtt_connect/factories/services/photo_storage_set.rb
|
|
183
184
|
- lib/dji_mqtt_connect/factories/services/video_storage_set.rb
|
|
184
185
|
- lib/dji_mqtt_connect/factories/services_messages.rb
|
|
186
|
+
- lib/dji_mqtt_connect/factories/services_reply/live_camera_change.rb
|
|
185
187
|
- lib/dji_mqtt_connect/factories/state_messages.rb
|
|
186
188
|
- lib/dji_mqtt_connect/marshals/sys/product/status_marshal.rb
|
|
187
189
|
- lib/dji_mqtt_connect/marshals/sys/product/status_reply_marshal.rb
|
|
@@ -208,6 +210,7 @@ files:
|
|
|
208
210
|
- lib/dji_mqtt_connect/messages/thing/product/events/cover_force_close.rb
|
|
209
211
|
- lib/dji_mqtt_connect/messages/thing/product/events/cover_open.rb
|
|
210
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
|
|
211
214
|
- lib/dji_mqtt_connect/messages/thing/product/events/device_log.rb
|
|
212
215
|
- lib/dji_mqtt_connect/messages/thing/product/events/device_reboot.rb
|
|
213
216
|
- lib/dji_mqtt_connect/messages/thing/product/events/drone_close.rb
|
|
@@ -303,6 +306,7 @@ files:
|
|
|
303
306
|
- lib/dji_mqtt_connect/messages/thing/product/services/ir_metering_area_set.rb
|
|
304
307
|
- lib/dji_mqtt_connect/messages/thing/product/services/ir_metering_mode_set.rb
|
|
305
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
|
|
306
310
|
- lib/dji_mqtt_connect/messages/thing/product/services/live_lens_change.rb
|
|
307
311
|
- lib/dji_mqtt_connect/messages/thing/product/services/live_set_quality.rb
|
|
308
312
|
- lib/dji_mqtt_connect/messages/thing/product/services/live_start_push.rb
|
|
@@ -359,6 +363,7 @@ files:
|
|
|
359
363
|
- lib/dji_mqtt_connect/messages/thing/product/services_reply/ir_metering_area_set.rb
|
|
360
364
|
- lib/dji_mqtt_connect/messages/thing/product/services_reply/ir_metering_mode_set.rb
|
|
361
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
|
|
362
367
|
- lib/dji_mqtt_connect/messages/thing/product/services_reply/live_lens_change.rb
|
|
363
368
|
- lib/dji_mqtt_connect/messages/thing/product/services_reply/live_set_quality.rb
|
|
364
369
|
- lib/dji_mqtt_connect/messages/thing/product/services_reply/live_start_push.rb
|