dji_mqtt_connect 0.1.37 → 0.1.37.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c9d9f413e3ed17ec23e3ebd7f0922c723d02c34887e21370fc93c4f3c967e501
4
- data.tar.gz: 896905fcf6590cc681dd214b703d423f9b1387ed51b26218d6e4d4ce25b0f882
3
+ metadata.gz: 663602bdbd948ddb57596b77693196e0d0322ca1c533cb9a7de4b13f46fe0779
4
+ data.tar.gz: c2c49b89f656ef8bb1cf43f93573f6af7b8cff9b2fee6c70e680612253f55fde
5
5
  SHA512:
6
- metadata.gz: e94e7632a218b5da97d0529bb5303e4300995e16b91870c689c7ca70140a98d852bbdf96c2d1e95e8e59d8a0cc6d79e7a2ca7752ad1f2d4d096f9fc9d40ae00c
7
- data.tar.gz: 977f59258206042ee6f707f0a1c8f1a966b750b7f6cb0ef30f84131f44f5571acb7d15d1c640b69ce34b7adb4155c77f285f5718c28411bc77a89d4d02c038b9
6
+ metadata.gz: cd0bd83270b9b657bc2a9da802f0fa10129e5c3a7e8442728a7d8f0256a27f92921d32fe183b7b32f8f24fe6d561526b2a06ce69fe81dc886597b66f70902692
7
+ data.tar.gz: beecb4ba85b4d82305d8a0fb4d7cb487b6090f5eb05624f28e5f693dd14eb4ca40daf27fd4868a6e4fa793c1fcaabd97bb7e2ba502290e4acc38497032822259
@@ -6,4 +6,5 @@ en:
6
6
  flight_hub_drone: "Received OSD message from FlightHub Drone"
7
7
  dock: "Received OSD message from Dock"
8
8
  drone: "Received OSD message from Drone"
9
+ relay: "Received OSD message from Relay"
9
10
  remote: "Received OSD message from Remote"
@@ -57,7 +57,7 @@ module DjiMqttConnect
57
57
  total_flight_time: 146930,
58
58
  track_id: nil,
59
59
  vertical_speed: -0.30000001192092896,
60
- wind_direction: 180,
60
+ wind_direction: Types::WIND_DIRECTION_NORTHEAST,
61
61
  wind_speed: 0.800000011920929
62
62
  },
63
63
  sn: "DRONE01"
@@ -63,6 +63,8 @@ module DjiMqttConnect
63
63
  FlightHubDroneOsdMessage
64
64
  elsif FlightHubDockOsdMessage.matches?(parsed_message)
65
65
  FlightHubDockOsdMessage
66
+ elsif relay_osd_data_attributes.any? { |attribute| message_data.key?(attribute) }
67
+ RelayOsdMessage
66
68
  elsif drone_osd_data_attributes.all? { |attribute| message_data.key?(attribute.to_s) }
67
69
  DroneOsdMessage
68
70
  elsif required_remote_osd_data_attributes.all? { |attribute| message_data.key?(attribute.to_s) } &&
@@ -89,6 +91,10 @@ module DjiMqttConnect
89
91
  @dock_osd_data_attributes ||= DockOsdMessage::STABLE_DATA_ATTRIBUTES.map(&:to_s)
90
92
  end
91
93
 
94
+ def relay_osd_data_attributes
95
+ @relay_osd_data_attributes ||= RelayOsdMessage::STABLE_DATA_ATTRIBUTES.map(&:to_s)
96
+ end
97
+
92
98
  def drone_osd_data_attributes
93
99
  @drone_osd_data_attributes ||= DroneOsdMessage::STABLE_DATA_ATTRIBUTES.map(&:to_s)
94
100
  end
@@ -18,10 +18,11 @@ module DjiMqttConnect
18
18
  attribute? :domain, Types::DeviceDomain
19
19
  attribute :type, Types::DeviceType
20
20
  attribute :sub_type, Types::DeviceSubType
21
- attribute :index, Types::String
21
+ attribute? :index, Types::String # not provided by all sub-devices
22
22
  attribute :device_secret, Types::String
23
23
  attribute :nonce, Types::String
24
24
  attribute? :version, Types::Integer
25
+ attribute? :thing_version, Types::String
25
26
 
26
27
  alias_method :serial_number, :sn
27
28
  end
@@ -86,7 +86,9 @@ module DjiMqttConnect
86
86
  include Mixins::Longitude
87
87
 
88
88
  attribute? :maintain_status do
89
- attribute :maintain_status_array, Types::Array do
89
+ # Relays send an object keyed by a blank string instead of an array
90
+ # i.e. "maintain_status_array":{"":{"last_maintain_time":0,...}}
91
+ attribute :maintain_status_array, Types::Array.constructor { |value| value.is_a?(Hash) ? value.values : value } do
90
92
  # {"0":"No maintenance","1":"Under maintenance"}
91
93
  attribute :state, Types::Integer
92
94
 
@@ -224,7 +226,7 @@ module DjiMqttConnect
224
226
 
225
227
  attribute? :sub_device do
226
228
  attribute? :device_sn, Types::SerialNumber
227
- attribute? :device_model_key, Types::String
229
+ attribute? :device_model_key, Types::String.optional
228
230
 
229
231
  # {"0":"Offline","1":"Online"}
230
232
  attribute :device_online_status, Types::Integer.enum(0, 1)
@@ -98,7 +98,9 @@ module DjiMqttConnect
98
98
  attribute :total_flight_time, Types::JSON::Decimal
99
99
  attribute? :track_id, Types::String | Types::Nil
100
100
  attribute :vertical_speed, Types::JSON::Decimal
101
- attribute :wind_direction, Types::JSON::Decimal
101
+ attribute :wind_direction, Types::WindDirection | Types::Integer
102
+ include Mixins::WindDirection
103
+
102
104
  attribute :wind_speed, Types::JSON::Decimal
103
105
 
104
106
  # M30 Fields
@@ -0,0 +1,96 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DjiMqttConnect
4
+ module Thing::Product
5
+ class RelayOsdMessage < OsdMessage
6
+ STABLE_DATA_ATTRIBUTES = %i[
7
+ relay_non_pair_info
8
+ ]
9
+
10
+ attribute :data do
11
+ attribute? :acc_time, Types::Integer
12
+
13
+ attribute? :battery do
14
+ attribute :capacity_percent, Types::Integer
15
+ include Mixins::CapacityPercent
16
+
17
+ attribute :current, Types::Integer
18
+ attribute :voltage, Types::Integer
19
+
20
+ attribute :temperature, Types::Temperature
21
+ include Mixins::Temperature
22
+ end
23
+
24
+ attribute? :electric_supply_power, Types::JSON::Decimal
25
+ attribute? :electric_supply_voltage, Types::JSON::Decimal
26
+
27
+ attribute? :height, Types::JSON::Decimal
28
+
29
+ attribute? :latitude, Types::Latitude
30
+ include Mixins::Latitude
31
+
32
+ attribute? :longitude, Types::Longitude
33
+ include Mixins::Longitude
34
+
35
+ attribute? :mode_code, Types::Integer
36
+
37
+ attribute? :position_state do
38
+ # {"0":"Not calibrated","1":"Calibrated"}
39
+ attribute :is_calibration, Types::PositionStateCalibration
40
+
41
+ # {"0":"Not start","1":"fixing","2":"fix successfully","3":"fix failed"}
42
+ attribute :is_fixed, Types::PositionStateFixed
43
+
44
+ attribute :quality, Types::Integer
45
+ include Mixins::PositionStateQuality
46
+
47
+ attribute? :gps_number, Types::Integer
48
+ attribute :rtk_number, Types::Integer
49
+ end
50
+
51
+ attribute? :relay_non_pair_info do
52
+ attribute :allow_occupied, Types::Bool
53
+ attribute :is_broadcast_enable, Types::Bool
54
+ attribute :is_broadcast_hide, Types::Bool
55
+ attribute :is_first_cfg, Types::Bool
56
+ attribute :is_relay_link, Types::Bool
57
+ attribute :passwd_mod_count, Types::Integer
58
+ attribute :period, Types::Integer
59
+
60
+ attribute :ssid do
61
+ attribute :device_name, Types::String | Types::Nil
62
+ attribute :group_name, Types::String | Types::Nil
63
+ end
64
+
65
+ attribute :uav_id, Types::Integer
66
+ end
67
+
68
+ attribute? :self_converge_coordinate do
69
+ attribute :height, Types::JSON::Decimal
70
+
71
+ attribute :latitude, Types::Latitude
72
+ include Mixins::Latitude
73
+
74
+ attribute :longitude, Types::Longitude
75
+ include Mixins::Longitude
76
+ end
77
+
78
+ attribute? :tilt_angle do
79
+ attribute :valid, Types::Integer
80
+ attribute :value, Types::JSON::Decimal
81
+ end
82
+
83
+ attribute? :wireless_link do
84
+ attribute? :sdr_relay_gnd_link_state, Types::Integer
85
+ attribute? :sdr_relay_gnd_quality, Types::Integer
86
+ attribute? :sdr_relay_uav_link_state, Types::Integer
87
+ attribute? :sdr_relay_uav_quality, Types::Integer
88
+ end
89
+ end
90
+
91
+ def humanized_summary
92
+ Translations.thing_product_relay_osd_summary(**humanized_summary_interpolation)
93
+ end
94
+ end
95
+ end
96
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DjiMqttConnect
4
+ module Mixins
5
+ # Provides a conditional that returns false for wind directions that are not one of the
6
+ # compass points DJI documents. A drone reports 0 when it has no reading, and one that is
7
+ # not connected has been seen reporting 256 alongside its other placeholders
8
+ module WindDirection
9
+ def wind_direction?
10
+ Types::WindDirection.valid?(wind_direction)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -169,6 +169,10 @@ module DjiMqttConnect
169
169
  I18n.t("drone", **data, scope: "dji_mqtt_connect.thing_product_osd_summary", default: :default)
170
170
  end
171
171
 
172
+ def thing_product_relay_osd_summary(**data)
173
+ I18n.t("relay", **data, scope: "dji_mqtt_connect.thing_product_osd_summary", default: :default)
174
+ end
175
+
172
176
  def thing_product_remote_osd_summary(**data)
173
177
  I18n.t("remote", **data, scope: "dji_mqtt_connect.thing_product_osd_summary", default: :default)
174
178
  end
@@ -37,8 +37,9 @@ module DjiMqttConnect
37
37
  PAYLOAD_DOMAIN = 1
38
38
  REMOTE_CONTROLLER_DOMAIN = 2
39
39
  DOCK_DOMAIN = 3
40
+ RELAY_DOMAIN = 6 # Signal relay (unreleased), seen as a Dock 3 sub-device (type 610)
40
41
 
41
- DeviceDomain = Types::Coercible::Integer.enum(AIRCRAFT_DOMAIN, PAYLOAD_DOMAIN, REMOTE_CONTROLLER_DOMAIN, DOCK_DOMAIN) # dock returns this value as string
42
+ DeviceDomain = Types::Coercible::Integer.enum(AIRCRAFT_DOMAIN, PAYLOAD_DOMAIN, REMOTE_CONTROLLER_DOMAIN, DOCK_DOMAIN, RELAY_DOMAIN) # dock returns this value as string
42
43
  DeviceType = Types::Integer
43
44
  DeviceSubType = Types::Integer
44
45
 
@@ -499,6 +500,22 @@ module DjiMqttConnect
499
500
  VIDEO_TYPE_ZOOM = "zoom"
500
501
  )
501
502
 
503
+ # The compass point the wind is blowing from. A drone reports 0 when it has no reading,
504
+ # and firmware has been seen reporting values outside the documented range entirely, so
505
+ # the OSD messages leave the value unconstrained and offer a wind_direction? predicate
506
+ # to ask whether a reported one is a compass point
507
+ # {"1":"True north","2":"Northeast","3":"East","4":"Southeast","5":"South","6":"Southwest","7":"West","8":"Northwest"}
508
+ WindDirection = Types::Integer.enum(
509
+ WIND_DIRECTION_TRUE_NORTH = 1,
510
+ WIND_DIRECTION_NORTHEAST = 2,
511
+ WIND_DIRECTION_EAST = 3,
512
+ WIND_DIRECTION_SOUTHEAST = 4,
513
+ WIND_DIRECTION_SOUTH = 5,
514
+ WIND_DIRECTION_SOUTHWEST = 6,
515
+ WIND_DIRECTION_WEST = 7,
516
+ WIND_DIRECTION_NORTHWEST = 8
517
+ )
518
+
502
519
  # Target device for dongle/eSIM operations
503
520
  # {"dock":"Set dock dongle","drone":"Set aircraft dongle"}
504
521
  TargetDeviceType = Types::String.enum(
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DjiMqttConnect
4
- VERSION = "0.1.37"
4
+ VERSION = "0.1.37.2"
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
4
+ version: 0.1.37.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-09-11 00:00:00.000000000 Z
11
+ date: 2026-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -276,6 +276,7 @@ files:
276
276
  - lib/dji_mqtt_connect/messages/thing/product/osd/drone.rb
277
277
  - lib/dji_mqtt_connect/messages/thing/product/osd/flight_hub_dock.rb
278
278
  - lib/dji_mqtt_connect/messages/thing/product/osd/flight_hub_drone.rb
279
+ - lib/dji_mqtt_connect/messages/thing/product/osd/relay.rb
279
280
  - lib/dji_mqtt_connect/messages/thing/product/osd/remote.rb
280
281
  - lib/dji_mqtt_connect/messages/thing/product/osd_message.rb
281
282
  - lib/dji_mqtt_connect/messages/thing/product/requests/airport_bind_status.rb
@@ -474,6 +475,7 @@ files:
474
475
  - lib/dji_mqtt_connect/mixins/timestamp_or_current.rb
475
476
  - lib/dji_mqtt_connect/mixins/video_quality.rb
476
477
  - lib/dji_mqtt_connect/mixins/video_type.rb
478
+ - lib/dji_mqtt_connect/mixins/wind_direction.rb
477
479
  - lib/dji_mqtt_connect/railtie.rb
478
480
  - lib/dji_mqtt_connect/railties/message_serializer.rb
479
481
  - lib/dji_mqtt_connect/topic_repository.rb