dji_mqtt_connect 0.1.37.8 → 0.1.38

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: 60fff37d4609cf3ba72054b394ea921fd4d5402970d5d08a18816e951f145ee4
4
- data.tar.gz: f8b60b7a76e6bcb2b20f2da14447dcd2da4c7f6a18d0bd11739ba76852cf206e
3
+ metadata.gz: 55c8dc51144cdcf112ccb8d29d06928ddacf65ffffdd860bde73f5271a7f155c
4
+ data.tar.gz: 63c5bebcc5c5f404b77e570533e9c588c06438096b1e64f70d2ac9dff49cc439
5
5
  SHA512:
6
- metadata.gz: c0f4e65b55db608a175e3a6023a854fdb5d440f4b17ece1edebcc4dff272edf4aa1b65b54bff1317c67cb391b1297acafa9502f0062bee4ed2e18547a3082ded
7
- data.tar.gz: c90374bcb9f3be0a9cc79ffa1cd3d3a48a6e68d0475722081772edce049d43e6257b59bcc8e60b41d011ac03471e21b487f3f2d3075d88c699aab02a3c1bf0f9
6
+ metadata.gz: 85bdec67ccac88efb1bf43d96f708a16a886c46efdd70c12505b3cb22814825d85f024cb61ee2f3223b99f50067a5359920c03bf3c52414910782574e5abda01
7
+ data.tar.gz: 3ce5493b1afd6bc2d08ae8128ca4a35fe4ed30dea1ce868b34021be5dbb8b66ef949c7c07e7f01b6d2ffab96905d2a29c83302c4cbe9f7091daa9a7d6526fdf6
@@ -13,6 +13,16 @@ module DjiMqttConnect
13
13
  import Dry::Transformer::Conditional
14
14
  import Dry::Transformer::HashTransformations
15
15
 
16
+ # Drones report each payload's state in a block keyed by its payload index, i.e. "53-0-0",
17
+ # these are gathered into a payloads list, as the keys differ for every payload
18
+ COLLECT_PAYLOADS = lambda do |data|
19
+ payloads = data.filter_map do |key, value|
20
+ value.merge("payload_index" => key) if Types::PayloadIndex.valid?(key) && value.is_a?(Hash)
21
+ end
22
+
23
+ payloads.empty? ? data : data.merge("payloads" => payloads)
24
+ end
25
+
16
26
  define! do
17
27
  # Ensure there is a data element
18
28
  map_value "data", ->(data) { data || {} }
@@ -20,6 +30,8 @@ module DjiMqttConnect
20
30
  # Create a backup for unsupported attributes
21
31
  copy_keys "data" => "_data"
22
32
 
33
+ map_value "data", COLLECT_PAYLOADS
34
+
23
35
  map_value "data" do
24
36
  # Rename the invalid (for Ruby) wireless link attributes
25
37
  guard ->(data) { data.key?("wireless_link") } do
@@ -42,6 +54,8 @@ module DjiMqttConnect
42
54
 
43
55
  # FlightHub Dock messages have a host attribute
44
56
  guard ->(data) { data.key?("host") } do
57
+ map_value "host", COLLECT_PAYLOADS
58
+
45
59
  map_value "host" do
46
60
  # Dock 3 sends tilt_angle as a bare value, with validity in tilt_valid_flag
47
61
  # i.e. "tilt_angle":0.18,"tilt_valid_flag":1
@@ -203,6 +203,20 @@ module DjiMqttConnect
203
203
  attribute? :zoom_factor, Types::JSON::Decimal
204
204
  end
205
205
 
206
+ # The state of each payload, reported in a block keyed by its payload index
207
+ attribute? :payloads, Types::Array do
208
+ attribute :payload_index, Types::PayloadIndex
209
+
210
+ # {"0":"Auto","1":"Low gain","2":"High gain"}
211
+ # Docks send modes DJI does not document, so an unknown mode is kept rather than
212
+ # rejecting the message. Check thermal_gain_mode? before relying on it being one of the above.
213
+ attribute? :thermal_gain_mode, Types::ThermalGainMode | Types::Integer
214
+
215
+ def thermal_gain_mode?
216
+ thermal_gain_mode && Types::ThermalGainMode.valid?(thermal_gain_mode)
217
+ end
218
+ end
219
+
206
220
  # {"0":"Continue to execute the wayline task","1":"Exit the wayline task, and execute the remote controller out of control action."}
207
221
  attribute? :exit_wayline_when_rc_lost, Types::ExitWaylineWhenRcLost
208
222
 
@@ -382,6 +382,13 @@ module DjiMqttConnect
382
382
  IR_METERING_MODE_AREA = 2
383
383
  )
384
384
 
385
+ # {"0":"Auto","1":"Low gain","2":"High gain"}
386
+ ThermalGainMode = Types::Integer.enum(
387
+ THERMAL_GAIN_MODE_AUTO = 0,
388
+ THERMAL_GAIN_MODE_LOW = 1,
389
+ THERMAL_GAIN_MODE_HIGH = 2
390
+ )
391
+
385
392
  # {"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"}
386
393
  EventsProgressStepKey = Types::String.enum(
387
394
  "get_bid",
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DjiMqttConnect
4
- VERSION = "0.1.37.8"
4
+ VERSION = "0.1.38"
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.37.8
4
+ version: 0.1.38
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-04 00:00:00.000000000 Z
11
+ date: 2026-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport