dji_mqtt_connect 0.1.28 → 0.1.29
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/lib/dji_mqtt_connect/messages/sys/product/status_reply_message.rb +1 -2
- data/lib/dji_mqtt_connect/messages/thing/product/events/airsense_warning.rb +2 -0
- data/lib/dji_mqtt_connect/messages/thing/product/events/cover_close.rb +3 -5
- data/lib/dji_mqtt_connect/messages/thing/product/events/cover_open.rb +3 -6
- data/lib/dji_mqtt_connect/messages/thing/product/events/device_reboot.rb +3 -6
- data/lib/dji_mqtt_connect/messages/thing/product/events/drone_close.rb +3 -6
- data/lib/dji_mqtt_connect/messages/thing/product/events/drone_open.rb +2 -4
- data/lib/dji_mqtt_connect/messages/thing/product/events/file_upload_callback.rb +4 -5
- data/lib/dji_mqtt_connect/messages/thing/product/events/flighttask_progress.rb +2 -6
- data/lib/dji_mqtt_connect/messages/thing/product/events/return_home_info.rb +4 -0
- data/lib/dji_mqtt_connect/messages/thing/product/events/takeoff_to_point_progress.rb +1 -2
- data/lib/dji_mqtt_connect/messages/thing/product/events/uom_fly_data_info.rb +4 -2
- data/lib/dji_mqtt_connect/messages/thing/product/events_reply_message.rb +1 -2
- data/lib/dji_mqtt_connect/messages/thing/product/osd/dock.rb +32 -141
- data/lib/dji_mqtt_connect/messages/thing/product/osd/drone.rb +7 -5
- data/lib/dji_mqtt_connect/messages/thing/product/osd/flight_hub_dock.rb +40 -39
- data/lib/dji_mqtt_connect/messages/thing/product/osd/remote.rb +3 -3
- data/lib/dji_mqtt_connect/messages/thing/product/requests_reply/airport_bind_status.rb +1 -2
- data/lib/dji_mqtt_connect/messages/thing/product/requests_reply/airport_organization_bind.rb +1 -2
- data/lib/dji_mqtt_connect/messages/thing/product/requests_reply/airport_organization_get.rb +1 -2
- data/lib/dji_mqtt_connect/messages/thing/product/requests_reply/flight_areas_get.rb +1 -2
- data/lib/dji_mqtt_connect/messages/thing/product/requests_reply/flighttask_resource_get.rb +1 -2
- data/lib/dji_mqtt_connect/messages/thing/product/requests_reply/offline_map_get.rb +1 -2
- data/lib/dji_mqtt_connect/messages/thing/product/requests_reply/offline_map_get_v2.rb +1 -2
- data/lib/dji_mqtt_connect/messages/thing/product/requests_reply/storage_config_get.rb +1 -2
- data/lib/dji_mqtt_connect/messages/thing/product/services/flighttask_execute.rb +3 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services/flighttask_prepare.rb +3 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services_reply/alarm_state_switch.rb +2 -4
- data/lib/dji_mqtt_connect/messages/thing/product/services_reply/cover_close.rb +2 -4
- data/lib/dji_mqtt_connect/messages/thing/product/services_reply/cover_open.rb +2 -4
- data/lib/dji_mqtt_connect/messages/thing/product/services_reply/debug_mode_close.rb +2 -4
- data/lib/dji_mqtt_connect/messages/thing/product/services_reply/debug_mode_open.rb +2 -4
- data/lib/dji_mqtt_connect/messages/thing/product/services_reply/drone_close.rb +2 -4
- data/lib/dji_mqtt_connect/messages/thing/product/services_reply/drone_open.rb +2 -4
- data/lib/dji_mqtt_connect/messages/thing/product/services_reply/flighttask_progress_get.rb +2 -6
- data/lib/dji_mqtt_connect/messages/thing/product/services_reply/return_home.rb +2 -4
- data/lib/dji_mqtt_connect/messages/thing/product/services_reply/return_specific_home.rb +2 -4
- data/lib/dji_mqtt_connect/messages/thing/product/services_reply_message.rb +1 -2
- data/lib/dji_mqtt_connect/messages/thing/product/state_message.rb +1 -2
- data/lib/dji_mqtt_connect/messages/thing/product/state_reply_message.rb +1 -2
- data/lib/dji_mqtt_connect/mixins/air_conditioner_state.rb +11 -0
- data/lib/dji_mqtt_connect/mixins/alarm_state.rb +20 -0
- data/lib/dji_mqtt_connect/mixins/{humanized_camera_index.rb → camera_index.rb} +6 -2
- data/lib/dji_mqtt_connect/mixins/cover_state.rb +24 -0
- data/lib/dji_mqtt_connect/mixins/drone_in_dock.rb +11 -0
- data/lib/dji_mqtt_connect/mixins/emergency_stop_state.rb +20 -0
- data/lib/dji_mqtt_connect/mixins/environment_temperature.rb +11 -0
- data/lib/dji_mqtt_connect/mixins/{events_progress_checks.rb → events_progress_step_key.rb} +1 -1
- data/lib/dji_mqtt_connect/mixins/flighttask_progress_current_step.rb +11 -0
- data/lib/dji_mqtt_connect/mixins/{latitude_conditional.rb → latitude.rb} +1 -1
- data/lib/dji_mqtt_connect/mixins/{longitude_conditional.rb → longitude.rb} +1 -1
- data/lib/dji_mqtt_connect/mixins/putter_state.rb +24 -0
- data/lib/dji_mqtt_connect/mixins/rainfall.rb +24 -0
- data/lib/dji_mqtt_connect/mixins/{result_message.rb → result_code.rb} +1 -1
- data/lib/dji_mqtt_connect/mixins/{services_output_status_checks.rb → services_output_status.rb} +1 -1
- data/lib/dji_mqtt_connect/mixins/supplement_light_state.rb +20 -0
- data/lib/dji_mqtt_connect/mixins/{temperature_conditional.rb → temperature.rb} +1 -1
- data/lib/dji_mqtt_connect/types.rb +46 -0
- data/lib/dji_mqtt_connect/version.rb +1 -1
- data/lib/dji_mqtt_connect.rb +17 -7
- metadata +19 -9
@@ -11,52 +11,53 @@ module DjiMqttConnect
|
|
11
11
|
|
12
12
|
attribute? :air_conditioner do
|
13
13
|
attribute :air_conditioner_state, Types::AirConditionerState | Types::Integer
|
14
|
-
|
14
|
+
include Mixins::AirConditionerState
|
15
15
|
|
16
|
-
|
17
|
-
Types::AirConditionerState.valid?(air_conditioner_state)
|
18
|
-
end
|
16
|
+
attribute :switch_time, Types::Integer
|
19
17
|
end
|
20
18
|
|
21
19
|
attribute? :activation_time, Types::Integer
|
22
20
|
|
23
21
|
# {"0":"Closed","1":"Opened"}
|
24
|
-
attribute? :alarm_state, Types::
|
25
|
-
|
26
|
-
ALARM_STATE_OPEN = 1
|
27
|
-
)
|
22
|
+
attribute? :alarm_state, Types::AlarmState
|
23
|
+
include Mixins::AlarmState
|
28
24
|
|
29
25
|
attribute? :alternate_land_point do
|
30
26
|
attribute :latitude, Types::Latitude
|
27
|
+
include Mixins::Latitude
|
28
|
+
|
31
29
|
attribute :longitude, Types::Longitude
|
30
|
+
include Mixins::Longitude
|
31
|
+
|
32
32
|
attribute :height, Types::JSON::Decimal
|
33
33
|
attribute :safe_land_height, Types::JSON::Decimal
|
34
34
|
attribute :is_configured, Types::Integer.enum(0, 1)
|
35
35
|
end
|
36
36
|
|
37
37
|
attribute? :backup_battery do
|
38
|
-
include Mixins::TemperatureConditional
|
39
|
-
|
40
38
|
attribute :switch, Types::Integer.enum(0, 1)
|
39
|
+
|
41
40
|
attribute :voltage, Types::Integer
|
41
|
+
|
42
42
|
attribute :temperature, Types::Temperature
|
43
|
+
include Mixins::Temperature
|
43
44
|
end
|
44
45
|
|
45
46
|
# {"1":"Planned storage strategy of battery","2":"Emergency storage strategy of battery"}
|
46
47
|
attribute? :battery_store_mode, Types::Integer.enum(1, 2)
|
47
48
|
|
48
49
|
# {"0":"Closed","1":"Opened","2":"Half-open","3":"Cover state is abnormal"}
|
49
|
-
attribute? :cover_state, Types::
|
50
|
-
|
51
|
-
COVER_STATE_OPEN = 1,
|
52
|
-
COVER_STATE_HALF_OPEN = 2,
|
53
|
-
COVER_STATE_ABNORMAL = 3
|
54
|
-
)
|
50
|
+
attribute? :cover_state, Types::CoverState
|
51
|
+
include Mixins::CoverState
|
55
52
|
|
56
53
|
attribute? :departure_point do
|
57
54
|
attribute :height, Types::JSON::Decimal
|
55
|
+
|
58
56
|
attribute :latitude, Types::Latitude
|
57
|
+
include Mixins::Latitude
|
58
|
+
|
59
59
|
attribute :longitude, Types::Longitude
|
60
|
+
include Mixins::Longitude
|
60
61
|
end
|
61
62
|
|
62
63
|
attribute? :departure_point_status, Types::Integer
|
@@ -68,15 +69,15 @@ module DjiMqttConnect
|
|
68
69
|
|
69
70
|
attribute? :drone_battery_maintenance_info do
|
70
71
|
attribute :batteries, Types::Array do
|
71
|
-
include Mixins::TemperatureConditional
|
72
|
-
|
73
72
|
attribute :index, Types::Integer
|
74
73
|
|
75
74
|
attribute :capacity_percent, Types::Integer
|
76
75
|
include Mixins::CapacityPercent
|
77
76
|
|
78
77
|
attribute :voltage, Types::Integer
|
78
|
+
|
79
79
|
attribute :temperature, Types::Temperature
|
80
|
+
include Mixins::Temperature
|
80
81
|
end
|
81
82
|
|
82
83
|
# {"0":"Battery is not in heating or insulation","1":"Battery is in heating","2":"Battery is in insulation"}
|
@@ -96,17 +97,17 @@ module DjiMqttConnect
|
|
96
97
|
include Mixins::CapacityPercent
|
97
98
|
end
|
98
99
|
|
99
|
-
attribute? :drone_in_dock, Types::
|
100
|
+
attribute? :drone_in_dock, Types::DroneInDock
|
101
|
+
include Mixins::DroneInDock
|
100
102
|
|
101
103
|
attribute? :electric_supply_voltage, Types::Integer
|
102
104
|
|
103
105
|
# {"0":"Closed","1":"Opened"}
|
104
|
-
attribute? :emergency_stop_state, Types::
|
105
|
-
|
106
|
-
EMERGENCY_STOP_STATE_OPEN = 1
|
107
|
-
)
|
106
|
+
attribute? :emergency_stop_state, Types::EmergencyStopState
|
107
|
+
include Mixins::EmergencyStopState
|
108
108
|
|
109
109
|
attribute? :environment_temperature, Types::Temperature
|
110
|
+
include Mixins::EnvironmentTemperature
|
110
111
|
|
111
112
|
attribute? :first_power_on, Types::Integer
|
112
113
|
|
@@ -128,8 +129,10 @@ module DjiMqttConnect
|
|
128
129
|
attribute? :job_number, Types::Integer
|
129
130
|
|
130
131
|
attribute? :latitude, Types::Latitude
|
132
|
+
include Mixins::Latitude
|
131
133
|
|
132
134
|
attribute? :longitude, Types::Longitude
|
135
|
+
include Mixins::Longitude
|
133
136
|
|
134
137
|
attribute? :maintain_status do
|
135
138
|
attribute :maintain_status_array, Types::Array do
|
@@ -179,24 +182,20 @@ module DjiMqttConnect
|
|
179
182
|
end
|
180
183
|
|
181
184
|
# {"0":"Closed","1":"Opened","2":"Half-open","3":"Putter state is abnormal"}
|
182
|
-
attribute? :putter_state, Types::
|
183
|
-
|
184
|
-
PUTTER_STATE_OPEN = 1,
|
185
|
-
PUTTER_STATE_HALF_OPEN = 2,
|
186
|
-
PUTTER_STATE_ABNORMAL = 3
|
187
|
-
)
|
185
|
+
attribute? :putter_state, Types::PutterState
|
186
|
+
include Mixins::PutterState
|
188
187
|
|
189
188
|
# {"0":"No rain","1":"Light rain","2":"Moderate rain","3":"Heavy rain"}
|
190
|
-
attribute? :rainfall, Types::
|
191
|
-
|
192
|
-
RAINFALL_LIGHT = 1,
|
193
|
-
RAINFALL_MODERATE = 2,
|
194
|
-
RAINFALL_HEAVY = 3
|
195
|
-
)
|
189
|
+
attribute? :rainfall, Types::Rainfall
|
190
|
+
include Mixins::Rainfall
|
196
191
|
|
197
192
|
attribute? :relative_alternate_land_point do
|
198
193
|
attribute :latitude, Types::Latitude
|
194
|
+
include Mixins::Latitude
|
195
|
+
|
199
196
|
attribute :longitude, Types::Longitude
|
197
|
+
include Mixins::Longitude
|
198
|
+
|
200
199
|
attribute :safe_land_height, Types::JSON::Decimal
|
201
200
|
attribute :status, Types::Integer
|
202
201
|
end
|
@@ -209,8 +208,12 @@ module DjiMqttConnect
|
|
209
208
|
|
210
209
|
attribute? :self_converge_coordinate do
|
211
210
|
attribute :height, Types::JSON::Decimal
|
211
|
+
|
212
212
|
attribute :latitude, Types::Latitude
|
213
|
+
include Mixins::Latitude
|
214
|
+
|
213
215
|
attribute :longitude, Types::Longitude
|
216
|
+
include Mixins::Longitude
|
214
217
|
end
|
215
218
|
|
216
219
|
attribute? :silent_mode, Types::Integer
|
@@ -231,10 +234,8 @@ module DjiMqttConnect
|
|
231
234
|
attribute :device_paired, Types::Integer.enum(0, 1)
|
232
235
|
end
|
233
236
|
|
234
|
-
attribute? :supplement_light_state, Types::
|
235
|
-
|
236
|
-
SUPPLEMENT_LIGHT_STATE_OPEN = 1
|
237
|
-
)
|
237
|
+
attribute? :supplement_light_state, Types::SupplementLightState
|
238
|
+
include Mixins::SupplementLightState
|
238
239
|
|
239
240
|
attribute? :temperature, Types::Temperature
|
240
241
|
|
@@ -4,14 +4,14 @@ module DjiMqttConnect
|
|
4
4
|
module Thing::Product
|
5
5
|
class RemoteOsdMessage < OsdMessage
|
6
6
|
attribute :data do
|
7
|
-
include Mixins::LatitudeConditional
|
8
|
-
include Mixins::LongitudeConditional
|
9
|
-
|
10
7
|
attribute :capacity_percent, Types::Integer
|
11
8
|
include Mixins::CapacityPercent
|
12
9
|
|
13
10
|
attribute :latitude, Types::Latitude
|
11
|
+
include Mixins::Latitude
|
12
|
+
|
14
13
|
attribute :longitude, Types::Longitude
|
14
|
+
include Mixins::Longitude
|
15
15
|
|
16
16
|
attribute? :live_status do
|
17
17
|
attribute :live_time, Types::Integer
|
@@ -21,9 +21,8 @@ module DjiMqttConnect
|
|
21
21
|
attribute :_method, Types::String.enum("airport_bind_status")
|
22
22
|
|
23
23
|
attribute :data do
|
24
|
-
include Mixins::ResultMessage
|
25
|
-
|
26
24
|
attribute :result, Types::ResultCode
|
25
|
+
include Mixins::ResultCode
|
27
26
|
|
28
27
|
attribute :output do
|
29
28
|
attribute :bind_status, Types::Array do
|
data/lib/dji_mqtt_connect/messages/thing/product/requests_reply/airport_organization_bind.rb
CHANGED
@@ -20,9 +20,8 @@ module DjiMqttConnect
|
|
20
20
|
attribute :_method, Types::String.enum("airport_organization_bind")
|
21
21
|
|
22
22
|
attribute :data do
|
23
|
-
include Mixins::ResultMessage
|
24
|
-
|
25
23
|
attribute :result, Types::ResultCode
|
24
|
+
include Mixins::ResultCode
|
26
25
|
|
27
26
|
attribute :err_infos, Types::Array do
|
28
27
|
attribute :sn, Types::SerialNumber
|
@@ -20,9 +20,8 @@ module DjiMqttConnect
|
|
20
20
|
attribute :_method, Types::String.enum("airport_organization_get")
|
21
21
|
|
22
22
|
attribute :data do
|
23
|
-
include Mixins::ResultMessage
|
24
|
-
|
25
23
|
attribute :result, Types::ResultCode
|
24
|
+
include Mixins::ResultCode
|
26
25
|
|
27
26
|
attribute :output do
|
28
27
|
attribute :organization_name, Types::String
|
@@ -22,9 +22,8 @@ module DjiMqttConnect
|
|
22
22
|
attribute :_method, Types::String.enum("flight_areas_get")
|
23
23
|
|
24
24
|
attribute :data do
|
25
|
-
include Mixins::ResultMessage
|
26
|
-
|
27
25
|
attribute :result, Types::ResultCode
|
26
|
+
include Mixins::ResultCode
|
28
27
|
|
29
28
|
attribute :output do
|
30
29
|
attribute :files, Types::Array do
|
@@ -23,9 +23,8 @@ module DjiMqttConnect
|
|
23
23
|
attribute :_method, Types::String.enum("flighttask_resource_get")
|
24
24
|
|
25
25
|
attribute :data do
|
26
|
-
include Mixins::ResultMessage
|
27
|
-
|
28
26
|
attribute :result, Types::ResultCode
|
27
|
+
include Mixins::ResultCode
|
29
28
|
|
30
29
|
attribute :output do
|
31
30
|
attribute :file do
|
@@ -20,9 +20,8 @@ module DjiMqttConnect
|
|
20
20
|
attribute :_method, Types::String.enum("storage_config_get")
|
21
21
|
|
22
22
|
attribute :data do
|
23
|
-
include Mixins::ResultMessage
|
24
|
-
|
25
23
|
attribute :result, Types::ResultCode
|
24
|
+
include Mixins::ResultCode
|
26
25
|
|
27
26
|
attribute :output do
|
28
27
|
attribute :bucket, Types::String
|
@@ -50,7 +50,10 @@ module DjiMqttConnect
|
|
50
50
|
attribute :dock_type, Types::String.enum("landing", "takeoff")
|
51
51
|
|
52
52
|
attribute :latitude, Types::Latitude
|
53
|
+
include Mixins::Latitude
|
54
|
+
|
53
55
|
attribute :longitude, Types::Longitude
|
56
|
+
include Mixins::Longitude
|
54
57
|
|
55
58
|
attribute :height, Types::JSON::Decimal
|
56
59
|
|
@@ -6,15 +6,13 @@ module DjiMqttConnect
|
|
6
6
|
attribute :_method, Types::String.enum("alarm_state_switch")
|
7
7
|
|
8
8
|
attribute :data do
|
9
|
-
include Mixins::ResultMessage
|
10
|
-
|
11
9
|
attribute :result, Types::ResultCode
|
10
|
+
include Mixins::ResultCode
|
12
11
|
|
13
12
|
attribute :output do
|
14
|
-
include Mixins::ServicesOutputStatusChecks
|
15
|
-
|
16
13
|
# {"sent":"sent","in_progress":"in progress","ok":"success","paused":"paused","rejected":"rejected","failed":"failed","canceled":"canceled or stopped","timeout":"timeout"}
|
17
14
|
attribute :status, Types::ServicesOutputStatus
|
15
|
+
include Mixins::ServicesOutputStatus
|
18
16
|
end
|
19
17
|
end
|
20
18
|
end
|
@@ -6,15 +6,13 @@ module DjiMqttConnect
|
|
6
6
|
attribute :_method, Types::String.enum("cover_close")
|
7
7
|
|
8
8
|
attribute :data do
|
9
|
-
include Mixins::ResultMessage
|
10
|
-
|
11
9
|
attribute :result, Types::ResultCode
|
10
|
+
include Mixins::ResultCode
|
12
11
|
|
13
12
|
attribute :output do
|
14
|
-
include Mixins::ServicesOutputStatusChecks
|
15
|
-
|
16
13
|
# {"sent":"sent","in_progress":"in progress","ok":"success","paused":"paused","rejected":"rejected","failed":"failed","canceled":"canceled or stopped","timeout":"timeout"}
|
17
14
|
attribute :status, Types::ServicesOutputStatus
|
15
|
+
include Mixins::ServicesOutputStatus
|
18
16
|
end
|
19
17
|
end
|
20
18
|
end
|
@@ -6,15 +6,13 @@ module DjiMqttConnect
|
|
6
6
|
attribute :_method, Types::String.enum("cover_open")
|
7
7
|
|
8
8
|
attribute :data do
|
9
|
-
include Mixins::ResultMessage
|
10
|
-
|
11
9
|
attribute :result, Types::ResultCode
|
10
|
+
include Mixins::ResultCode
|
12
11
|
|
13
12
|
attribute :output do
|
14
|
-
include Mixins::ServicesOutputStatusChecks
|
15
|
-
|
16
13
|
# {"sent":"sent","in_progress":"in progress","ok":"success","paused":"paused","rejected":"rejected","failed":"failed","canceled":"canceled or stopped","timeout":"timeout"}
|
17
14
|
attribute :status, Types::ServicesOutputStatus
|
15
|
+
include Mixins::ServicesOutputStatus
|
18
16
|
end
|
19
17
|
end
|
20
18
|
end
|
@@ -6,15 +6,13 @@ module DjiMqttConnect
|
|
6
6
|
attribute :_method, Types::String.enum("debug_mode_close")
|
7
7
|
|
8
8
|
attribute :data do
|
9
|
-
include Mixins::ResultMessage
|
10
|
-
|
11
9
|
attribute :result, Types::ResultCode
|
10
|
+
include Mixins::ResultCode
|
12
11
|
|
13
12
|
attribute :output do
|
14
|
-
include Mixins::ServicesOutputStatusChecks
|
15
|
-
|
16
13
|
# {"sent":"sent","in_progress":"in progress","ok":"success","paused":"paused","rejected":"rejected","failed":"failed","canceled":"canceled or stopped","timeout":"timeout"}
|
17
14
|
attribute :status, Types::ServicesOutputStatus
|
15
|
+
include Mixins::ServicesOutputStatus
|
18
16
|
end
|
19
17
|
end
|
20
18
|
end
|
@@ -6,15 +6,13 @@ module DjiMqttConnect
|
|
6
6
|
attribute :_method, Types::String.enum("debug_mode_open")
|
7
7
|
|
8
8
|
attribute :data do
|
9
|
-
include Mixins::ResultMessage
|
10
|
-
|
11
9
|
attribute :result, Types::ResultCode
|
10
|
+
include Mixins::ResultCode
|
12
11
|
|
13
12
|
attribute :output do
|
14
|
-
include Mixins::ServicesOutputStatusChecks
|
15
|
-
|
16
13
|
# {"sent":"sent","in_progress":"in progress","ok":"success","paused":"paused","rejected":"rejected","failed":"failed","canceled":"canceled or stopped","timeout":"timeout"}
|
17
14
|
attribute :status, Types::ServicesOutputStatus
|
15
|
+
include Mixins::ServicesOutputStatus
|
18
16
|
end
|
19
17
|
end
|
20
18
|
end
|
@@ -6,15 +6,13 @@ module DjiMqttConnect
|
|
6
6
|
attribute :_method, Types::String.enum("drone_close")
|
7
7
|
|
8
8
|
attribute :data do
|
9
|
-
include Mixins::ResultMessage
|
10
|
-
|
11
9
|
attribute :result, Types::ResultCode
|
10
|
+
include Mixins::ResultCode
|
12
11
|
|
13
12
|
attribute :output do
|
14
|
-
include Mixins::ServicesOutputStatusChecks
|
15
|
-
|
16
13
|
# {"sent":"sent","in_progress":"in progress","ok":"success","paused":"paused","rejected":"rejected","failed":"failed","canceled":"canceled or stopped","timeout":"timeout"}
|
17
14
|
attribute :status, Types::ServicesOutputStatus
|
15
|
+
include Mixins::ServicesOutputStatus
|
18
16
|
end
|
19
17
|
end
|
20
18
|
end
|
@@ -6,15 +6,13 @@ module DjiMqttConnect
|
|
6
6
|
attribute :_method, Types::String.enum("drone_open")
|
7
7
|
|
8
8
|
attribute :data do
|
9
|
-
include Mixins::ResultMessage
|
10
|
-
|
11
9
|
attribute :result, Types::ResultCode
|
10
|
+
include Mixins::ResultCode
|
12
11
|
|
13
12
|
attribute :output do
|
14
|
-
include Mixins::ServicesOutputStatusChecks
|
15
|
-
|
16
13
|
# {"sent":"sent","in_progress":"in progress","ok":"success","paused":"paused","rejected":"rejected","failed":"failed","canceled":"canceled or stopped","timeout":"timeout"}
|
17
14
|
attribute :status, Types::ServicesOutputStatus
|
15
|
+
include Mixins::ServicesOutputStatus
|
18
16
|
end
|
19
17
|
end
|
20
18
|
end
|
@@ -6,9 +6,8 @@ module DjiMqttConnect
|
|
6
6
|
attribute :_method, Types::String.enum("flighttask_progress_get")
|
7
7
|
|
8
8
|
attribute :data do
|
9
|
-
include Mixins::ResultMessage
|
10
|
-
|
11
9
|
attribute :result, Types::ResultCode
|
10
|
+
include Mixins::ResultCode
|
12
11
|
|
13
12
|
attribute :output do
|
14
13
|
attribute :flight_id, Types::String
|
@@ -33,10 +32,7 @@ module DjiMqttConnect
|
|
33
32
|
attribute :progress do
|
34
33
|
# {"0":"Initial state","1":"Pre-flight check, whether the aircraft is executing a wayline","2":"Pre-flight check, whether the dock has exited working mode","3":"Pre-flight check, wayline execution in progress","4":"Pre-return-to-home check, in the process of returning to home","5":"Wayline execution enters the preparation state, waiting for the mission to be issued","6":"Dock enters working state","7":"Enter the startup check and cover preparation work","8":"Remote image transmission frequency Pairing","9":"Waiting for the flight system to be ready, push connection established","10":"Waiting for RTK source to listen for reported values","11":"Check if the RTK source is from the dock, if not, reset it","12":"Waiting for flight control notification","13":"The dock has no control and seizes the control of the aircraft","14":"Consistency check of custom flight area","15":"Consistency check of offline maps","16":"Get the latest KMZ URL","17":"Download KMZ","18":"KMZ uploading","19":"Coloring configuration","20":"Aircraft takeoff parameter setting, alternate landing point setting, takeoff altitude setting, coloring setting","21":"Aircraft flyto takeoff parameter setting","22":"Takeoff dock checks the landing dock preparation status","23":"Home point setting","24":"Trigger wayline execution","25":"Wayline executing","26":"Enter pre-return-to-home check","27":"Aircraft landing at the dock","28":"Close the cover after landing","29":"Dock exits working mode","30":"Dock abnormal recovery","31":"Dock uploads flight system logs","32":"Check camera recording state","33":"Get the number of media files","34":"Abnormal recovery after dock takeoff cover","35":"Notify mission result","36":"Log list retrieval - Aircraft list","37":"Log list retrieval - Retrieve the list of docks","38":"Log list retrieval - Upload log list result","39":"Log retrieval - Retrieve aircraft logs","40":"Log retrieval - Retrieve dock logs","41":"Log retrieval - Compress aircraft logs","42":"Log retrieval - Compress dock logs","43":"Log retrieval - Upload aircraft logs","44":"Log retrieval - Upload dock logs","45":"Log retrieval - Notify the result","46":"Custom flight area file update preparation","47":"Custom flight area updating","48":"Offline map update preparation","49":"Offline map updating","65533":"Wait for service response after completion","65534":"No specific state","65535":"UNKNOWN"}
|
35
34
|
attribute :current_step, Types::Integer
|
36
|
-
|
37
|
-
def humanized_current_step
|
38
|
-
I18n.t(current_step, scope: "dji_mqtt_connect.flighttask_progress.current_step", default: current_step.to_s)
|
39
|
-
end
|
35
|
+
include Mixins::FlighttaskProgressCurrentStep
|
40
36
|
|
41
37
|
# {"min":"0","max":"100","step":"1"}
|
42
38
|
attribute :percent, Types::Integer.constrained(gteq: 0, lteq: 100)
|
@@ -6,15 +6,13 @@ module DjiMqttConnect
|
|
6
6
|
attribute :_method, Types::String.enum("return_home")
|
7
7
|
|
8
8
|
attribute :data do
|
9
|
-
include Mixins::ResultMessage
|
10
|
-
|
11
9
|
attribute :result, Types::ResultCode
|
10
|
+
include Mixins::ResultCode
|
12
11
|
|
13
12
|
attribute? :output do
|
14
|
-
include Mixins::ServicesOutputStatusChecks
|
15
|
-
|
16
13
|
# {"sent":"sent","in_progress":"in progress","ok":"succeeded","paused":"paused","rejected":"rejected","failed":"failed","canceled":"canceled or terminated","timeout":"timeout"}
|
17
14
|
attribute :status, Types::ServicesOutputStatus
|
15
|
+
include Mixins::ServicesOutputStatus
|
18
16
|
end
|
19
17
|
end
|
20
18
|
end
|
@@ -6,15 +6,13 @@ module DjiMqttConnect
|
|
6
6
|
attribute :_method, Types::String.enum("return_specific_home")
|
7
7
|
|
8
8
|
attribute :data do
|
9
|
-
include Mixins::ResultMessage
|
10
|
-
|
11
9
|
attribute :result, Types::ResultCode
|
10
|
+
include Mixins::ResultCode
|
12
11
|
|
13
12
|
attribute? :output do
|
14
|
-
include Mixins::ServicesOutputStatusChecks
|
15
|
-
|
16
13
|
# {"sent":"sent","in_progress":"in progress","ok":"succeeded","paused":"paused","rejected":"rejected","failed":"failed","canceled":"canceled or terminated","timeout":"timeout"}
|
17
14
|
attribute :status, Types::ServicesOutputStatus
|
15
|
+
include Mixins::ServicesOutputStatus
|
18
16
|
end
|
19
17
|
end
|
20
18
|
end
|
@@ -145,8 +145,7 @@ module DjiMqttConnect
|
|
145
145
|
attribute :coexist_video_number_max, Types::Integer
|
146
146
|
attribute :camera_list, Types::Array do
|
147
147
|
attribute :camera_index, Types::String
|
148
|
-
|
149
|
-
include Mixins::HumanizedCameraIndex
|
148
|
+
include Mixins::CameraIndex
|
150
149
|
|
151
150
|
attribute :available_video_number, Types::Integer
|
152
151
|
attribute :coexist_video_number_max, Types::Integer
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DjiMqttConnect
|
4
|
+
module Mixins
|
5
|
+
module AlarmState
|
6
|
+
def humanized_alarm_state
|
7
|
+
return unless alarm_state
|
8
|
+
|
9
|
+
state_key = case alarm_state
|
10
|
+
when Types::ALARM_STATE_CLOSED
|
11
|
+
"Closed"
|
12
|
+
when Types::ALARM_STATE_OPEN
|
13
|
+
"Open"
|
14
|
+
end
|
15
|
+
|
16
|
+
I18n.t(state_key.downcase, scope: "dji_mqtt_connect.dock_alarm_state", default: state_key)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -3,9 +3,13 @@
|
|
3
3
|
module DjiMqttConnect
|
4
4
|
module Mixins
|
5
5
|
# Provides a conditional that returns false for nil for invalid latitude values
|
6
|
-
module
|
6
|
+
module CameraIndex
|
7
|
+
def camera_index?
|
8
|
+
camera_index.present?
|
9
|
+
end
|
10
|
+
|
7
11
|
def humanised_camera_index
|
8
|
-
return unless camera_index
|
12
|
+
return unless camera_index?
|
9
13
|
|
10
14
|
I18n.t(camera_index, scope: "dji_mqtt_connect.camera_index", default: camera_index)
|
11
15
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DjiMqttConnect
|
4
|
+
module Mixins
|
5
|
+
module CoverState
|
6
|
+
def humanized_cover_state
|
7
|
+
return unless cover_state
|
8
|
+
|
9
|
+
state_key = case cover_state
|
10
|
+
when Types::COVER_STATE_CLOSED
|
11
|
+
"Closed"
|
12
|
+
when Types::COVER_STATE_OPEN
|
13
|
+
"Open"
|
14
|
+
when Types::COVER_STATE_HALF_OPEN
|
15
|
+
"Half-open"
|
16
|
+
when Types::COVER_STATE_ABNORMAL
|
17
|
+
"Abnormal"
|
18
|
+
end
|
19
|
+
|
20
|
+
I18n.t(state_key.parameterize.underscore, scope: "dji_mqtt_connect.dock_cover_state", default: state_key)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|