dji_mqtt_connect 0.1.16.2 → 0.1.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +27 -23
  3. data/config/locales/flighttask_status.en.yml +7 -0
  4. data/config/locales/result_codes.en.yml +187 -0
  5. data/lib/dji_mqtt_connect/messages/sys/product/status_reply/update_topo.rb +3 -1
  6. data/lib/dji_mqtt_connect/messages/thing/product/events/cover_close.rb +3 -1
  7. data/lib/dji_mqtt_connect/messages/thing/product/events/cover_open.rb +3 -1
  8. data/lib/dji_mqtt_connect/messages/thing/product/events/device_reboot.rb +3 -1
  9. data/lib/dji_mqtt_connect/messages/thing/product/events/file_upload_callback.rb +4 -2
  10. data/lib/dji_mqtt_connect/messages/thing/product/events/flighttask_progress.rb +8 -2
  11. data/lib/dji_mqtt_connect/messages/thing/product/events_reply_message.rb +3 -1
  12. data/lib/dji_mqtt_connect/messages/thing/product/requests_reply/airport_bind_status.rb +4 -1
  13. data/lib/dji_mqtt_connect/messages/thing/product/requests_reply/airport_organization_bind.rb +4 -1
  14. data/lib/dji_mqtt_connect/messages/thing/product/requests_reply/airport_organization_get.rb +4 -1
  15. data/lib/dji_mqtt_connect/messages/thing/product/requests_reply/flighttask_resource_get.rb +3 -1
  16. data/lib/dji_mqtt_connect/messages/thing/product/requests_reply/storage_config_get.rb +4 -1
  17. data/lib/dji_mqtt_connect/messages/thing/product/services_reply/alarm_state_switch.rb +3 -1
  18. data/lib/dji_mqtt_connect/messages/thing/product/services_reply/cover_close.rb +3 -1
  19. data/lib/dji_mqtt_connect/messages/thing/product/services_reply/cover_open.rb +3 -1
  20. data/lib/dji_mqtt_connect/messages/thing/product/services_reply/debug_mode_close.rb +3 -1
  21. data/lib/dji_mqtt_connect/messages/thing/product/services_reply/debug_mode_open.rb +3 -1
  22. data/lib/dji_mqtt_connect/messages/thing/product/services_reply/return_home.rb +3 -1
  23. data/lib/dji_mqtt_connect/messages/thing/product/services_reply_message.rb +3 -1
  24. data/lib/dji_mqtt_connect/mixins/result_message.rb +12 -0
  25. data/lib/dji_mqtt_connect/translations.rb +4 -0
  26. data/lib/dji_mqtt_connect/types.rb +3 -0
  27. data/lib/dji_mqtt_connect/version.rb +1 -1
  28. data/lib/dji_mqtt_connect.rb +1 -0
  29. metadata +6 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 451ea15acecd32c735d0fded52d5f87386868215ef7f751a2e6c22c918897148
4
- data.tar.gz: 64bb22481167ca930d352e29470f27e348f6381e88413cd34b89808888d79fd1
3
+ metadata.gz: 545f8bf2f2935b6a11efa11f5f1f084fe34e777e5d48d4362f1570cdeb79e68e
4
+ data.tar.gz: e9ebe92a220f1b9bfd41529556fd4c10b6ff80bd8d52133bf5b6d5f2925c9b09
5
5
  SHA512:
6
- metadata.gz: 0bfad81b0998eef1fd58a6746235ac4e0a776108c8a4ef1188cd9721cce66786fcd0ab87daba990223fed47ad0c0a180f3e6d23b0cd8658d674f8c9625195971
7
- data.tar.gz: b50bf6994384ae57779784bfa7d36ca700a7241e9658801a181d450e214f0367cd7c828f606c3e4129465bfd2ffe69d7005affced12dfa2f7ea35ee6a2bb253d
6
+ metadata.gz: bd9b3c0df423ca7e9becc4e61857074fca9aae43cef87730a1ad13c5300b089b202d0665d5db1a6ac591bac9adf6c2dcc6d43a4df0844c044322771459dac900
7
+ data.tar.gz: a8432aadffe6791e42570a4a0aed12891032a6375af8e8fc473bb569fd66504f53a0a10dd186d5f1b30c5cd14af9757b871be66dd1b8a7d906d3b6ac88fae581
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dji_mqtt_connect (0.1.16.2)
4
+ dji_mqtt_connect (0.1.17)
5
5
  activesupport (>= 6.0, <= 8)
6
6
  dry-struct (~> 1.6)
7
7
  dry-transformer (~> 1.0)
@@ -11,19 +11,20 @@ PATH
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- activejob (7.0.6)
15
- activesupport (= 7.0.6)
14
+ activejob (7.0.8)
15
+ activesupport (= 7.0.8)
16
16
  globalid (>= 0.3.6)
17
- activesupport (7.0.6)
17
+ activesupport (7.0.8)
18
18
  concurrent-ruby (~> 1.0, >= 1.0.2)
19
19
  i18n (>= 1.6, < 2)
20
20
  minitest (>= 5.1)
21
21
  tzinfo (~> 2.0)
22
22
  ast (2.4.2)
23
+ base64 (0.1.1)
23
24
  concurrent-ruby (1.2.2)
24
25
  diff-lcs (1.5.0)
25
26
  docile (1.4.0)
26
- dry-core (1.0.0)
27
+ dry-core (1.0.1)
27
28
  concurrent-ruby (~> 1.0)
28
29
  zeitwerk (~> 2.6)
29
30
  dry-inflector (1.0.0)
@@ -44,15 +45,15 @@ GEM
44
45
  dry-inflector (~> 1.0)
45
46
  dry-logic (~> 1.4)
46
47
  zeitwerk (~> 2.6)
47
- globalid (1.1.0)
48
- activesupport (>= 5.0)
48
+ globalid (1.2.1)
49
+ activesupport (>= 6.1)
49
50
  i18n (1.14.1)
50
51
  concurrent-ruby (~> 1.0)
51
52
  ice_nine (0.11.2)
52
53
  json (2.6.3)
53
54
  language_server-protocol (3.17.0.3)
54
55
  lint_roller (1.1.0)
55
- minitest (5.18.1)
56
+ minitest (5.20.0)
56
57
  mqtt (0.6.0)
57
58
  parallel (1.23.0)
58
59
  parser (3.2.2.3)
@@ -62,7 +63,7 @@ GEM
62
63
  rainbow (3.1.1)
63
64
  rake (13.0.6)
64
65
  regexp_parser (2.8.1)
65
- rexml (3.2.5)
66
+ rexml (3.2.6)
66
67
  rspec (3.12.0)
67
68
  rspec-core (~> 3.12.0)
68
69
  rspec-expectations (~> 3.12.0)
@@ -76,28 +77,30 @@ GEM
76
77
  diff-lcs (>= 1.2.0, < 2.0)
77
78
  rspec-support (~> 3.12.0)
78
79
  rspec-support (3.12.1)
79
- rubocop (1.52.1)
80
+ rubocop (1.56.4)
81
+ base64 (~> 0.1.1)
80
82
  json (~> 2.3)
83
+ language_server-protocol (>= 3.17.0)
81
84
  parallel (~> 1.10)
82
85
  parser (>= 3.2.2.3)
83
86
  rainbow (>= 2.2.2, < 4.0)
84
87
  regexp_parser (>= 1.8, < 3.0)
85
88
  rexml (>= 3.2.5, < 4.0)
86
- rubocop-ast (>= 1.28.0, < 2.0)
89
+ rubocop-ast (>= 1.28.1, < 2.0)
87
90
  ruby-progressbar (~> 1.7)
88
91
  unicode-display_width (>= 2.4.0, < 3.0)
89
92
  rubocop-ast (1.29.0)
90
93
  parser (>= 3.2.1.0)
91
- rubocop-capybara (2.18.0)
94
+ rubocop-capybara (2.19.0)
92
95
  rubocop (~> 1.41)
93
- rubocop-factory_bot (2.23.1)
96
+ rubocop-factory_bot (2.24.0)
94
97
  rubocop (~> 1.33)
95
- rubocop-performance (1.18.0)
98
+ rubocop-performance (1.19.1)
96
99
  rubocop (>= 1.7.0, < 2.0)
97
100
  rubocop-ast (>= 0.4.0)
98
101
  rubocop-rake (0.6.0)
99
102
  rubocop (~> 1.0)
100
- rubocop-rspec (2.22.0)
103
+ rubocop-rspec (2.24.1)
101
104
  rubocop (~> 1.33)
102
105
  rubocop-capybara (~> 2.17)
103
106
  rubocop-factory_bot (~> 2.22)
@@ -108,23 +111,24 @@ GEM
108
111
  simplecov_json_formatter (~> 0.1)
109
112
  simplecov-html (0.12.3)
110
113
  simplecov_json_formatter (0.1.4)
111
- standard (1.30.1)
114
+ standard (1.31.1)
112
115
  language_server-protocol (~> 3.17.0.2)
113
116
  lint_roller (~> 1.0)
114
- rubocop (~> 1.52.0)
117
+ rubocop (~> 1.56.2)
115
118
  standard-custom (~> 1.0.0)
116
- standard-performance (~> 1.1.0)
117
- standard-custom (1.0.1)
119
+ standard-performance (~> 1.2)
120
+ standard-custom (1.0.2)
118
121
  lint_roller (~> 1.0)
119
- standard-performance (1.1.1)
122
+ rubocop (~> 1.50)
123
+ standard-performance (1.2.0)
120
124
  lint_roller (~> 1.1)
121
- rubocop-performance (~> 1.18.0)
125
+ rubocop-performance (~> 1.19.0)
122
126
  tzinfo (2.0.6)
123
127
  concurrent-ruby (~> 1.0)
124
- unicode-display_width (2.4.2)
128
+ unicode-display_width (2.5.0)
125
129
  wisper (2.0.1)
126
130
  wisper-rspec (1.1.0)
127
- zeitwerk (2.6.8)
131
+ zeitwerk (2.6.12)
128
132
 
129
133
  PLATFORMS
130
134
  arm64-darwin-22
@@ -0,0 +1,7 @@
1
+ ---
2
+ :en:
3
+ :dji_mqtt_connect:
4
+ :flighttask_status:
5
+ partially_done: Partially Done
6
+ in_progress: In Progress
7
+ ok: "OK"
@@ -0,0 +1,187 @@
1
+ ---
2
+ :en:
3
+ :dji_mqtt_connect:
4
+ :result_codes:
5
+ default: "Something went wrong..."
6
+ :0: "OK"
7
+ :314000: Operation not supported. Check device status.
8
+ :314001: Failed to distribute task. Try again later.
9
+ :314002: Failed to distribute task. Try again later.
10
+ :314003: Flight route file format not supported. Check file.
11
+ :314004: Failed to distribute task. Try again later or restart dock and try again.
12
+ :314005: Failed to distribute task. Try again later or restart dock and try again.
13
+ :314006: Failed to initiate aircraft. Restart dock and try again.
14
+ :314007: Failed to distribute flight route file from dock to aircraft. Restart dock and try again.
15
+ :314008: Aircraft task preparation timed out. Restart dock and try again.
16
+ :314009: Failed to initiate aircraft. Restart dock and try again.
17
+ :314010: Unable to perform task. Restart dock and try again.
18
+ :314011: Dock system error. Unable to obtain task result.
19
+ :314012: Aircraft task preparation failed. Unable to perform task. Restart dock and try again.
20
+ :314013: Failed to distribute task. Dock unable to obtain flight route file and perform task. Try again later.
21
+ :314014: Dock system error. Failed to perform task. Try again later.
22
+ :314015: Failed to distribute AI-Spot Check flight route from dock to aircraft. Unable to perform task. Try again later or restart dock and try again.
23
+ :314016: Failed to process flight route file. Unable to perform task. Check file.
24
+ :314017: Dock system error. Failed to perform task. Try again later.
25
+ :314018: Aircraft RTK positioning error. Unable to perform task. Try again later or restart dock and try again.
26
+ :314019: Failed to converge aircraft RTK data. Unable to perform task. Try again later or restart dock and try again.
27
+ :314020: Aircraft not in the middle of landing pad or aircraft heading incorrect. Unable to perform task. Check aircraft position and heading.
28
+ :314021: Aircraft RTK positioning error. Unable to perform task. Try again later or restart dock and try again.
29
+ :316001: Failed to configure aircraft parameters. Restart dock and try again.
30
+ :316002: Failed to configure aircraft parameters. Restart dock and try again.
31
+ :316003: Failed to configure aircraft parameters. Restart dock and try again.
32
+ :316004: Failed to configure aircraft parameters. Restart dock and try again.
33
+ :316005: Failed to converge aircraft RTK data. Unable to perform task. Restart dock and try again.
34
+ :316006: Aircraft unable to land on dock. Dock cover closed or driving rods pushed into place. Check aircraft status on dock deployment site.
35
+ :316007: Failed to initiate aircraft. Restart dock and try again.
36
+ :316008: Dock failed to obtain aircraft flight control. Unable to perform task. Make sure flight control not locked by remote controller.
37
+ :316009: Aircraft battery level lower than 30%. Unable to perform task. It is recommended to charged battery up to 50% before trying again.
38
+ :316010: Aircraft not detected. Unable to perform task. Check if aircraft is inside dock and linked to dock, or restart dock and try again.
39
+ :316011: Aircraft landed on incorrect location. Check if aircraft should be manually placed on dock deployment site.
40
+ :316012: Aircraft task preparation failed. Unable to perform task. Restart dock and try again.
41
+ :316013: Aircraft task preparation failed. Unable to perform task. Restart dock and try again.
42
+ :316014: Aircraft task preparation failed. Unable to perform task. Restart dock and try again.
43
+ :316015: Aircraft location calibrated by RTK device is far from dock. Unable to perform task. Restart dock and try again.
44
+ :316016: Aircraft landing on dock timed out. Aircraft and dock may be disconnected. Check livestream view to see if aircraft landed on dock.
45
+ :316017: Obtaining number of aircraft media files timed out. Aircraft and dock may be disconnected. Check livestream view to see if aircraft landed on dock.
46
+ :316018: Task performance timed out. Aircraft and dock may be disconnected. Check livestream view to see if aircraft landed on dock.
47
+ :316019: Internal server error. Unable to perform task. Try again later.
48
+ :316020: Aircraft RTK signal source error. Try again later.
49
+ :316021: Checking aircraft RTK signal source timed out. Try again later.
50
+ :316022: Aircraft unable to return to home. Check if aircraft is powered on, aircraft and dock are connected, and try again.
51
+ :316023: Aircraft controlled by Controller B and unable to return to home. Control aircraft from Controller B or power off remote controller and try again.
52
+ :316024: Aircraft failed to return to home. Check if aircraft has taken off and try again.
53
+ :316025: Failed to configure aircraft parameters. Try again later or restart dock and try again.
54
+ :316026: Dock emergency stop button pressed down. Unable to perform task. Release button and try again.
55
+ :316027: Setting aircraft parameters timed out. Try again later or restart dock and try again.
56
+ :316029: Dock emergency stop button pressed down. Aircraft flying to alternate landing site. Make sure aircraft has safely landed and place aircraft inside dock.
57
+ :317001: Failed to obtain number of aircraft media files. Restart dock and try again.
58
+ :317002: Failed to format aircraft storage. Make sure aircraft is powered on and connected to dock and camera can be detected. Or restart aircraft and try again.
59
+ :317003: Failed to format aircraft storage. Restart aircraft and try again.
60
+ :317004: Failed to format media files. Try again later or restart dock and try again.
61
+ :317005: Aircraft video recording terminated unsuccessfully, media files for this flight mission may not be able to be uploaded.
62
+ :319001: Unable to perform task. Dock is performing task or uploading issue logs. Wait until task is complete or logs uploaded and try again.
63
+ :319002: Dock system error. Restart dock and try again.
64
+ :319003: Dock system error. Distribute task again.
65
+ :319004: Performing task timed out. Task automatically stopped.
66
+ :319005: Communication error between cloud and dock. Unable to perform task.
67
+ :319006: Failed to cancel task. Task in progress.
68
+ :319007: Failed to edit task. Task in progress.
69
+ :319008: Dock and cloud time not synced. Dock unable to perform task.
70
+ :319009: Failed to distribute task. Try again later or restart dock and try again.
71
+ :319010: Dock firmware version too early. Unable to perform task. Update dock to latest version and try again.
72
+ :319015: Initializing dock. Unable to perform task. Wait until initialization is complete.
73
+ :319016: Dock performing other task. Unable to perform current task.
74
+ :319017: Dock processing media files captured in last task. Unable to perform current task. Try again later.
75
+ :319018: Unable to perform task. Dock uploading issue logs. Try again later.
76
+ :319019: Unable to perform task. Dock obtaining issue logs. Try again later.
77
+ :319025: Task in preparation. Dock unable to perform task distributed from cloud. Try again later.
78
+ :319026: Aircraft battery level lower than set value. Unable to perform task. Wait until charging completes and try again.
79
+ :319027: Insufficient storage on dock or aircraft. Unable to perform task. Wait until media files are uploaded to cloud and try again.
80
+ :319999: Dock system error. Restart dock and try again.
81
+ :321000: Task error. Try again later or restart dock and try again.
82
+ :321004: Failed to process flight route file. Unable to perform task. Check file.
83
+ :321005: Missing breakpoint info in flight route. Dock unable to perform task.
84
+ :321257: Task in progress. Failed to start task again.
85
+ :321258: Unable to stop task. Check aircraft status.
86
+ :321259: Task not started. Unable to stop task.
87
+ :321260: Task not started. Unable to pause task.
88
+ :321513: Unable to perform task. Flight route altitude greater than aircraft max flight altitude.
89
+ :321514: Failed to perform task. Flight route start or end point in buffer zone or exceeds distance limit.
90
+ :321515: Unable to perform task. Aircraft will fly across GEO Zone.
91
+ :321517: Obstacle sensed. Task stopped.
92
+ :321519: Aircraft approached GEO Zone or reached max distance and automatically returned to home. Unable to complete task.
93
+ :321523: Failed to start motors. Try again later. Contact DJI Support if issue persists.
94
+ :321524: The preparation before takeoff of the aircraft has failed, possibly due to the aircraft's inability to locate or gear error. Please check the status of the aircraft.
95
+ :321769: Aircraft satellite positioning signal weak. Unable to perform task. Restart dock and try again.
96
+ :321770: Aircraft flight mode error. Unable to perform task. Restart dock and try again.
97
+ :321771: Aircraft Home Point not set. Unable to perform task. Restart dock and try again.
98
+ :321772: Aircraft battery level lower than 30%. Unable to perform task. It is recommended to charged battery up to 50% before trying again.
99
+ :321773: Aircraft battery level low and returned to home. Unable to complete task.
100
+ :321775: Aircraft signal lost when performing task. Failed to complete task.
101
+ :321776: Failed to converge aircraft RTK data. Unable to perform task. Restart dock and try again.
102
+ :321777: Aircraft not hovering. Unable to start task.
103
+ :321778: Unable to perform task. Aircraft controlled by Controller B, and propellers started.
104
+ :322282: Task stopped. Aircraft control obtained by cloud user or Controller B.
105
+ :322283: RTH command sent by user. Aircraft unable to complete task.
106
+ :322539: Breakpoint info error. Dock unable to perform task.
107
+ :324012: Compressing logs timed out. Too many logs selected. Unselect some logs and try again.
108
+ :324013: Failed to obtain device log list. Try again later.
109
+ :324014: Device log list is empty. Refresh page or restart dock and try again.
110
+ :324015: Aircraft powered off or not connected. Unable to obtain log list. Make sure aircraft is inside dock. Remotely power on aircraft and try again.
111
+ :324016: Insufficient dock storage space. Failed to compress logs. Clear space or try again later.
112
+ :324017: Failed to compress logs. Unable to obtain logs of selected aircraft. Refresh page or restart dock and try again.
113
+ :324018: Failed to obtaining logs and submit issue report. Try again later or restart dock and try again.
114
+ :324019: Due to network anomalies at the airport, the log upload has failed. Please retry later. If this issue persists, please contact your agent or DJI Support for network troubleshooting.
115
+ :325001: Cloud command parameter error. Dock unable to execute command.
116
+ :327500: Failed to defog lens. Try again later.
117
+ :386535: Task error. Try again later or restart dock and try again.
118
+ :513001: Livestream failed. Aircraft does not exist or aircraft type error.
119
+ :513002: Livestream failed. Camera does not exist or camera type error.
120
+ :513003: Camera livestream in progress. Do not start livestream again.
121
+ :513005: Livestream failed. Livestream definition setting error.
122
+ :513006: Operation failed. Livestream not enabled.
123
+ :513008: Livestream failed. Image transmission data on device is abnormal.
124
+ :513010: Livestream failed. Device unable to connect to network.
125
+ :513011: Operation failed. Livestream not enabled.
126
+ :513012: Livestream failed. Device livestream in progress. Switching lens not supported.
127
+ :513013: Livestream failed. Video transmission protocol not supported.
128
+ :513014: Livestream failed. Livestream parameter error or incomplete.
129
+ :513015: Livestream error. Network lags.
130
+ :513016: Livestream error. Video decoding failed.
131
+ :513099: Livestream failed. Try again later.
132
+ :514100: Dock error. Restart dock and try again.
133
+ :514101: Failed to push driving rods into place. Make sure landing pad is clear of obstacles and aircraft heading is the same as arrow direction, or restart dock and try again.
134
+ :514102: Failed to pull driving rods back. Make sure landing pad is clear of obstacles or restart dock and try again.
135
+ :514103: Aircraft battery level lower than 30%. Unable to perform task. It is recommended to charged battery up to 50% before trying again.
136
+ :514104: Failed to charge battery. Restart dock and try again.
137
+ :514105: Failed to stop charging battery. Restart dock and try again.
138
+ :514106: Aircraft battery error. Restart dock and try again.
139
+ :514107: Failed to open dock cover. Make sure dock cover is clear of obstacles or restart dock and try again.
140
+ :514108: Failed to close dock cover. Make sure dock cover is clear of obstacles or restart dock and try again.
141
+ :514109: Failed to power on aircraft. Restart dock and try again.
142
+ :514110: Failed to power off aircraft. Restart dock and try again.
143
+ :514111: Propeller error in slow motion mode. Restart dock and try again.
144
+ :514112: Propeller error in slow motion mode. Restart dock and try again.
145
+ :514113: Connection error between driving rod and aircraft. Check if aircraft is inside dock, driving rods are stuck, or charging connector is stained or damaged.
146
+ :514114: Failed to obtain aircraft battery status. Restart dock and try again.
147
+ :514116: Unable to perform operation. Dock is executing other command. Try again later.
148
+ :514117: Dock cover is open or not fully closed. Restart dock and try again.
149
+ :514118: Driving rods pulled back or not pushed into place. Restart dock and try again.
150
+ :514120: Dock and aircraft disconnected. Restart dock and try again or relink dock and aircraft.
151
+ :514121: Emergency stop button pressed down. Release button.
152
+ :514122: Failed to obtain aircraft charging status. Restart dock and try again.
153
+ :514123: Aircraft battery level too low. Unable to power on aircraft.
154
+ :514124: Failed to obtain aircraft battery information. Unable to perform task. Restart dock and try again.
155
+ :514125: Aircraft battery level almost full. Unable to start charging. Charge battery when battery level is lower than 95%.
156
+ :514134: Heavy rainfall. Unable to perform task. Try again later.
157
+ :514135: Wind speed too high (≥12 m/s). Unable to perform task. Try again later.
158
+ :514136: Dock power supply error. Unable to perform task. Resume power supply and try again.
159
+ :514137: Environment temperature too low (< -20° C). Unable to perform task. Try again later.
160
+ :514138: Maintaining aircraft battery. Unable to perform task. Wait until maintenance is complete.
161
+ :514139: Failed to maintain aircraft battery. No maintenance required.
162
+ :514140: Failed to maintain aircraft battery. No maintenance required.
163
+ :514141: Dock system error. Restart dock and try again.
164
+ :514142: Connection error between driving rod and aircraft before takeoff. Check if aircraft is inside dock, driving rods are stuck, or charging connector is stained or damaged.
165
+ :514143: Driving rods pulled back or not pushed into place. Try again later or restart dock and try again.
166
+ :514144: Dock cover is open or not fully closed. Try again later or restart dock and try again.
167
+ :514145: Dock in onsite debugging mode. Unable to perform current operation or task. Disconnect dock from remote controller and try again.
168
+ :514146: Dock in remote debugging mode. Unable to perform task. Exit debugging mode and try again.
169
+ :514147: Updating device firmware. Unable to perform task. Wait until update is complete.
170
+ :514148: Task in progress. Dock unable to enter remote debugging mode or perform task again. Wait until current task is complete and try again.
171
+ :514149: Dock system error. Unable to perform task. Restart dock and try again.
172
+ :514150: Restarting device. Unable to perform task. Wait until restart is complete.
173
+ :514151: Updating device firmware. Unable to restart device. Wait until update is complete.
174
+ :514153: Dock exited remote debugging mode. Unable to perform current operation.
175
+ :514170: Initializing dock. Unable to perform operation. Wait until initialization completes.
176
+ :514171: Cloud command parameter error. Dock unable to execute command.
177
+ :514180: Failed to disable AC cooling or heating. Try again later.
178
+ :514181: Failed to enable AC cooling. Try again later.
179
+ :514182: Failed to enable AC heating. Try again later.
180
+ :514183: Failed to enable AC dehumidifying. Try again later.
181
+ :514184: Ambient temperature below 0° C. Unable to enable AC cooling.
182
+ :514185: Ambient temperature above 45° C. Unable to enable AC heating.
183
+ :514300: Gateway error.
184
+ :514301: Request timed out. Disconnected.
185
+ :514302: Network certificate error. Connection failed.
186
+ :514303: Network error. Disconnected.
187
+ :514304: Request rejected. Connection failed.
@@ -23,7 +23,9 @@ module DjiMqttConnect
23
23
  attribute :bid, Types::UUID
24
24
  attribute :timestamp, Types::Timestamp
25
25
  attribute :data do
26
- attribute :result, Types::Integer
26
+ include Mixins::ResultMessage
27
+
28
+ attribute :result, Types::ResultCode
27
29
  end
28
30
  end
29
31
  end
@@ -6,7 +6,9 @@ module DjiMqttConnect
6
6
  attribute :_method, Types::String.enum("cover_close")
7
7
 
8
8
  attribute :data do
9
- attribute :result, Types::Integer
9
+ include Mixins::ResultMessage
10
+
11
+ attribute :result, Types::ResultCode
10
12
 
11
13
  attribute :output do
12
14
  include Mixins::ServicesOutputStatusChecks
@@ -6,7 +6,9 @@ module DjiMqttConnect
6
6
  attribute :_method, Types::String.enum("cover_open")
7
7
 
8
8
  attribute :data do
9
- attribute :result, Types::Integer
9
+ include Mixins::ResultMessage
10
+
11
+ attribute :result, Types::ResultCode
10
12
 
11
13
  attribute :output do
12
14
  include Mixins::ServicesOutputStatusChecks
@@ -6,7 +6,9 @@ module DjiMqttConnect
6
6
  attribute :_method, Types::String.enum("device_reboot")
7
7
 
8
8
  attribute :data do
9
- attribute :result, Types::Integer
9
+ include Mixins::ResultMessage
10
+
11
+ attribute :result, Types::ResultCode
10
12
 
11
13
  attribute :output do
12
14
  include Mixins::ServicesOutputStatusChecks
@@ -6,6 +6,10 @@ module DjiMqttConnect
6
6
  attribute :_method, Types::String.enum("file_upload_callback")
7
7
 
8
8
  attribute :data do
9
+ include Mixins::ResultMessage
10
+
11
+ attribute :result, Types::ResultCode
12
+
9
13
  attribute :file do
10
14
  attribute :object_key, Types::String
11
15
 
@@ -45,8 +49,6 @@ module DjiMqttConnect
45
49
  end
46
50
  end
47
51
  end
48
-
49
- attribute :result, Types::Integer
50
52
  end
51
53
  end
52
54
  end
@@ -8,6 +8,10 @@ module DjiMqttConnect
8
8
  attribute :_method, Types::String.enum("flighttask_progress")
9
9
 
10
10
  attribute :data do
11
+ include Mixins::ResultMessage
12
+
13
+ attribute :result, Types::ResultCode
14
+
11
15
  attribute :output do
12
16
  attribute :ext do
13
17
  attribute :current_waypoint_index, Types::Integer
@@ -51,6 +55,10 @@ module DjiMqttConnect
51
55
  "timeout"
52
56
  )
53
57
 
58
+ def humanized_status
59
+ I18n.t(status, scope: "dji_mqtt_connect.flighttask_status", default: status.titleize)
60
+ end
61
+
54
62
  attribute :progress do
55
63
  # {"0-4":"MissionCenter starting, checking and resuming","5-18":"Waiting state","19, 20":"Task executing","21-29":"Returning to home","30-39":"Pulling logs","Others":"Interaction completed"}
56
64
  attribute :current_step, Types::Integer
@@ -59,8 +67,6 @@ module DjiMqttConnect
59
67
  attribute :percent, Types::Integer.constrained(gteq: 0, lteq: 100)
60
68
  end
61
69
  end
62
-
63
- attribute :result, Types::Integer
64
70
  end
65
71
  end
66
72
  end
@@ -32,7 +32,9 @@ module DjiMqttConnect
32
32
  )
33
33
 
34
34
  attribute :data do
35
- attribute :result, Types::Integer
35
+ include Mixins::ResultMessage
36
+
37
+ attribute :result, Types::ResultCode
36
38
  end
37
39
  end
38
40
  end
@@ -25,7 +25,10 @@ module DjiMqttConnect
25
25
  attribute :_method, Types::String.enum("airport_bind_status")
