dji_mqtt_connect 0.1.39 → 0.1.40.1

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: 46ee9a9805803efb395c42306ad2b8b7a60f78b45731e0ba7ab6788f45b3142b
4
- data.tar.gz: 80d648fcc793256d4a8a5e2d0cb4a8a38baa1467df6c951bcb33297166486638
3
+ metadata.gz: 61b1473bfaa9e9e9f316d3361492019e2203efdb39dd231236e4f96294930269
4
+ data.tar.gz: b665e66d5391368a480ed4925344647c29d31a9e4385a12960a0451e5660c9af
5
5
  SHA512:
6
- metadata.gz: bc7c47e9496cd68e0bbe8478417f52a78cd60067748bc0091d39fa0f2068c5fda1a2840e3410e0b086ad581647b365c76e2c4f8d1a48c03c080210b27b179343
7
- data.tar.gz: 145aee434ab1618320a1f31cdd39485966f1c91d24830689a786667dccef17e7ebb9a18293a74a54686d1148672fe8b58e919bfcd85c3803e1dd9215dd22eeb8
6
+ metadata.gz: 99c1804674152cd57bd3e3578f4f164c6f9539b1b003413e594a7dd5f79e2e904dafeb25a36a6fe1fb450cd73ffa878d507ac1ecffd05f1ac2ec9097361697c5
7
+ data.tar.gz: 7c70bb660c3d520cb883f004ea48e6bc38c13a8ef9a95756680c8f186dd8d315e33cbb86ad08fb15297cac5504b0210c655a3decb74a4669587c23a996255bdd
@@ -20,8 +20,12 @@ module DjiMqttConnect
20
20
 
21
21
  attribute :progress do
22
22
  # {"3000":"Panorama photo capturing is not start or is finished","3002":"Panorama photo is capturing","3005":"Panorama photo is synthesizing"}
23
- # NOTE: not enum-constrained, real messages have been observed with current_step: 0, which isn't a documented value
24
- attribute :current_step, Types::Integer
23
+ # NOTE: real messages have been observed with current_step: 0, which isn't a documented value
24
+ attribute :current_step, Types::PanoramaStep | Types::Integer
25
+
26
+ def current_step?
27
+ Types::PanoramaStep.valid?(current_step)
28
+ end
25
29
 
26
30
  attribute :percent, Types::Integer.constrained(gteq: 0, lteq: 100)
27
31
  end
@@ -110,9 +110,11 @@ module DjiMqttConnect
110
110
  include Mixins::DockModeCode
111
111
 
112
112
  attribute? :network_state do
113
- attribute :type, Types::NetworkStateType
113
+ # {"1":"4G","2":"Ethernet"}
114
+ attribute :type, Types::NetworkStateType | Types::Integer
114
115
  include Mixins::NetworkStateType
115
116
 
117
+ # {"0":"No signal","1":"Bad","2":"Poor","3":"Fair","4":"Good","5":"Excellent"}
116
118
  attribute :quality, Types::NetworkStateQuality | Types::Integer
117
119
  include Mixins::NetworkStateQuality
118
120
 
@@ -127,15 +129,52 @@ module DjiMqttConnect
127
129
 
128
130
  attribute? :wireless_link do
129
131
  attribute? :_4g_freq_band, Types::JSON::Decimal
