dji_mqtt_connect 0.1.38 → 0.1.39

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 55c8dc51144cdcf112ccb8d29d06928ddacf65ffffdd860bde73f5271a7f155c
4
- data.tar.gz: 63c5bebcc5c5f404b77e570533e9c588c06438096b1e64f70d2ac9dff49cc439
3
+ metadata.gz: 46ee9a9805803efb395c42306ad2b8b7a60f78b45731e0ba7ab6788f45b3142b
4
+ data.tar.gz: 80d648fcc793256d4a8a5e2d0cb4a8a38baa1467df6c951bcb33297166486638
5
5
  SHA512:
6
- metadata.gz: 85bdec67ccac88efb1bf43d96f708a16a886c46efdd70c12505b3cb22814825d85f024cb61ee2f3223b99f50067a5359920c03bf3c52414910782574e5abda01
7
- data.tar.gz: 3ce5493b1afd6bc2d08ae8128ca4a35fe4ed30dea1ce868b34021be5dbb8b66ef949c7c07e7f01b6d2ffab96905d2a29c83302c4cbe9f7091daa9a7d6526fdf6
6
+ metadata.gz: bc7c47e9496cd68e0bbe8478417f52a78cd60067748bc0091d39fa0f2068c5fda1a2840e3410e0b086ad581647b365c76e2c4f8d1a48c03c080210b27b179343
7
+ data.tar.gz: 145aee434ab1618320a1f31cdd39485966f1c91d24830689a786667dccef17e7ebb9a18293a74a54686d1148672fe8b58e919bfcd85c3803e1dd9215dd22eeb8
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DjiMqttConnect
4
+ module Factories::EventsMessages
5
+ ### Device Reboot ###
6
+
7
+ def build_thing_product_device_reboot_events_message(
8
+ result: 0,
9
+ status: "ok",
10
+ percent: 100,
11
+ current_step: nil,
12
+ step_key: nil,
13
+ step_result: nil,
14
+ total_steps: nil
15
+ )
16
+ progress = {
17
+ percent: percent,
18
+ current_step: current_step,
19
+ step_key: step_key,
20
+ step_result: step_result,
21
+ total_steps: total_steps
22
+ }.compact
23
+
24
+ message_data = {
25
+ result: result,
26
+ output: {
27
+ status: status,
28
+ progress: progress
29
+ }
30
+ }
31
+
32
+ Thing::Product::DeviceRebootEventsMessage.new(
33
+ bid: Message.generate_bid,
34
+ tid: Message.generate_tid,
35
+ timestamp: Message.current_timestamp,
36
+ _method: "device_reboot",
37
+ need_reply: 1,
38
+ data: message_data,
39
+ _data: message_data
40
+ )
41
+ end
42
+ end
43
+ end
@@ -50,28 +50,6 @@ module DjiMqttConnect
50
50
  )
51
51
  end
52
52
 
53
- def build_thing_product_device_reboot_events_message
54
- message_data = {
55
- result: 0,
56
- output: {
57
- status: "ok",
58
- progress: {
59
- percent: 100
60
- }
61
- }
62
- }
63
-
64
- Thing::Product::DeviceRebootEventsMessage.new(
65
- bid: Message.generate_bid,
66
- tid: Message.generate_tid,
67
- timestamp: Message.current_timestamp,
68
- _method: "device_reboot",
69
- need_reply: 1,
70
- data: message_data,
71
- _data: message_data
72
- )
73
- end
74
-
75
53
  def build_thing_product_drone_close_events_message
76
54
  message_data = {
77
55
  output: {
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DjiMqttConnect
4
+ module Factories
5
+ def build_thing_product_flight_areas_update_services_reply_message(result: 0)
6
+ message_data = {result: result}
7
+
8
+ Thing::Product::FlightAreasUpdateServicesReplyMessage.new(
9
+ bid: Message.generate_bid,
10
+ tid: Message.generate_tid,
11
+ timestamp: Message.current_timestamp,
12
+ _method: "flight_areas_update",
13
+ _data: message_data,
14
+ data: message_data
15
+ )
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DjiMqttConnect
4
+ module Factories
5
+ def build_thing_product_unlock_license_list_services_reply_message(
6
+ result: 0,
7
+ consistence: true,
8
+ device_model_domain: Types::DOCK_DOMAIN,
9
+ licenses: []
10
+ )
11
+ message_data = {
12
+ consistence: consistence,
13
+ device_model_domain: device_model_domain,
14
+ licenses: licenses,
15
+ result: result
16
+ }
17
+
18
+ Thing::Product::UnlockLicenseListServicesReplyMessage.new(
19
+ bid: Message.generate_bid,
20
+ tid: Message.generate_tid,
21
+ timestamp: Message.current_timestamp,
22
+ _method: "unlock_license_list",
23
+ _data: message_data,
24
+ data: message_data
25
+ )
26
+ end
27
+ end
28
+ end
@@ -51,20 +51,37 @@ module DjiMqttConnect
51
51
  attribute :return_home_power, Types::Integer
52
52
  end
53
53
  attribute? :distance_limit_status do
54
- attribute :distance_limit, Types::Integer
54
+ attribute :distance_limit, Types::DistanceLimit | Types::Integer
55
55
 
56
56
  # {"0":"Not reached","1":"Reached"}
57
- attribute? :is_near_distance_limit, Types::Integer.enum(0, 1)
57
+ attribute? :is_near_distance_limit, Types::IsNearDistanceLimit
58
58
 
59
59
  # {"0":"Not set","1":"Have been set"}
60
- attribute :state, Types::Integer.enum(0, 1)
60
+ attribute :state, Types::DistanceLimitState
61
+
62
+ def distance_limit?
63
+ Types::DistanceLimit.valid?(distance_limit)
64
+ end
65
+
66
+ def distance_limit_set?
67
+ state == Types::DISTANCE_LIMIT_STATE_SET
68
+ end
69
+
70
+ def is_near_distance_limit?
71
+ is_near_distance_limit == Types::DISTANCE_LIMIT_REACHED
72
+ end
61
73
  end
62
74
  attribute :elevation, Types::JSON::Decimal
63
75
 
64
76
  attribute? :firmware_version, Types::String | Types::Nil
65
77
  attribute :gear, Types::Integer
66
78
  attribute :height, Types::JSON::Decimal
67
- attribute? :height_limit, Types::JSON::Decimal
79
+ attribute? :height_limit, Types::HeightLimit | Types::JSON::Decimal
80
+
81
+ def height_limit?
82
+ Types::HeightLimit.valid?(height_limit)
83
+ end
84
+
68
85
  attribute :home_distance, Types::JSON::Decimal
69
86
  attribute :horizontal_speed, Types::JSON::Decimal
70
87
 
@@ -220,10 +237,19 @@ module DjiMqttConnect
220
237
  # {"0":"Continue to execute the wayline task","1":"Exit the wayline task, and execute the remote controller out of control action."}
221
238
  attribute? :exit_wayline_when_rc_lost, Types::ExitWaylineWhenRcLost
222
239
 
223
- attribute? :is_near_area_limit, Types::Integer.enum(0, 1)
240
+ # {"0":"Not reached","1":"Reached"}
241
+ attribute? :is_near_area_limit, Types::IsNearAreaLimit
242
+
243
+ def is_near_area_limit?
244
+ is_near_area_limit == Types::AREA_LIMIT_REACHED
245
+ end
224
246
 
225
247
  # {"0":"Not reached","1":"Reached"}
226
- attribute? :is_near_height_limit, Types::Integer.enum(0, 1)
248
+ attribute? :is_near_height_limit, Types::IsNearHeightLimit
249
+
250
+ def is_near_height_limit?
251
+ is_near_height_limit == Types::HEIGHT_LIMIT_REACHED
252
+ end
227
253
 
228
254
  attribute? :maintain_status do
229
255
  attribute :maintain_status_array, Types::Array do
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DjiMqttConnect
4
+ module Thing::Product
5
+ # Custom flight area update
6
+ # https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock1/custom_fly_area.html
7
+ class FlightAreasUpdateServicesReplyMessage < ServicesReplyMessage
8
+ attribute :_method, Types::String.enum("flight_areas_update")
9
+
10
+ attribute :data do
11
+ attribute :result, Types::ResultCode
12
+ include Mixins::ResultCode
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DjiMqttConnect
4
+ module Thing::Product
5
+ # Lists the unlock licenses a device holds, for flying in restricted zones
6
+ # NOTE: typed from captured replies, as DJI's reference for this service could not be checked
7
+ class UnlockLicenseListServicesReplyMessage < ServicesReplyMessage
8
+ attribute :_method, Types::String.enum("unlock_license_list")
9
+
10
+ attribute :data do
11
+ attribute :result, Types::ResultCode
12
+ include Mixins::ResultCode
13
+
14
+ attribute? :consistence, Types::Bool
15
+
16
+ # The domain of the device the licenses were listed for
17
+ attribute? :device_model_domain, Types::DeviceDomain
18
+
19
+ # NOTE: kept as hashes until a reply with licenses is captured, as their fields are unknown
20
+ attribute :licenses, Types::Array.of(Types::Hash).default([].freeze)
21
+ end
22
+ end
23
+ end
24
+ end
@@ -100,6 +100,40 @@ module DjiMqttConnect
100
100
  DOCK_MODE_CODE_TERRAIN_OBSTACLE_UPDATE = 51
101
101
  )
102
102
 
103
+ # {"0":"Not set","1":"Have been set"}
104
+ DistanceLimitState = Types::Integer.enum(
105
+ DISTANCE_LIMIT_STATE_NOT_SET = 0,
106
+ DISTANCE_LIMIT_STATE_SET = 1
107
+ )
108
+
109
+ # {"0":"Not reached","1":"Reached"}
110
+ IsNearDistanceLimit = Types::Integer.enum(
111
+ DISTANCE_LIMIT_NOT_REACHED = 0,
112
+ DISTANCE_LIMIT_REACHED = 1
113
+ )
114
+
115
+ # {"0":"Not reached","1":"Reached"}
116
+ IsNearHeightLimit = Types::Integer.enum(
117
+ HEIGHT_LIMIT_NOT_REACHED = 0,
118
+ HEIGHT_LIMIT_REACHED = 1
119
+ )
120
+
121
+ # {"0":"Not reached","1":"Reached"}
122
+ IsNearAreaLimit = Types::Integer.enum(
123
+ AREA_LIMIT_NOT_REACHED = 0,
124
+ AREA_LIMIT_REACHED = 1
125
+ )
126
+
127
+ # {"max":"1500","min":"20","unit_name":"Meters / m"}
128
+ HEIGHT_LIMIT_MIN = 20
129
+ HEIGHT_LIMIT_MAX = 1500
130
+ HeightLimit = Types::JSON::Decimal.constrained(gteq: HEIGHT_LIMIT_MIN, lteq: HEIGHT_LIMIT_MAX)
131
+
132
+ # {"max":"8000","min":"15","unit_name":"Meters / m"}
133
+ DISTANCE_LIMIT_MIN = 15
134
+ DISTANCE_LIMIT_MAX = 8000
135
+ DistanceLimit = Types::Integer.constrained(gteq: DISTANCE_LIMIT_MIN, lteq: DISTANCE_LIMIT_MAX)
136
+
103
137
  # {"0":"Standby","1":"Takeoff preparation","2":"Takeoff preparation completed","3":"Manual flight","4":"Automatic takeoff","5":"Wayline flight","6":"Panoramic photography","7":"Intelligent tracking","8":"ADS-B avoidance","9":"Auto returning to home","10":"Automatic landing","11":"Forced landing","12":"Three-blade landing","13":"Upgrading","14":"Not connected","15":"APAS","16":"Virtual stick state","17":"Live Flight Controls","18":"Airborne RTK fixing mode","19":"Dock address selecting","20":"POI"}
104
138
  DroneModeCode = Types::Integer.enum(
105
139
  DRONE_MODE_STANDBY = 0,
@@ -417,7 +451,9 @@ module DjiMqttConnect
417
451
  "stop_charge",
418
452
  "plc_check",
419
453
  # NOTE: undocumented, reported by charge_open events
420
- "start_charge"
454
+ "start_charge",
455
+ # NOTE: undocumented, reported by device_reboot events
456
+ "upgrading_prevent_reboot"
421
457
  )
422
458
 
423
459
  NetworkStateType = Integer.enum(
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DjiMqttConnect
4
- VERSION = "0.1.38"
4
+ VERSION = "0.1.39"
5
5
  end
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.38
4
+ version: 0.1.39
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sphere Drones
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-11-06 00:00:00.000000000 Z
11
+ date: 2026-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -150,6 +150,7 @@ files:
150
150
  - lib/dji_mqtt_connect/factories/events/cover_force_close.rb
151
151
  - lib/dji_mqtt_connect/factories/events/cover_open.rb
152
152
  - lib/dji_mqtt_connect/factories/events/device_format.rb
153
+ - lib/dji_mqtt_connect/factories/events/device_reboot.rb
153
154
  - lib/dji_mqtt_connect/factories/events/drc_status_notify.rb
154
155
  - lib/dji_mqtt_connect/factories/events/drone_format.rb
155
156
  - lib/dji_mqtt_connect/factories/events/esim_activate.rb
@@ -212,10 +213,12 @@ files:
212
213
  - lib/dji_mqtt_connect/factories/services/supplement_light_open.rb
213
214
  - lib/dji_mqtt_connect/factories/services/video_storage_set.rb
214
215
  - lib/dji_mqtt_connect/factories/services_messages.rb
216
+ - lib/dji_mqtt_connect/factories/services_reply/flight_areas_update.rb
215
217
  - lib/dji_mqtt_connect/factories/services_reply/fly_to_point.rb
216
218
  - lib/dji_mqtt_connect/factories/services_reply/fly_to_point_stop.rb
217
219
  - lib/dji_mqtt_connect/factories/services_reply/fly_to_point_update.rb
218
220
  - lib/dji_mqtt_connect/factories/services_reply/live_camera_change.rb
221
+ - lib/dji_mqtt_connect/factories/services_reply/unlock_license_list.rb
219
222
  - lib/dji_mqtt_connect/factories/state_messages.rb
220
223
  - lib/dji_mqtt_connect/marshals/sys/product/status_marshal.rb
221
224
  - lib/dji_mqtt_connect/marshals/sys/product/status_reply_marshal.rb
@@ -412,6 +415,7 @@ files:
412
415
  - lib/dji_mqtt_connect/messages/thing/product/services_reply/fileupload_list.rb
413
416
  - lib/dji_mqtt_connect/messages/thing/product/services_reply/fileupload_start.rb
414
417
  - lib/dji_mqtt_connect/messages/thing/product/services_reply/fileupload_update.rb
418
+ - lib/dji_mqtt_connect/messages/thing/product/services_reply/flight_areas_update.rb
415
419
  - lib/dji_mqtt_connect/messages/thing/product/services_reply/flight_authority_grab.rb
416
420
  - lib/dji_mqtt_connect/messages/thing/product/services_reply/flighttask_execute.rb
417
421
  - lib/dji_mqtt_connect/messages/thing/product/services_reply/flighttask_pause.rb
@@ -444,6 +448,7 @@ files:
444
448
  - lib/dji_mqtt_connect/messages/thing/product/services_reply/supplement_light_close.rb
445
449
  - lib/dji_mqtt_connect/messages/thing/product/services_reply/supplement_light_open.rb
446
450
  - lib/dji_mqtt_connect/messages/thing/product/services_reply/takeoff_to_point.rb
451
+ - lib/dji_mqtt_connect/messages/thing/product/services_reply/unlock_license_list.rb
447
452
  - lib/dji_mqtt_connect/messages/thing/product/services_reply/video_storage_set.rb
448
453
  - lib/dji_mqtt_connect/messages/thing/product/services_reply_message.rb
449
454
  - lib/dji_mqtt_connect/messages/thing/product/state_message.rb