dji_mqtt_connect 0.1.36.1 → 0.1.36.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CLAUDE.md +13 -0
- data/config/locales/thing_product_events.en.yml +16 -0
- data/lib/dji_mqtt_connect/factories/events/drc_status_notify.rb +25 -0
- data/lib/dji_mqtt_connect/factories/events/joystick_invalid_notify.rb +22 -0
- data/lib/dji_mqtt_connect/messages/thing/product/events/drc_status_notify.rb +38 -0
- data/lib/dji_mqtt_connect/messages/thing/product/events/joystick_invalid_notify.rb +47 -0
- data/lib/dji_mqtt_connect/mixins/timestamp_or_current.rb +12 -0
- data/lib/dji_mqtt_connect/version.rb +1 -1
- metadata +8 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 940329d2cd6cc1a579fda21b7d6325a9731ccf4b0834773fd47a5aab77653374
|
|
4
|
+
data.tar.gz: 1d7197e5354a9cfad990ec0a8c27fbf358ae6a8ed4def7327321363e20c0db27
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 229a6017739b1c560fedca7f24bf7f6b4a4821d02a88c0f328a1b145dabeab8e084566d7cbba36ba1a4022b28c2f22c3cca3c8130f06c5e1f5de1f72ad29916c
|
|
7
|
+
data.tar.gz: 2480edeb9ed44f2b5c03c2f5db02532af5ccd8437da71c8d807120ebf8edf48dd5bd5416c907a0f076facd8b990c6d9d119c6358b38df49d76694e5370d6bcb4
|
data/CLAUDE.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
Notes for Claude Code and other agents working in this repository.
|
|
4
|
+
|
|
5
|
+
## Versioning
|
|
6
|
+
|
|
7
|
+
Do not bump the version in `lib/dji_mqtt_connect/version.rb`.
|
|
8
|
+
|
|
9
|
+
Releases are cut by a maintainer: the version bump, the git tag, and the push to
|
|
10
|
+
rubygems.org happen together (see the Development section of the README). A
|
|
11
|
+
version bump in a feature branch either conflicts with that release commit or
|
|
12
|
+
ships a version number that was never published, so leave `VERSION` alone and
|
|
13
|
+
let the maintainer decide what the change is worth.
|
|
@@ -11,6 +11,7 @@ en:
|
|
|
11
11
|
device_exit_homing_notify: "Device is exiting return to home: %{action} (%{reason})"
|
|
12
12
|
device_format: "Dock Data Formatting: %{status} (%{percent}%)"
|
|
13
13
|
device_reboot: "Rebooting device: %{status} (%{current_step}/%{total_steps} %{percent}%)"
|
|
14
|
+
drc_status_notify: "Live Flight Controls: %{drc_state}"
|
|
14
15
|
drone_close: "Aircraft shutdown: %{status} (%{percent}%)"
|
|
15
16
|
drone_format: "Aircraft Data Formatting: %{status} (%{percent}%)"
|
|
16
17
|
drone_open: "Aircraft Power-on: %{status}"
|
|
@@ -23,6 +24,7 @@ en:
|
|
|
23
24
|
flighttask_progress_with_break_point: "Flight Halted: %{break_reason} [%{current_step}] (%{status} %{percent}%)"
|
|
24
25
|
fly_to_point_progress: "Fly to Point: %{status} (%{way_point_index}/- | %{remaining_time} sec | %{remaining_distance} left)"
|
|
25
26
|
highest_priority_upload_flighttask_media: "Highest priority flight task media upload"
|
|
27
|
+
joystick_invalid_notify: "Joystick control is invalid: %{reason}"
|
|
26
28
|
offline_map_sync_progress: "Syncing offline maps: %{status} (%{reason})"
|
|
27
29
|
rtk_calibration: "RTK Calibration: %{status} (%{percent}%)"
|
|
28
30
|
takeoff_to_point_progress: "Takeoff to Point: %{status} (%{way_point_index}/- | %{remaining_time} sec | %{remaining_distance} left)"
|
|
@@ -46,6 +48,12 @@ en:
|
|
|
46
48
|
:9: "Short-distance backtracking"
|
|
47
49
|
:10: "Return triggered at close range"
|
|
48
50
|
|
|
51
|
+
thing_product_drc_status_notify_events_message:
|
|
52
|
+
humanized_drc_state:
|
|
53
|
+
:0: "Not connected"
|
|
54
|
+
:1: "Connecting"
|
|
55
|
+
:2: "Connected"
|
|
56
|
+
|
|
49
57
|
thing_product_fileupload_progress_events_message:
|
|
50
58
|
humanized_module:
|
|
51
59
|
:0: Aircraft
|
|
@@ -74,3 +82,11 @@ en:
|
|
|
74
82
|
:7: "Wayline interrupted. Triggered conditions are 1 for User actively pauses and 2 for Flight control abnormality"
|
|
75
83
|
:8: "Wayline recovery"
|
|
76
84
|
:9: "Wayline completed"
|
|
85
|
+
|
|
86
|
+
thing_product_joystick_invalid_notify_events_message:
|
|
87
|
+
humanized_reason:
|
|
88
|
+
:0: "Remote controller lost connection"
|
|
89
|
+
:1: "Low battery return"
|
|
90
|
+
:2: "Low battery landing"
|
|
91
|
+
:3: "Close to the flight restriction zone"
|
|
92
|
+
:4: "Remote controller took over control authority"
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Factories::EventsMessages
|
|
5
|
+
### DRC Status Notify ###
|
|
6
|
+
|
|
7
|
+
def build_thing_product_drc_status_notify_events_message
|
|
8
|
+
message_data = {
|
|
9
|
+
result: 0,
|
|
10
|
+
drc_state: 2
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
Thing::Product::DrcStatusNotifyEventsMessage.new(
|
|
14
|
+
bid: Message.generate_bid,
|
|
15
|
+
tid: Message.generate_tid,
|
|
16
|
+
timestamp: Message.current_timestamp,
|
|
17
|
+
_method: "drc_status_notify",
|
|
18
|
+
need_reply: 1,
|
|
19
|
+
gateway: "GATEWAYSN",
|
|
20
|
+
data: message_data,
|
|
21
|
+
_data: message_data
|
|
22
|
+
)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Factories::EventsMessages
|
|
5
|
+
def build_thing_product_joystick_invalid_notify_events_message
|
|
6
|
+
message_data = {
|
|
7
|
+
reason: 0
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
Thing::Product::JoystickInvalidNotifyEventsMessage.new(
|
|
11
|
+
bid: Message.generate_bid,
|
|
12
|
+
tid: Message.generate_tid,
|
|
13
|
+
timestamp: Message.current_timestamp,
|
|
14
|
+
_method: "joystick_invalid_notify",
|
|
15
|
+
need_reply: 1,
|
|
16
|
+
gateway: "GATEWAYSN",
|
|
17
|
+
data: message_data,
|
|
18
|
+
_data: message_data
|
|
19
|
+
)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Thing::Product
|
|
5
|
+
# Notification of the live flight controls (DRC) link state
|
|
6
|
+
# https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock2/drc.html
|
|
7
|
+
class DrcStatusNotifyEventsMessage < EventsMessage
|
|
8
|
+
attribute :_method, Types::String.enum("drc_status_notify")
|
|
9
|
+
|
|
10
|
+
# NOTE: DJI sometimes omits the timestamp for a drc_status_notify events message
|
|
11
|
+
attribute? :timestamp, Types::TimestampMS
|
|
12
|
+
|
|
13
|
+
attribute :data do
|
|
14
|
+
attribute :result, Types::ResultCode
|
|
15
|
+
include Mixins::ResultCode
|
|
16
|
+
|
|
17
|
+
# {"0":"Not connected","1":"Connecting","2":"Connected"}
|
|
18
|
+
attribute :drc_state, Types::Coercible::Integer.enum(
|
|
19
|
+
DRC_STATE_NOT_CONNECTED = 0,
|
|
20
|
+
DRC_STATE_CONNECTING = 1,
|
|
21
|
+
DRC_STATE_CONNECTED = 2
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
def drc_connected?
|
|
25
|
+
drc_state == DRC_STATE_CONNECTED
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def humanized_drc_state
|
|
29
|
+
I18n.t(drc_state, scope: "dji_mqtt_connect.thing_product_drc_status_notify_events_message.humanized_drc_state", default: "-")
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def humanized_summary_interpolation
|
|
34
|
+
super.merge(drc_state: data.humanized_drc_state)
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Thing::Product
|
|
5
|
+
# Notification of joystick control invalidity reasons
|
|
6
|
+
# https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/drc.html#notification-of-joystick-control-invalidity-reasons
|
|
7
|
+
# https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock2/drc.html#notification-of-joystick-control-invalidity-reasons
|
|
8
|
+
class JoystickInvalidNotifyEventsMessage < EventsMessage
|
|
9
|
+
REMOTE_CONTROLLER_LOST_CONNECTION_REASON = 0
|
|
10
|
+
LOW_BATTERY_RETURN_REASON = 1
|
|
11
|
+
LOW_BATTERY_LANDING_REASON = 2
|
|
12
|
+
CLOSE_TO_THE_FLIGHT_RESTRICTION_ZONE_REASON = 3
|
|
13
|
+
REMOTE_CONTROLLER_TAKEOVER_CONTROL_AUTHORITY_REASON = 4
|
|
14
|
+
|
|
15
|
+
Reason = Types::Coercible::Integer.enum(
|
|
16
|
+
REMOTE_CONTROLLER_LOST_CONNECTION_REASON,
|
|
17
|
+
LOW_BATTERY_RETURN_REASON,
|
|
18
|
+
LOW_BATTERY_LANDING_REASON,
|
|
19
|
+
CLOSE_TO_THE_FLIGHT_RESTRICTION_ZONE_REASON,
|
|
20
|
+
REMOTE_CONTROLLER_TAKEOVER_CONTROL_AUTHORITY_REASON
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
attribute :_method, Types::String.enum("joystick_invalid_notify")
|
|
24
|
+
|
|
25
|
+
attribute :data do
|
|
26
|
+
# {"0":"Remote controller lost connection","1":"Low battery return","2":"Low battery landing","3":"Close to the flight restriction zone","4":"Remote controller takeover control authority (for example, triggered return, B control takeover)"}
|
|
27
|
+
attribute :reason, Reason | Types::Coercible::Integer
|
|
28
|
+
|
|
29
|
+
def reason?
|
|
30
|
+
Reason.valid?(reason)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def humanized_reason
|
|
34
|
+
if reason?
|
|
35
|
+
I18n.t(reason, scope: "dji_mqtt_connect.thing_product_joystick_invalid_notify_events_message.humanized_reason")
|
|
36
|
+
else
|
|
37
|
+
reason.to_s
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def humanized_summary_interpolation
|
|
43
|
+
super.merge(reason: data.humanized_reason)
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Mixins
|
|
5
|
+
# Provides a fallback to the current timestamp for messages where DJI sometimes omits the timestamp field
|
|
6
|
+
module TimestampOrCurrent
|
|
7
|
+
def timestamp_or_current
|
|
8
|
+
timestamp || Message.current_timestamp
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
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.36.
|
|
4
|
+
version: 0.1.36.2
|
|
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-08
|
|
11
|
+
date: 2026-09-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -113,6 +113,7 @@ files:
|
|
|
113
113
|
- ".rubocop/strict.yml"
|
|
114
114
|
- ".rubocop/style.yml"
|
|
115
115
|
- CHANGELOG.md
|
|
116
|
+
- CLAUDE.md
|
|
116
117
|
- Gemfile
|
|
117
118
|
- README.md
|
|
118
119
|
- Rakefile
|
|
@@ -146,9 +147,11 @@ files:
|
|
|
146
147
|
- lib/dji_mqtt_connect/factories/events/cover_force_close.rb
|
|
147
148
|
- lib/dji_mqtt_connect/factories/events/cover_open.rb
|
|
148
149
|
- lib/dji_mqtt_connect/factories/events/device_format.rb
|
|
150
|
+
- lib/dji_mqtt_connect/factories/events/drc_status_notify.rb
|
|
149
151
|
- lib/dji_mqtt_connect/factories/events/drone_format.rb
|
|
150
152
|
- lib/dji_mqtt_connect/factories/events/esim_activate.rb
|
|
151
153
|
- lib/dji_mqtt_connect/factories/events/esim_operator_switch.rb
|
|
154
|
+
- lib/dji_mqtt_connect/factories/events/joystick_invalid_notify.rb
|
|
152
155
|
- lib/dji_mqtt_connect/factories/events/obstacle_avoidance_notify.rb
|
|
153
156
|
- lib/dji_mqtt_connect/factories/events/ota_progress.rb
|
|
154
157
|
- lib/dji_mqtt_connect/factories/events/rtk_calibration.rb
|
|
@@ -230,6 +233,7 @@ files:
|
|
|
230
233
|
- lib/dji_mqtt_connect/messages/thing/product/events/device_format.rb
|
|
231
234
|
- lib/dji_mqtt_connect/messages/thing/product/events/device_log.rb
|
|
232
235
|
- lib/dji_mqtt_connect/messages/thing/product/events/device_reboot.rb
|
|
236
|
+
- lib/dji_mqtt_connect/messages/thing/product/events/drc_status_notify.rb
|
|
233
237
|
- lib/dji_mqtt_connect/messages/thing/product/events/drone_close.rb
|
|
234
238
|
- lib/dji_mqtt_connect/messages/thing/product/events/drone_format.rb
|
|
235
239
|
- lib/dji_mqtt_connect/messages/thing/product/events/drone_open.rb
|
|
@@ -244,6 +248,7 @@ files:
|
|
|
244
248
|
- lib/dji_mqtt_connect/messages/thing/product/events/fly_to_point_progress.rb
|
|
245
249
|
- lib/dji_mqtt_connect/messages/thing/product/events/highest_priority_upload_flighttask_media.rb
|
|
246
250
|
- lib/dji_mqtt_connect/messages/thing/product/events/hms.rb
|
|
251
|
+
- lib/dji_mqtt_connect/messages/thing/product/events/joystick_invalid_notify.rb
|
|
247
252
|
- lib/dji_mqtt_connect/messages/thing/product/events/obstacle_avoidance_notify.rb
|
|
248
253
|
- lib/dji_mqtt_connect/messages/thing/product/events/offline_map_sync_progress.rb
|
|
249
254
|
- lib/dji_mqtt_connect/messages/thing/product/events/ota_progress.rb
|
|
@@ -450,6 +455,7 @@ files:
|
|
|
450
455
|
- lib/dji_mqtt_connect/mixins/services_output_status.rb
|
|
451
456
|
- lib/dji_mqtt_connect/mixins/supplement_light_state.rb
|
|
452
457
|
- lib/dji_mqtt_connect/mixins/temperature.rb
|
|
458
|
+
- lib/dji_mqtt_connect/mixins/timestamp_or_current.rb
|
|
453
459
|
- lib/dji_mqtt_connect/mixins/video_quality.rb
|
|
454
460
|
- lib/dji_mqtt_connect/mixins/video_type.rb
|
|
455
461
|
- lib/dji_mqtt_connect/railtie.rb
|