130
- attribute? :_4g_gnd_quality, Types::Integer
131
- attribute? :_4g_link_state, Types::Integer
132
- attribute? :_4g_quality, Types::Integer
133
- attribute? :_4g_uav_quality, Types::Integer
132
+
133
+ attribute? :_4g_gnd_quality, Types::WirelessLinkQuality | Types::Integer
134
+
135
+ def _4g_gnd_quality?
136
+ Types::WirelessLinkQuality.valid?(_4g_gnd_quality)
137
+ end
138
+
139
+ # {"0":"Disconnected","1":"Connected"}
140
+ attribute? :_4g_link_state, Types::WirelessLinkState | Types::Integer
141
+
142
+ def _4g_link_connected?
143
+ _4g_link_state == Types::WIRELESS_LINK_CONNECTED
144
+ end
145
+
146
+ attribute? :_4g_quality, Types::WirelessLinkQuality | Types::Integer
147
+
148
+ def _4g_quality?
149
+ Types::WirelessLinkQuality.valid?(_4g_quality)
150
+ end
151
+
152
+ attribute? :_4g_uav_quality, Types::WirelessLinkQuality | Types::Integer
153
+
154
+ def _4g_uav_quality?
155
+ Types::WirelessLinkQuality.valid?(_4g_uav_quality)
156
+ end
157
+
134
158
  attribute? :dongle_number, Types::Integer
135
- attribute? :link_workmode, Types::Integer
159
+
160
+ # {"0":"SDR mode","1":"4G fusion mode"}
161
+ attribute? :link_workmode, Types::WirelessLinkWorkmode | Types::Integer
162
+
136
163
  attribute? :sdr_freq_band, Types::JSON::Decimal
137
- attribute? :sdr_link_state, Types::Integer
138
- attribute? :sdr_quality, Types::Integer
164
+
165
+ # {"0":"Disconnected","1":"Connected"}
166
+ attribute? :sdr_link_state, Types::WirelessLinkState | Types::Integer
167
+
168
+ def sdr_link_connected?
169
+ sdr_link_state == Types::WIRELESS_LINK_CONNECTED
170
+ end
171
+
172
+ attribute? :sdr_quality, Types::WirelessLinkQuality | Types::Integer
173
+
174
+ def sdr_quality?
175
+ Types::WirelessLinkQuality.valid?(sdr_quality)
176
+ end
177
+
139
178
  attribute? :sdr_relay_gnd_link_state, Types::Integer
140
179
  attribute? :sdr_relay_gnd_quality, Types::Integer
141
180
  attribute? :sdr_relay_uav_link_state, Types::Integer
@@ -9,14 +9,22 @@ module DjiMqttConnect
9
9
 
10
10
  def humanized_quality
11
11
  quality_key = case quality
12
+ when Types::NETWORK_STATE_QUALITY_NO_SIGNAL
13
+ "No signal"
12
14
  when Types::NETWORK_STATE_QUALITY_BAD
13
15
  "Bad"
14
- when Types::NETWORK_STATE_QUALITY_MODERATE
15
- "Moderate"
16
+ when Types::NETWORK_STATE_QUALITY_POOR
17
+ "Poor"
18
+ when Types::NETWORK_STATE_QUALITY_FAIR
19
+ "Fair"
16
20
  when Types::NETWORK_STATE_QUALITY_GOOD
17
21
  "Good"
22
+ when Types::NETWORK_STATE_QUALITY_EXCELLENT
23
+ "Excellent"
18
24
  end
19
- I18n.t(quality_key.downcase, scope: "dji_mqtt_connect.dock_network_state.quality", default: quality_key)
25
+ return if quality_key.nil?
26
+
27
+ I18n.t(quality_key.parameterize.underscore, scope: "dji_mqtt_connect.dock_network_state.quality", default: quality_key)
20
28
  end
21
29
  end
22
30
  end
@@ -3,6 +3,10 @@
3
3
  module DjiMqttConnect
4
4
  module Mixins
5
5
  module NetworkStateType
6
+ def type?
7
+ Types::NetworkStateType.valid?(type)
8
+ end
9
+
6
10
  def humanized_type
7
11
  type_key = case type
8
12
  when Types::NETWORK_STATE_TYPE_4G
@@ -10,6 +14,8 @@ module DjiMqttConnect
10
14
  when Types::NETWORK_STATE_TYPE_ETHERNET
11
15
  "Ethernet"
12
16
  end
17
+ return if type_key.nil?
18
+
13
19
  I18n.t(type_key.downcase, scope: "dji_mqtt_connect.dock_network_state.type", default: type_key)
14
20
  end