26
26
 
27
27
  attribute :data do
28
- attribute :result, Types::Integer
28
+ include Mixins::ResultMessage
29
+
30
+ attribute :result, Types::ResultCode
31
+
29
32
  attribute :output do
30
33
  attribute :bind_status, Types::Array do
31
34
  attribute :sn, Types::String
@@ -24,7 +24,10 @@ module DjiMqttConnect
24
24
  attribute :_method, Types::String.enum("airport_organization_bind")
25
25
 
26
26
  attribute :data do
27
- attribute :result, Types::Integer
27
+ include Mixins::ResultMessage
28
+
29
+ attribute :result, Types::ResultCode
30
+
28
31
  attribute :err_infos, Types::Array do
29
32
  attribute :sn, Types::String
30
33
 
@@ -24,7 +24,10 @@ module DjiMqttConnect
24
24
  attribute :_method, Types::String.enum("airport_organization_get")
25
25
 
26
26
  attribute :data do
27
- attribute :result, Types::Integer
27
+ include Mixins::ResultMessage
28
+
29
+ attribute :result, Types::ResultCode
30
+
28
31
  attribute :output do
29
32
  attribute :organization_name, Types::String
30
33
  end
@@ -27,7 +27,9 @@ module DjiMqttConnect
27
27
  attribute :_method, Types::String.enum("flighttask_resource_get")
28
28
 
29
29
  attribute :data do
30
- attribute :result, Types::Integer
30
+ include Mixins::ResultMessage
31
+
32
+ attribute :result, Types::ResultCode
31
33
 
32
34
  attribute :output do
33
35
  attribute :file do
@@ -24,7 +24,10 @@ module DjiMqttConnect
24
24
  attribute :_method, Types::String.enum("storage_config_get")
25
25
 
26
26
  attribute :data do
27
- attribute :result, Types::Integer
27
+ include Mixins::ResultMessage
28
+
29
+ attribute :result, Types::ResultCode
30
+
28
31
  attribute :output do
29
32
  attribute :bucket, Types::String
30
33
  attribute :credentials do
@@ -6,7 +6,9 @@ module DjiMqttConnect
6
6
  attribute :_method, Types::String.enum("alarm_state_switch")
7
7
 
8
8
  attribute :data do
9
- attribute :result, Types::Integer
9
+ include Mixins::ResultMessage
10
+
11
+ attribute :result, Types::ResultCode
10
12
 
11
13
  attribute :output do
12
14
  include Mixins::ServicesOutputStatusChecks
@@ -6,7 +6,9 @@ module DjiMqttConnect
6
6
  attribute :_method, Types::String.enum("cover_close")
7
7
 
8
8
  attribute :data do
9
- attribute :result, Types::Integer
9
+ include Mixins::ResultMessage
10
+
11
+ attribute :result, Types::ResultCode
10
12
 
11
13
  attribute :output do
12
14
  include Mixins::ServicesOutputStatusChecks
@@ -6,7 +6,9 @@ module DjiMqttConnect
6
6
  attribute :_method, Types::String.enum("cover_open")
7
7
 
8
8
  attribute :data do
9
- attribute :result, Types::Integer
9
+ include Mixins::ResultMessage
10
+
11
+ attribute :result, Types::ResultCode
10
12
 
11
13
  attribute :output do
12
14
  include Mixins::ServicesOutputStatusChecks
@@ -6,7 +6,9 @@ module DjiMqttConnect
6
6
  attribute :_method, Types::String.enum("debug_mode_close")
7
7
 
8
8
  attribute :data do
9
- attribute :result, Types::Integer
9
+ include Mixins::ResultMessage
10
+
11
+ attribute :result, Types::ResultCode
10
12
 
11
13
  attribute :output do
12
14
  include Mixins::ServicesOutputStatusChecks
@@ -6,7 +6,9 @@ module DjiMqttConnect
6
6
  attribute :_method, Types::String.enum("debug_mode_open")
7
7
 
8
8
  attribute :data do
9
- attribute :result, Types::Integer
9
+ include Mixins::ResultMessage
10
+
11
+ attribute :result, Types::ResultCode
10
12
 
11
13
  attribute :output do
12
14
  include Mixins::ServicesOutputStatusChecks
@@ -6,7 +6,9 @@ module DjiMqttConnect
6
6
  attribute :_method, Types::String.enum("return_home")
7
7
 
8
8
  attribute :data do
9
- attribute :result, Types::Integer
9
+ include Mixins::ResultMessage
10
+
11
+ attribute :result, Types::ResultCode
10
12
 
11
13
  attribute? :output do
12
14
  include Mixins::ServicesOutputStatusChecks
@@ -11,7 +11,9 @@ module DjiMqttConnect
11
11
  attribute :_method, Types::String
12
12
 
13
13
  attribute :data do
14
- attribute :result, Types::Integer
14
+ include Mixins::ResultMessage
15
+
16
+ attribute :result, Types::ResultCode
15
17
  end
16
18
 
17
19
  def to_s
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DjiMqttConnect
4
+ module Mixins
5
+ # Provides a result_message message that provides a human-readable message for result values
6
+ module ResultMessage
7
+ def result_message
8
+ Translations.result_message(result)
9
+ end
10
+ end
11
+ end
12
+ end
@@ -44,6 +44,10 @@ module DjiMqttConnect
44
44
  )
45
45
  end
46
46
 
47
+ def result_message(result)
48
+ I18n.translate(result, scope: "dji_mqtt_connect.result_codes", default: :default)
49
+ end
50
+
47
51
  def position_name(position)
48
52
  I18n.translate(position, scope: "dji_mqtt_connect.position", default: position)
49
53
  end
@@ -73,5 +73,8 @@ module DjiMqttConnect
73
73
  SERVICE_OUTPUT_STATUS_CANCELED = "canceled",
74
74
  SERVICE_OUTPUT_STATUS_TIMEOUT = "timeout"
75
75
  )
76
+
77
+ # Result for messages
78
+ ResultCode = Types::Integer.constrained(gteq: 0)
76
79
  end
77
80
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DjiMqttConnect
4
- VERSION = "0.1.16.2"
4
+ VERSION = "0.1.17"
5
5
  end
@@ -130,6 +130,7 @@ module DjiMqttConnect
130
130
  autoload :LatitudeConditional, "dji_mqtt_connect/mixins/latitude_conditional"
131
131
  autoload :LongitudeConditional, "dji_mqtt_connect/mixins/longitude_conditional"
132
132
  autoload :ServicesOutputStatusChecks, "dji_mqtt_connect/mixins/services_output_status_checks"
133
+ autoload :ResultMessage, "dji_mqtt_connect/mixins/result_message"
133
134
  autoload :TemperatureConditional, "dji_mqtt_connect/mixins/temperature_conditional"
134
135
  end
135
136
 
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.16.2
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sphere Drones
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-03 00:00:00.000000000 Z
11
+ date: 2023-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -103,8 +103,10 @@ files:
103
103
  - Gemfile.lock
104
104
  - README.md
105
105
  - Rakefile
106
+ - config/locales/flighttask_status.en.yml
106
107
  - config/locales/hms_event_codes.en.yml
107
108
  - config/locales/hms_event_codes.zh.yml
109
+ - config/locales/result_codes.en.yml
108
110
  - config/locales/services_output_status.en.yml
109
111
  - dji_mqtt_connect.gemspec
110
112
  - lib/dji_mqtt_connect.rb
@@ -188,6 +190,7 @@ files:
188
190
  - lib/dji_mqtt_connect/mixins/events_progress_checks.rb
189
191
  - lib/dji_mqtt_connect/mixins/latitude_conditional.rb
190
192
  - lib/dji_mqtt_connect/mixins/longitude_conditional.rb
193
+ - lib/dji_mqtt_connect/mixins/result_message.rb
191
194
  - lib/dji_mqtt_connect/mixins/services_output_status_checks.rb
192
195
  - lib/dji_mqtt_connect/mixins/temperature_conditional.rb
193
196
  - lib/dji_mqtt_connect/railtie.rb
@@ -231,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
231
234
  - !ruby/object:Gem::Version
232
235
  version: '0'
233
236
  requirements: []
234
- rubygems_version: 3.4.16
237
+ rubygems_version: 3.4.19
235
238
  signing_key:
236
239
  specification_version: 4
237
240
  summary: Manages MQTT Connections with DJI Drones