dji_mqtt_connect 0.1.32 → 0.1.33
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 +3 -0
- data/lib/dji_mqtt_connect/factories/services/charge_close.rb +29 -0
- data/lib/dji_mqtt_connect/factories/services/charge_open.rb +29 -0
- data/lib/dji_mqtt_connect/factories/services/cover_force_close.rb +29 -0
- data/lib/dji_mqtt_connect/messages/thing/product/events/charge_close.rb +37 -0
- data/lib/dji_mqtt_connect/messages/thing/product/events/charge_open.rb +37 -0
- data/lib/dji_mqtt_connect/messages/thing/product/events/cover_force_close.rb +44 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services/camera_aim.rb +1 -1
- data/lib/dji_mqtt_connect/messages/thing/product/services/camera_exposure_mode_set.rb +1 -1
- data/lib/dji_mqtt_connect/messages/thing/product/services/camera_exposure_set.rb +1 -1
- data/lib/dji_mqtt_connect/messages/thing/product/services/camera_focal_length_set.rb +1 -1
- data/lib/dji_mqtt_connect/messages/thing/product/services/camera_focus_mode_set.rb +1 -1
- data/lib/dji_mqtt_connect/messages/thing/product/services/camera_focus_value_set.rb +1 -1
- data/lib/dji_mqtt_connect/messages/thing/product/services/camera_frame_zoom.rb +1 -1
- data/lib/dji_mqtt_connect/messages/thing/product/services/camera_look_at.rb +1 -1
- data/lib/dji_mqtt_connect/messages/thing/product/services/camera_mode_switch.rb +1 -1
- data/lib/dji_mqtt_connect/messages/thing/product/services/camera_photo_stop.rb +1 -1
- data/lib/dji_mqtt_connect/messages/thing/product/services/camera_photo_take.rb +1 -1
- data/lib/dji_mqtt_connect/messages/thing/product/services/camera_point_focus_action.rb +1 -1
- data/lib/dji_mqtt_connect/messages/thing/product/services/camera_recording_start.rb +1 -1
- data/lib/dji_mqtt_connect/messages/thing/product/services/camera_recording_stop.rb +1 -1
- data/lib/dji_mqtt_connect/messages/thing/product/services/camera_screen_drag.rb +1 -1
- data/lib/dji_mqtt_connect/messages/thing/product/services/camera_screen_split.rb +1 -1
- data/lib/dji_mqtt_connect/messages/thing/product/services/charge_close.rb +19 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services/charge_open.rb +19 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services/cover_force_close.rb +19 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services/gimbal_reset.rb +1 -1
- data/lib/dji_mqtt_connect/messages/thing/product/services/ir_metering_area_set.rb +1 -1
- data/lib/dji_mqtt_connect/messages/thing/product/services/ir_metering_mode_set.rb +1 -1
- data/lib/dji_mqtt_connect/messages/thing/product/services/ir_metering_point_set.rb +1 -1
- data/lib/dji_mqtt_connect/messages/thing/product/services/payload_authority_grab.rb +1 -1
- data/lib/dji_mqtt_connect/messages/thing/product/services/photo_storage_set.rb +1 -1
- data/lib/dji_mqtt_connect/messages/thing/product/services/video_storage_set.rb +1 -1
- data/lib/dji_mqtt_connect/messages/thing/product/services_reply/charge_close.rb +21 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services_reply/charge_open.rb +21 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services_reply/cover_force_close.rb +21 -0
- data/lib/dji_mqtt_connect/messages/thing/product/state_message.rb +40 -7
- data/lib/dji_mqtt_connect/mixins/video_type.rb +4 -0
- data/lib/dji_mqtt_connect/types.rb +1 -3
- data/lib/dji_mqtt_connect/version.rb +1 -1
- metadata +14 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '009be99444640cb4f2bc4cc3df00aa1d2c86c039ed9e16030c3d89cf03b2fb08'
|
|
4
|
+
data.tar.gz: 2aedee3c7efa2500ebf767018c5c6b23a47ea7d934449b14d1e6afe9e32605ac
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 83d2144a295bb3e69bedb2887bc958afce9dee3c581d1a08121b8f4c96218b2d033233bc74b8b27e96b28e381f1726c10f58f8faf0984587a498febd1e08df3a
|
|
7
|
+
data.tar.gz: ad3a962a0d5cd720707995164ddf7ef089a1f6d7965734bbe62c3bebd6cb56a1a1beda09a4c8a88c2b29ec5b2104160797b5e97fc5eb579f0a22a2d01c252c69
|
|
@@ -2,7 +2,10 @@ en:
|
|
|
2
2
|
dji_mqtt_connect:
|
|
3
3
|
thing_product_events_summary:
|
|
4
4
|
default: "Received %{method} event: %{result}"
|
|
5
|
+
charge_close: "Stopping Charging: %{status} (%{step_key} %{percent}%)"
|
|
6
|
+
charge_open: "Starting Charging: %{status} (%{step_key} %{percent}%)"
|
|
5
7
|
cover_close: "Cover closing: %{status} (%{current_step}/%{total_steps} %{percent}%)"
|
|
8
|
+
cover_force_close: "Force Closing Cover: %{status} (%{current_step}/%{total_steps} %{percent}%)"
|
|
6
9
|
cover_open: "Cover opening: %{status} (%{current_step}/%{total_steps} %{percent}%)"
|
|
7
10
|
device_exit_homing_notify: "Device is exiting return to home: %{action} (%{reason})"
|
|
8
11
|
device_reboot: "Rebooting device: %{status} (%{current_step}/%{total_steps} %{percent}%)"
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Factories::ServicesMessages
|
|
5
|
+
### Stop Charging ###
|
|
6
|
+
|
|
7
|
+
def build_thing_product_charge_close_services_message
|
|
8
|
+
Thing::Product::ChargeCloseServicesMessage.build
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def build_thing_product_charge_close_services_reply_message(result: 0)
|
|
12
|
+
message_data = {
|
|
13
|
+
result: result,
|
|
14
|
+
output: {
|
|
15
|
+
status: "ok"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
Thing::Product::ChargeCloseServicesReplyMessage.new(
|
|
20
|
+
bid: SecureRandom.uuid,
|
|
21
|
+
tid: SecureRandom.uuid,
|
|
22
|
+
timestamp: Message.current_timestamp,
|
|
23
|
+
_method: "charge_close",
|
|
24
|
+
_data: message_data,
|
|
25
|
+
data: message_data
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Factories::ServicesMessages
|
|
5
|
+
### Stop Charging ###
|
|
6
|
+
|
|
7
|
+
def build_thing_product_charge_open_services_message
|
|
8
|
+
Thing::Product::ChargeOpenServicesMessage.build
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def build_thing_product_charge_open_services_reply_message(result: 0)
|
|
12
|
+
message_data = {
|
|
13
|
+
result: result,
|
|
14
|
+
output: {
|
|
15
|
+
status: "ok"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
Thing::Product::ChargeOpenServicesReplyMessage.new(
|
|
20
|
+
bid: SecureRandom.uuid,
|
|
21
|
+
tid: SecureRandom.uuid,
|
|
22
|
+
timestamp: Message.current_timestamp,
|
|
23
|
+
_method: "charge_open",
|
|
24
|
+
_data: message_data,
|
|
25
|
+
data: message_data
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Factories::ServicesMessages
|
|
5
|
+
### Force Close ###
|
|
6
|
+
|
|
7
|
+
def build_thing_product_cover_force_close_services_message
|
|
8
|
+
Thing::Product::CoverForceCloseServicesMessage.build
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def build_thing_product_cover_force_close_services_reply_message(result: 0)
|
|
12
|
+
message_data = {
|
|
13
|
+
result: result,
|
|
14
|
+
output: {
|
|
15
|
+
status: "ok"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
Thing::Product::CoverForceCloseServicesReplyMessage.new(
|
|
20
|
+
bid: SecureRandom.uuid,
|
|
21
|
+
tid: SecureRandom.uuid,
|
|
22
|
+
timestamp: Message.current_timestamp,
|
|
23
|
+
_method: "cover_force_close",
|
|
24
|
+
_data: message_data,
|
|
25
|
+
data: message_data
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Thing::Product
|
|
5
|
+
class ChargeCloseEventsMessage < EventsMessage
|
|
6
|
+
attribute :_method, Types::String.enum("charge_close")
|
|
7
|
+
|
|
8
|
+
attribute :data do
|
|
9
|
+
attribute :result, Types::ResultCode
|
|
10
|
+
include Mixins::ResultCode
|
|
11
|
+
|
|
12
|
+
attribute :output do
|
|
13
|
+
# {"sent":"sent","in_progress":"in progress","ok":"success","paused":"paused","rejected":"rejected","failed":"failed","canceled":"canceled or stopped","timeout":"timeout"}
|
|
14
|
+
attribute :status, Types::ServicesOutputStatus
|
|
15
|
+
include Mixins::ServicesOutputStatus
|
|
16
|
+
|
|
17
|
+
attribute :progress do
|
|
18
|
+
# {"min":"0","max":"100","step":"1"}
|
|
19
|
+
attribute :percent, Types::Integer.constrained(gteq: 0, lteq: 100)
|
|
20
|
+
|
|
21
|
+
# {"get_bid":"Get bid","check_work_mode":"Check if the working mode is remote debugging","check_task_state":"Check the exclusion state of debugging mode tasks","stop_charge":"Stop charging"}
|
|
22
|
+
attribute? :step_key, Types::EventsProgressStepKey
|
|
23
|
+
include Mixins::EventsProgressStepKey
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def humanized_summary_interpolation
|
|
29
|
+
super.merge(
|
|
30
|
+
status: data.output.humanized_status,
|
|
31
|
+
percent: data.output.progress.percent,
|
|
32
|
+
step_key: data.output.progress.humanized_step_key || "-"
|
|
33
|
+
)
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Thing::Product
|
|
5
|
+
class ChargeOpenEventsMessage < EventsMessage
|
|
6
|
+
attribute :_method, Types::String.enum("charge_open")
|
|
7
|
+
|
|
8
|
+
attribute :data do
|
|
9
|
+
attribute :result, Types::ResultCode
|
|
10
|
+
include Mixins::ResultCode
|
|
11
|
+
|
|
12
|
+
attribute :output do
|
|
13
|
+
# {"sent":"sent","in_progress":"in progress","ok":"success","paused":"paused","rejected":"rejected","failed":"failed","canceled":"canceled or stopped","timeout":"timeout"}
|
|
14
|
+
attribute :status, Types::ServicesOutputStatus
|
|
15
|
+
include Mixins::ServicesOutputStatus
|
|
16
|
+
|
|
17
|
+
attribute :progress do
|
|
18
|
+
# {"min":"0","max":"100","step":"1"}
|
|
19
|
+
attribute :percent, Types::Integer.constrained(gteq: 0, lteq: 100)
|
|
20
|
+
|
|
21
|
+
# {"get_bid":"Get bid","check_work_mode":"Check if the working mode is remote debugging","check_task_state":"Check the exclusion state of debugging mode tasks","stop_charge":"Stop charging"}
|
|
22
|
+
attribute? :step_key, Types::EventsProgressStepKey
|
|
23
|
+
include Mixins::EventsProgressStepKey
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def humanized_summary_interpolation
|
|
29
|
+
super.merge(
|
|
30
|
+
status: data.output.humanized_status,
|
|
31
|
+
percent: data.output.progress.percent,
|
|
32
|
+
step_key: data.output.progress.humanized_step_key || "-"
|
|
33
|
+
)
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Thing::Product
|
|
5
|
+
class CoverForceCloseEventsMessage < EventsMessage
|
|
6
|
+
attribute :_method, Types::String.enum("cover_force_close")
|
|
7
|
+
|
|
8
|
+
attribute :data do
|
|
9
|
+
attribute :result, Types::ResultCode
|
|
10
|
+
include Mixins::ResultCode
|
|
11
|
+
|
|
12
|
+
attribute :output do
|
|
13
|
+
# {"sent":"sent","in_progress":"in progress","ok":"success","paused":"paused","rejected":"rejected","failed":"failed","canceled":"canceled or stopped","timeout":"timeout"}
|
|
14
|
+
attribute :status, Types::ServicesOutputStatus
|
|
15
|
+
include Mixins::ServicesOutputStatus
|
|
16
|
+
|
|
17
|
+
attribute :progress do
|
|
18
|
+
# {"min":"0","max":"100","step":"1"}
|
|
19
|
+
attribute :percent, Types::Integer.constrained(gteq: 0, lteq: 100)
|
|
20
|
+
|
|
21
|
+
attribute? :current_step, Types::Integer
|
|
22
|
+
|
|
23
|
+
attribute? :total_steps, Types::Integer
|
|
24
|
+
|
|
25
|
+
# {"get_bid":"Get bid","check_work_mode":"Check whether to enter remote debugging mode","check_task_state":"Check if the DJI Dock is free","land_mcu_reboot":"Land MCU reboot","rain_mcu_reboot":"Weather station MCU reboot","core_mcu_reboot":"Central control MCU reboot","sdr_reboot":"SDR reboot","write_reboot_param_file":"Write reboot flag","get_drone_power_state":"Get battery charge state","close_putter":"Close the putter","check_wired_connect_state":"Get aircraft state","open_drone":"Open the plane","open_alarm":"Open sound and light alarm","check_scram_state":"Check if the emergency stop switch is pressed","open_cover":"Open the hatch","check_drone_sdr_connect_state":"Establish SDR wireless connection","turn_on_drone":"Turn the plane on","drone_paddle_forward":"Turn on forward paddle","close_cover":"Close the hatch","drone_paddle_reverse":"Turn on reverse paddle","drone_paddle_stop":"Stop Paddle Rotation","free_putter":"Free Putter","stop_charge":"Stop charging"}
|
|
26
|
+
attribute? :step_key, Types::EventsProgressStepKey
|
|
27
|
+
include Mixins::EventsProgressStepKey
|
|
28
|
+
|
|
29
|
+
attribute? :step_result, Types::Integer
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def humanized_summary_interpolation
|
|
35
|
+
super.merge(
|
|
36
|
+
status: data.output.humanized_status,
|
|
37
|
+
percent: data.output.progress.percent,
|
|
38
|
+
current_step: data.output.progress.current_step || "-",
|
|
39
|
+
total_steps: data.output.progress.total_steps || "-"
|
|
40
|
+
)
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -21,7 +21,7 @@ module DjiMqttConnect
|
|
|
21
21
|
attribute :_method, Types::String.enum("camera_aim")
|
|
22
22
|
|
|
23
23
|
attribute :data do
|
|
24
|
-
attribute :payload_index, Types::
|
|
24
|
+
attribute :payload_index, Types::PayloadIndex
|
|
25
25
|
|
|
26
26
|
# {"ir":"Infrared","wide":"Wide-angle","zoom":"Zoom"}
|
|
27
27
|
attribute :camera_type, Types::String.enum(CAMERA_TYPE_IR, CAMERA_TYPE_WIDE, CAMERA_TYPE_ZOOM)
|
|
@@ -25,7 +25,7 @@ module DjiMqttConnect
|
|
|
25
25
|
attribute :_method, Types::String.enum("camera_exposure_mode_set")
|
|
26
26
|
|
|
27
27
|
attribute :data do
|
|
28
|
-
attribute :payload_index, Types::
|
|
28
|
+
attribute :payload_index, Types::PayloadIndex
|
|
29
29
|
|
|
30
30
|
# {"wide":"Wide-angle","zoom":"Zoom"}
|
|
31
31
|
attribute :camera_type, Types::String.enum(
|
|
@@ -56,7 +56,7 @@ module DjiMqttConnect
|
|
|
56
56
|
attribute :_method, Types::String.enum("camera_exposure_set")
|
|
57
57
|
|
|
58
58
|
attribute :data do
|
|
59
|
-
attribute :payload_index, Types::
|
|
59
|
+
attribute :payload_index, Types::PayloadIndex
|
|
60
60
|
|
|
61
61
|
# {"wide":"Wide-angle","zoom":"Zoom"}
|
|
62
62
|
attribute :camera_type, Types::String.enum(
|
|
@@ -21,7 +21,7 @@ module DjiMqttConnect
|
|
|
21
21
|
attribute :_method, Types::String.enum("camera_focal_length_set")
|
|
22
22
|
|
|
23
23
|
attribute :data do
|
|
24
|
-
attribute :payload_index, Types::
|
|
24
|
+
attribute :payload_index, Types::PayloadIndex
|
|
25
25
|
|
|
26
26
|
# {"ir":"Infrared","wide":"Wide-angle","zoom":"Zoom"}
|
|
27
27
|
attribute :camera_type, Types::String.enum(CAMERA_TYPE_IR, CAMERA_TYPE_WIDE, CAMERA_TYPE_ZOOM)
|
|
@@ -25,7 +25,7 @@ module DjiMqttConnect
|
|
|
25
25
|
attribute :_method, Types::String.enum("camera_focus_mode_set")
|
|
26
26
|
|
|
27
27
|
attribute :data do
|
|
28
|
-
attribute :payload_index, Types::
|
|
28
|
+
attribute :payload_index, Types::PayloadIndex
|
|
29
29
|
|
|
30
30
|
# {"wide":"Wide-angle","zoom":"Zoom"}
|
|
31
31
|
attribute :camera_type, Types::String.enum(
|
|
@@ -20,7 +20,7 @@ module DjiMqttConnect
|
|
|
20
20
|
attribute :_method, Types::String.enum("camera_focus_value_set")
|
|
21
21
|
|
|
22
22
|
attribute :data do
|
|
23
|
-
attribute :payload_index, Types::
|
|
23
|
+
attribute :payload_index, Types::PayloadIndex
|
|
24
24
|
|
|
25
25
|
# {"wide":"Wide-angle","zoom":"Zoom"}
|
|
26
26
|
attribute :camera_type, Types::String.enum(
|
|
@@ -21,7 +21,7 @@ module DjiMqttConnect
|
|
|
21
21
|
attribute :_method, Types::String.enum("camera_frame_zoom")
|
|
22
22
|
|
|
23
23
|
attribute :data do
|
|
24
|
-
attribute :payload_index, Types::
|
|
24
|
+
attribute :payload_index, Types::PayloadIndex
|
|
25
25
|
|
|
26
26
|
# {"ir":"Infrared","wide":"Wide-angle","zoom":"Zoom"}
|
|
27
27
|
attribute :camera_type, Types::String.enum(CAMERA_TYPE_IR, CAMERA_TYPE_WIDE, CAMERA_TYPE_ZOOM)
|
|
@@ -17,7 +17,7 @@ module DjiMqttConnect
|
|
|
17
17
|
attribute :_method, Types::String.enum("camera_look_at")
|
|
18
18
|
|
|
19
19
|
attribute :data do
|
|
20
|
-
attribute :payload_index, Types::
|
|
20
|
+
attribute :payload_index, Types::PayloadIndex
|
|
21
21
|
|
|
22
22
|
# {"false":"Only gimbal turns, the aircraft body does not turn","true":"Lock the aircraft's heading. The gimbal and the aircraft body turn together"}
|
|
23
23
|
attribute :locked, Types::Bool
|
|
@@ -22,7 +22,7 @@ module DjiMqttConnect
|
|
|
22
22
|
attribute :_method, Types::String.enum("camera_mode_switch")
|
|
23
23
|
|
|
24
24
|
attribute :data do
|
|
25
|
-
attribute :payload_index, Types::
|
|
25
|
+
attribute :payload_index, Types::PayloadIndex
|
|
26
26
|
|
|
27
27
|
# {"0":"Capturing","1":"Recording","2":"Smart Low-Light","3":"Panorama"}
|
|
28
28
|
attribute :camera_mode, Types::Integer.enum(
|
|
@@ -20,7 +20,7 @@ module DjiMqttConnect
|
|
|
20
20
|
attribute :_method, Types::String.enum("camera_point_focus_action")
|
|
21
21
|
|
|
22
22
|
attribute :data do
|
|
23
|
-
attribute :payload_index, Types::
|
|
23
|
+
attribute :payload_index, Types::PayloadIndex
|
|
24
24
|
|
|
25
25
|
# {"wide":"Wide-angle","zoom":"Zoom"}
|
|
26
26
|
attribute :camera_type, Types::String.enum(
|
|
@@ -17,7 +17,7 @@ module DjiMqttConnect
|
|
|
17
17
|
attribute :_method, Types::String.enum("camera_screen_drag")
|
|
18
18
|
|
|
19
19
|
attribute :data do
|
|
20
|
-
attribute :payload_index, Types::
|
|
20
|
+
attribute :payload_index, Types::PayloadIndex
|
|
21
21
|
|
|
22
22
|
# {"false":"Only gimbal turns, the aircraft body does not turn","true":"Lock the aircraft's heading. The gimbal and the aircraft body turn together"}
|
|
23
23
|
attribute :locked, Types::Bool
|
|
@@ -17,7 +17,7 @@ module DjiMqttConnect
|
|
|
17
17
|
attribute :_method, Types::String.enum("camera_screen_split")
|
|
18
18
|
|
|
19
19
|
attribute :data do
|
|
20
|
-
attribute :payload_index, Types::
|
|
20
|
+
attribute :payload_index, Types::PayloadIndex
|
|
21
21
|
|
|
22
22
|
# Enable or disable split screen
|
|
23
23
|
attribute :enable, Types::Bool
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Thing::Product
|
|
5
|
+
# https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock3/cmd.html#stop-charging
|
|
6
|
+
class ChargeCloseServicesMessage < ServicesMessage
|
|
7
|
+
def self.build(bid: generate_bid, tid: generate_tid, timestamp: current_timestamp)
|
|
8
|
+
new(
|
|
9
|
+
bid: bid,
|
|
10
|
+
tid: tid,
|
|
11
|
+
timestamp: timestamp,
|
|
12
|
+
_method: "charge_close"
|
|
13
|
+
)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
attribute :_method, Types::String.enum("charge_close")
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Thing::Product
|
|
5
|
+
# https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock3/cmd.html#start-charging
|
|
6
|
+
class ChargeOpenServicesMessage < ServicesMessage
|
|
7
|
+
def self.build(bid: generate_bid, tid: generate_tid, timestamp: current_timestamp)
|
|
8
|
+
new(
|
|
9
|
+
bid: bid,
|
|
10
|
+
tid: tid,
|
|
11
|
+
timestamp: timestamp,
|
|
12
|
+
_method: "charge_open"
|
|
13
|
+
)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
attribute :_method, Types::String.enum("charge_open")
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Thing::Product
|
|
5
|
+
# https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock3/cmd.html#force-close
|
|
6
|
+
class CoverForceCloseServicesMessage < ServicesMessage
|
|
7
|
+
def self.build(bid: generate_bid, tid: generate_tid, timestamp: current_timestamp)
|
|
8
|
+
new(
|
|
9
|
+
bid: bid,
|
|
10
|
+
tid: tid,
|
|
11
|
+
timestamp: timestamp,
|
|
12
|
+
_method: "cover_force_close"
|
|
13
|
+
)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
attribute :_method, Types::String.enum("cover_force_close")
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -22,7 +22,7 @@ module DjiMqttConnect
|
|
|
22
22
|
attribute :_method, Types::String.enum("gimbal_reset")
|
|
23
23
|
|
|
24
24
|
attribute :data do
|
|
25
|
-
attribute :payload_index, Types::
|
|
25
|
+
attribute :payload_index, Types::PayloadIndex
|
|
26
26
|
|
|
27
27
|
# {"0":"Reset","1":"Downward","2":"Gimbal pan recenter","3":"Gimbal pitch downward"}
|
|
28
28
|
attribute :reset_mode, Types::Integer.enum(
|
|
@@ -17,7 +17,7 @@ module DjiMqttConnect
|
|
|
17
17
|
attribute :_method, Types::String.enum("ir_metering_area_set")
|
|
18
18
|
|
|
19
19
|
attribute :data do
|
|
20
|
-
attribute :payload_index, Types::
|
|
20
|
+
attribute :payload_index, Types::PayloadIndex
|
|
21
21
|
|
|
22
22
|
# The left and upper corner of the lens is the coordinate center. The horizontal direction is x.
|
|
23
23
|
# {"max":1,"min":0}
|
|
@@ -22,7 +22,7 @@ module DjiMqttConnect
|
|
|
22
22
|
attribute :_method, Types::String.enum("ir_metering_mode_set")
|
|
23
23
|
|
|
24
24
|
attribute :data do
|
|
25
|
-
attribute :payload_index, Types::
|
|
25
|
+
attribute :payload_index, Types::PayloadIndex
|
|
26
26
|
|
|
27
27
|
# {"0":"Close temperature measurement","1":"Point temperature measurement","2":"Area temperature measurement"}
|
|
28
28
|
attribute :mode, Types::Integer.enum(
|
|
@@ -17,7 +17,7 @@ module DjiMqttConnect
|
|
|
17
17
|
attribute :_method, Types::String.enum("ir_metering_point_set")
|
|
18
18
|
|
|
19
19
|
attribute :data do
|
|
20
|
-
attribute :payload_index, Types::
|
|
20
|
+
attribute :payload_index, Types::PayloadIndex
|
|
21
21
|
|
|
22
22
|
# The left and upper corner of the lens is the coordinate center. The horizontal direction is x.
|
|
23
23
|
# {"max":1,"min":0}
|
|
@@ -18,7 +18,7 @@ module DjiMqttConnect
|
|
|
18
18
|
|
|
19
19
|
attribute :data do
|
|
20
20
|
# Enumeration of camera payload and mounted location. Non-standard device_mode_key, formatted as {type-subtype-gimbalindex}.
|
|
21
|
-
attribute :payload_index, Types::
|
|
21
|
+
attribute :payload_index, Types::PayloadIndex
|
|
22
22
|
end
|
|
23
23
|
end
|
|
24
24
|
end
|
|
@@ -21,7 +21,7 @@ module DjiMqttConnect
|
|
|
21
21
|
attribute :_method, Types::String.enum("photo_storage_set")
|
|
22
22
|
|
|
23
23
|
attribute :data do
|
|
24
|
-
attribute :payload_index, Types::
|
|
24
|
+
attribute :payload_index, Types::PayloadIndex
|
|
25
25
|
|
|
26
26
|
# Photo storage types {current, vision, ir}, can be multiple
|
|
27
27
|
attribute :photo_storage_settings, Types::Array.of(
|
|
@@ -21,7 +21,7 @@ module DjiMqttConnect
|
|
|
21
21
|
attribute :_method, Types::String.enum("video_storage_set")
|
|
22
22
|
|
|
23
23
|
attribute :data do
|
|
24
|
-
attribute :payload_index, Types::
|
|
24
|
+
attribute :payload_index, Types::PayloadIndex
|
|
25
25
|
|
|
26
26
|
# Video storage types {current, vision, ir}, can be multiple
|
|
27
27
|
attribute :video_storage_settings, Types::Array.of(
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Thing::Product
|
|
5
|
+
# https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock3/cmd.html#stop-charging
|
|
6
|
+
class ChargeCloseServicesReplyMessage < ServicesReplyMessage
|
|
7
|
+
attribute :_method, Types::String.enum("charge_close")
|
|
8
|
+
|
|
9
|
+
attribute :data do
|
|
10
|
+
attribute :result, Types::ResultCode
|
|
11
|
+
include Mixins::ResultCode
|
|
12
|
+
|
|
13
|
+
attribute :output do
|
|
14
|
+
# {"canceled":"Cancelled or terminated","failed":"Failed","in_progress":"Executing","ok":"Executed successfully","paused":"Paused","rejected":"Rejected","sent":"Issued","timeout":"Timeout"}
|
|
15
|
+
attribute :status, Types::ServicesOutputStatus
|
|
16
|
+
include Mixins::ServicesOutputStatus
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Thing::Product
|
|
5
|
+
# https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock3/cmd.html#start-charging
|
|
6
|
+
class ChargeOpenServicesReplyMessage < ServicesReplyMessage
|
|
7
|
+
attribute :_method, Types::String.enum("charge_open")
|
|
8
|
+
|
|
9
|
+
attribute :data do
|
|
10
|
+
attribute :result, Types::ResultCode
|
|
11
|
+
include Mixins::ResultCode
|
|
12
|
+
|
|
13
|
+
attribute :output do
|
|
14
|
+
# {"canceled":"Cancelled or terminated","failed":"Failed","in_progress":"Executing","ok":"Executed successfully","paused":"Paused","rejected":"Rejected","sent":"Issued","timeout":"Timeout"}
|
|
15
|
+
attribute :status, Types::ServicesOutputStatus
|
|
16
|
+
include Mixins::ServicesOutputStatus
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Thing::Product
|
|
5
|
+
# https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock3/cmd.html#force-close
|
|
6
|
+
class CoverForceCloseServicesReplyMessage < ServicesReplyMessage
|
|
7
|
+
attribute :_method, Types::String.enum("cover_force_close")
|
|
8
|
+
|
|
9
|
+
attribute :data do
|
|
10
|
+
attribute :result, Types::ResultCode
|
|
11
|
+
include Mixins::ResultCode
|
|
12
|
+
|
|
13
|
+
attribute :output do
|
|
14
|
+
# {"canceled":"Cancelled or terminated","failed":"Failed","in_progress":"Executing","ok":"Executed successfully","paused":"Paused","rejected":"Rejected","sent":"Issued","timeout":"Timeout"}
|
|
15
|
+
attribute :status, Types::ServicesOutputStatus
|
|
16
|
+
include Mixins::ServicesOutputStatus
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -98,6 +98,7 @@ module DjiMqttConnect
|
|
|
98
98
|
|
|
99
99
|
attribute? :cameras, Types::Array do
|
|
100
100
|
attribute? :camera_mode, Types::Integer
|
|
101
|
+
|
|
101
102
|
attribute? :liveview_world_region do
|
|
102
103
|
attribute :bottom, Types::JSON::Decimal
|
|
103
104
|
attribute :left, Types::JSON::Decimal
|
|
@@ -112,6 +113,38 @@ module DjiMqttConnect
|
|
|
112
113
|
attribute? :recording_state, Types::Integer
|
|
113
114
|
attribute? :remain_photo_num, Types::Integer
|
|
114
115
|
attribute? :remain_record_duration, Types::Integer
|
|
116
|
+
|
|
117
|
+
attribute? :screen_split_enable, Types::Bool
|
|
118
|
+
|
|
119
|
+
attribute? :ir_metering_mode, Types::Integer
|
|
120
|
+
attribute? :ir_metering_area do
|
|
121
|
+
attribute :x, Types::JSON::Decimal
|
|
122
|
+
attribute :y, Types::JSON::Decimal
|
|
123
|
+
attribute :width, Types::JSON::Decimal
|
|
124
|
+
attribute :height, Types::JSON::Decimal
|
|
125
|
+
|
|
126
|
+
attribute :aver_temperature, Types::JSON::Decimal
|
|
127
|
+
attribute :max_temperature_point do
|
|
128
|
+
attribute :x, Types::JSON::Decimal
|
|
129
|
+
attribute :y, Types::JSON::Decimal
|
|
130
|
+
|
|
131
|
+
attribute :temperature, Types::JSON::Decimal
|
|
132
|
+
end
|
|
133
|
+
attribute :min_temperature_point do
|
|
134
|
+
attribute :x, Types::JSON::Decimal
|
|
135
|
+
attribute :y, Types::JSON::Decimal
|
|
136
|
+
|
|
137
|
+
attribute :temperature, Types::JSON::Decimal
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
attribute? :ir_metering_point do
|
|
141
|
+
attribute :x, Types::JSON::Decimal
|
|
142
|
+
attribute :y, Types::JSON::Decimal
|
|
143
|
+
|
|
144
|
+
attribute :temperature, Types::JSON::Decimal
|
|
145
|
+
end
|
|
146
|
+
attribute? :ir_zoom_factor, Types::JSON::Decimal
|
|
147
|
+
|
|
115
148
|
attribute? :wide_calibrate_farthest_focus_value, Types::Integer
|
|
116
149
|
attribute? :wide_calibrate_nearest_focus_value, Types::Integer
|
|
117
150
|
attribute? :wide_exposure_mode, Types::Integer
|
|
@@ -123,11 +156,11 @@ module DjiMqttConnect
|
|
|
123
156
|
attribute? :wide_max_focus_value, Types::Integer
|
|
124
157
|
attribute? :wide_min_focus_value, Types::Integer
|
|
125
158
|
attribute? :wide_shutter_speed, Types::Integer
|
|
159
|
+
|
|
126
160
|
attribute? :zoom_calibrate_farthest_focus_value, Types::Integer
|
|
127
161
|
attribute? :zoom_calibrate_nearest_focus_value, Types::Integer
|
|
128
162
|
attribute? :zoom_exposure_mode, Types::Integer
|
|
129
163
|
attribute? :zoom_exposure_value, Types::Integer
|
|
130
|
-
attribute? :zoom_factor, Types::JSON::Decimal
|
|
131
164
|
attribute? :zoom_focus_mode, Types::Integer
|
|
132
165
|
attribute? :zoom_focus_state, Types::Integer
|
|
133
166
|
attribute? :zoom_focus_value, Types::Integer
|
|
@@ -135,6 +168,8 @@ module DjiMqttConnect
|
|
|
135
168
|
attribute? :zoom_max_focus_value, Types::Integer
|
|
136
169
|
attribute? :zoom_min_focus_value, Types::Integer
|
|
137
170
|
attribute? :zoom_shutter_speed, Types::Integer
|
|
171
|
+
|
|
172
|
+
attribute? :zoom_factor, Types::JSON::Decimal
|
|
138
173
|
end
|
|
139
174
|
|
|
140
175
|
# Not all messages will have a live_capacity attribute
|
|
@@ -152,11 +187,10 @@ module DjiMqttConnect
|
|
|
152
187
|
attribute :available_video_number, Types::Integer
|
|
153
188
|
attribute :coexist_video_number_max, Types::Integer
|
|
154
189
|
attribute :video_list, Types::Array do
|
|
155
|
-
include Mixins::VideoType
|
|
156
|
-
|
|
157
190
|
attribute :video_index, Types::String
|
|
158
191
|
|
|
159
192
|
attribute :video_type, Types::VideoType
|
|
193
|
+
include Mixins::VideoType
|
|
160
194
|
|
|
161
195
|
attribute :switchable_video_types, Types::Array.of(Types::VideoType)
|
|
162
196
|
end
|
|
@@ -165,14 +199,13 @@ module DjiMqttConnect
|
|
|
165
199
|
end
|
|
166
200
|
|
|
167
201
|
attribute? :live_status, Types::Array do
|
|
168
|
-
include Mixins::VideoType
|
|
169
|
-
include Mixins::VideoQuality
|
|
170
|
-
|
|
171
202
|
attribute :video_id, Types::String
|
|
172
203
|
|
|
173
|
-
attribute :video_type, Types::VideoType
|
|
204
|
+
attribute :video_type, Types::VideoType | Types::Nil
|
|
205
|
+
include Mixins::VideoType
|
|
174
206
|
|
|
175
207
|
attribute :video_quality, Types::VideoQuality
|
|
208
|
+
include Mixins::VideoQuality
|
|
176
209
|
|
|
177
210
|
attribute :status, Types::Integer
|
|
178
211
|
attribute :error_status, Types::Integer
|
|
@@ -5,6 +5,10 @@ module DjiMqttConnect
|
|
|
5
5
|
# Adds video type helper methods
|
|
6
6
|
# Assumes a `video_type` attribute is present of type `Types::VideoType`
|
|
7
7
|
module VideoType
|
|
8
|
+
def video_type?
|
|
9
|
+
Types::VideoType.valid?(video_type)
|
|
10
|
+
end
|
|
11
|
+
|
|
8
12
|
def humanized_video_type
|
|
9
13
|
if video_type_infrared?
|
|
10
14
|
I18n.t("infrared", scope: "dji_mqtt_connect.video_types") # Infrared
|
|
@@ -42,9 +42,6 @@ module DjiMqttConnect
|
|
|
42
42
|
DeviceType = Types::Integer
|
|
43
43
|
DeviceSubType = Types::Integer
|
|
44
44
|
|
|
45
|
-
# Enumeration of camera payload and mounted location. Non-standard device_mode_key, formatted as {type-subtype-gimbalindex}.
|
|
46
|
-
DeviceModeKey = Types::String.constrained(format: /\A\d+-\d+-\d+\z/)
|
|
47
|
-
|
|
48
45
|
# {"0":"Idle mode (No cooling, heating, and dehumidification)","1":"Cooling mode","2":"Heating mode","3":"Dehumidification mode","4":"Cooling exit mode","5":"Heating exit mode","6":"Dehumidification exit mode","7":"Cooling preparation mode","8":"Heating preparation mode","9":"Dehumidification preparation mode"}
|
|
49
46
|
AirConditionerState = Types::Integer.enum(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
|
|
50
47
|
|
|
@@ -187,6 +184,7 @@ module DjiMqttConnect
|
|
|
187
184
|
NETWORK_STATE_QUALITY_GOOD = 2
|
|
188
185
|
)
|
|
189
186
|
|
|
187
|
+
# Enumeration of camera payload and mounted location. Non-standard device_mode_key, formatted as {type-subtype-gimbalindex}.
|
|
190
188
|
PayloadIndex = String.constrained(format: /\A\d+-\d+-\d+\z/)
|
|
191
189
|
|
|
192
190
|
PositionStateQuality = Types::Integer.enum(1, 2, 3, 4, 5, 10)
|
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.33
|
|
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-02-
|
|
11
|
+
date: 2026-02-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -155,6 +155,9 @@ files:
|
|
|
155
155
|
- lib/dji_mqtt_connect/factories/services/camera_recording_stop.rb
|
|
156
156
|
- lib/dji_mqtt_connect/factories/services/camera_screen_drag.rb
|
|
157
157
|
- lib/dji_mqtt_connect/factories/services/camera_screen_split.rb
|
|
158
|
+
- lib/dji_mqtt_connect/factories/services/charge_close.rb
|
|
159
|
+
- lib/dji_mqtt_connect/factories/services/charge_open.rb
|
|
160
|
+
- lib/dji_mqtt_connect/factories/services/cover_force_close.rb
|
|
158
161
|
- lib/dji_mqtt_connect/factories/services/gimbal_reset.rb
|
|
159
162
|
- lib/dji_mqtt_connect/factories/services/ir_metering_area_set.rb
|
|
160
163
|
- lib/dji_mqtt_connect/factories/services/ir_metering_mode_set.rb
|
|
@@ -182,7 +185,10 @@ files:
|
|
|
182
185
|
- lib/dji_mqtt_connect/messages/sys/product/status_reply/update_topo.rb
|
|
183
186
|
- lib/dji_mqtt_connect/messages/sys/product/status_reply_message.rb
|
|
184
187
|
- lib/dji_mqtt_connect/messages/thing/product/events/airsense_warning.rb
|
|
188
|
+
- lib/dji_mqtt_connect/messages/thing/product/events/charge_close.rb
|
|
189
|
+
- lib/dji_mqtt_connect/messages/thing/product/events/charge_open.rb
|
|
185
190
|
- lib/dji_mqtt_connect/messages/thing/product/events/cover_close.rb
|
|
191
|
+
- lib/dji_mqtt_connect/messages/thing/product/events/cover_force_close.rb
|
|
186
192
|
- lib/dji_mqtt_connect/messages/thing/product/events/cover_open.rb
|
|
187
193
|
- lib/dji_mqtt_connect/messages/thing/product/events/device_exit_homing_notify.rb
|
|
188
194
|
- lib/dji_mqtt_connect/messages/thing/product/events/device_log.rb
|
|
@@ -250,7 +256,10 @@ files:
|
|
|
250
256
|
- lib/dji_mqtt_connect/messages/thing/product/services/camera_recording_stop.rb
|
|
251
257
|
- lib/dji_mqtt_connect/messages/thing/product/services/camera_screen_drag.rb
|
|
252
258
|
- lib/dji_mqtt_connect/messages/thing/product/services/camera_screen_split.rb
|
|
259
|
+
- lib/dji_mqtt_connect/messages/thing/product/services/charge_close.rb
|
|
260
|
+
- lib/dji_mqtt_connect/messages/thing/product/services/charge_open.rb
|
|
253
261
|
- lib/dji_mqtt_connect/messages/thing/product/services/cover_close.rb
|
|
262
|
+
- lib/dji_mqtt_connect/messages/thing/product/services/cover_force_close.rb
|
|
254
263
|
- lib/dji_mqtt_connect/messages/thing/product/services/cover_open.rb
|
|
255
264
|
- lib/dji_mqtt_connect/messages/thing/product/services/debug_mode_close.rb
|
|
256
265
|
- lib/dji_mqtt_connect/messages/thing/product/services/debug_mode_open.rb
|
|
@@ -302,7 +311,10 @@ files:
|
|
|
302
311
|
- lib/dji_mqtt_connect/messages/thing/product/services_reply/camera_recording_stop.rb
|
|
303
312
|
- lib/dji_mqtt_connect/messages/thing/product/services_reply/camera_screen_drag.rb
|
|
304
313
|
- lib/dji_mqtt_connect/messages/thing/product/services_reply/camera_screen_split.rb
|
|
314
|
+
- lib/dji_mqtt_connect/messages/thing/product/services_reply/charge_close.rb
|
|
315
|
+
- lib/dji_mqtt_connect/messages/thing/product/services_reply/charge_open.rb
|
|
305
316
|
- lib/dji_mqtt_connect/messages/thing/product/services_reply/cover_close.rb
|
|
317
|
+
- lib/dji_mqtt_connect/messages/thing/product/services_reply/cover_force_close.rb
|
|
306
318
|
- lib/dji_mqtt_connect/messages/thing/product/services_reply/cover_open.rb
|
|
307
319
|
- lib/dji_mqtt_connect/messages/thing/product/services_reply/debug_mode_close.rb
|
|
308
320
|
- lib/dji_mqtt_connect/messages/thing/product/services_reply/debug_mode_open.rb
|