15
21
  end
@@ -76,6 +76,13 @@ module DjiMqttConnect
76
76
  CAMERA_RECORDING_STATE_RECORDING = 1
77
77
  )
78
78
 
79
+ # {"3000":"Panorama photo capturing is not start or is finished","3002":"Panorama photo is capturing","3005":"Panorama photo is synthesizing"}
80
+ PanoramaStep = Types::Integer.enum(
81
+ PANORAMA_STEP_NOT_STARTED_OR_FINISHED = 3000,
82
+ PANORAMA_STEP_CAPTURING = 3002,
83
+ PANORAMA_STEP_SYNTHESIZING = 3005
84
+ )
85
+
79
86
  # {"0":"Closed","1":"Opened","2":"Half-open","3":"Cover state is abnormal"}
80
87
  CoverState = Types::Integer.enum(
81
88
  COVER_STATE_CLOSED = 0,
@@ -124,6 +131,23 @@ module DjiMqttConnect
124
131
  AREA_LIMIT_REACHED = 1
125
132
  )
126
133
 
134
+ # {"0":"Disconnected","1":"Connected"}
135
+ WirelessLinkState = Types::Integer.enum(
136
+ WIRELESS_LINK_DISCONNECTED = 0,
137
+ WIRELESS_LINK_CONNECTED = 1
138
+ )
139
+
140
+ # {"min":"0","max":"5"}
141
+ WIRELESS_LINK_QUALITY_MIN = 0
142
+ WIRELESS_LINK_QUALITY_MAX = 5
143
+ WirelessLinkQuality = Types::Integer.constrained(gteq: WIRELESS_LINK_QUALITY_MIN, lteq: WIRELESS_LINK_QUALITY_MAX)
144
+
145
+ # {"0":"SDR mode","1":"4G fusion mode"}
146
+ WirelessLinkWorkmode = Types::Integer.enum(
147
+ WIRELESS_LINK_WORKMODE_SDR = 0,
148
+ WIRELESS_LINK_WORKMODE_4G_FUSION = 1
149
+ )
150
+
127
151
  # {"max":"1500","min":"20","unit_name":"Meters / m"}
128
152
  HEIGHT_LIMIT_MIN = 20
129
153
  HEIGHT_LIMIT_MAX = 1500
@@ -456,15 +480,20 @@ module DjiMqttConnect
456
480
  "upgrading_prevent_reboot"
457
481
  )
458
482
 
483
+ # {"1":"4G","2":"Ethernet"}
459
484
  NetworkStateType = Integer.enum(
460
485
  NETWORK_STATE_TYPE_4G = 1,
461
486
  NETWORK_STATE_TYPE_ETHERNET = 2
462
487
  )
463
488
 
489
+ # {"0":"No signal","1":"Bad","2":"Poor","3":"Fair","4":"Good","5":"Excellent"}
464
490
  NetworkStateQuality = Integer.enum(
465
- NETWORK_STATE_QUALITY_BAD = 0,
466
- NETWORK_STATE_QUALITY_MODERATE = 1,
467
- NETWORK_STATE_QUALITY_GOOD = 2
491
+ NETWORK_STATE_QUALITY_NO_SIGNAL = 0,
492
+ NETWORK_STATE_QUALITY_BAD = 1,
493
+ NETWORK_STATE_QUALITY_POOR = 2,
494
+ NETWORK_STATE_QUALITY_FAIR = 3,
495
+ NETWORK_STATE_QUALITY_GOOD = 4,
496
+ NETWORK_STATE_QUALITY_EXCELLENT = 5
468
497
  )
469
498
 
470
499
  # Enumeration of camera payload and mounted location. Non-standard device_mode_key, formatted as {type-subtype-gimbalindex}.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DjiMqttConnect
4
- VERSION = "0.1.39"
4
+ VERSION = "0.1.40.1"
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.39
4
+ version: 0.1.40.1
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-17 00:00:00.000000000 Z
11
+ date: 2026-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport