dji_mqtt_connect 0.1.26 → 0.1.27.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: 23eb2ea3616726bb5b0d39c18e2d38e30cc35eed431a3cf87276b46c82859a2b
4
- data.tar.gz: 66c19f5c2d5590fc4c5ec2c9386103701ab6552f8358b6e06687d5e1c33916ff
3
+ metadata.gz: 4d113b4a90197a2407938bb1abf366bd64f9f366da3d2e47cc55ca7f310f8558
4
+ data.tar.gz: c25dd47a5c174a55bbb60877bde526a41114281b8eecd9171979c31087a5c20b
5
5
  SHA512:
6
- metadata.gz: d4efc4a9189f25682e33a8b55ec163f15dc5be9538340993a07ee5b2e31bdf67f87a14dd93f6be3b134d9687b9b4c61460eb8aecbaa119f2953a13ecea7e582d
7
- data.tar.gz: 4bc20214cdde4b0c532bc09fd0502dfbdcb6a120d2cf724a828f5fdefcf2ee26aa93d7b6576c1ece731a10613e9e8ed5e8da8761af3cadf6058e830c929bc272
6
+ metadata.gz: 418b9a5c98eb6b885fbdf5d60a94ee894c33a0445455b00bf80e47d304ef719d144deca221ba36bfe5c2b31f99b6a7b5034532562c0b1d83b37f21618a00ded8
7
+ data.tar.gz: a956bf2bbb77776a51ccb17ce1d8453b0de0d6a0e613e73b966e85547843fa2b54e568e595f575e40838749cd72dc49eb48cd55c1a9f718c802e8a26bef9a377
@@ -256,6 +256,23 @@ module DjiMqttConnect
256
256
  )
257
257
  end
258
258
 
259
+ def build_thing_product_release_terminal_control_area_events_message
260
+ message_data = {
261
+ flight_id: SecureRandom.uuid,
262
+ reason: 0
263
+ }
264
+
265
+ Thing::Product::ReleaseTerminalControlAreaEventsMessage.new(
266
+ bid: Message.generate_bid,
267
+ tid: Message.generate_tid,
268
+ timestamp: Message.current_timestamp,
269
+ _method: "release_terminal_control_area",
270
+ need_reply: 1,
271
+ data: message_data,
272
+ _data: message_data
273
+ )
274
+ end
275
+
259
276
  def build_thing_product_return_home_info_events_message
260
277
  message_data = {
261
278
  flight_id: "5c746ff3-3b3e-4787-8e06-23c491a99a13",
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DjiMqttConnect
4
+ module Thing::Product
5
+ # NOTE: Message is not documented, but observed from Dock 3
6
+ class ReleaseTerminalControlAreaEventsMessage < EventsMessage
7
+ attribute :_method, Types::String.enum("release_terminal_control_area")
8
+
9
+ attribute :data do
10
+ attribute :flight_id, Types::String
11
+ attribute :reason, Types::Integer
12
+ end
13
+
14
+ # All the flight IDs in the message
15
+ def flight_ids
16
+ [data.flight_id]
17
+ end
18
+ end
19
+ end
20
+ end
@@ -36,7 +36,10 @@ module DjiMqttConnect
36
36
  include Mixins::TemperatureConditional
37
37
 
38
38
  attribute :index, Types::Integer
39
+
39
40
  attribute :capacity_percent, Types::Integer
41
+ include Mixins::CapacityPercent
42
+
40
43
  attribute :voltage, Types::Integer
41
44
  attribute :temperature, Types::Temperature
42
45
  end
@@ -67,7 +70,8 @@ module DjiMqttConnect
67
70
  end
68
71
 
69
72
  # {"min":"0","max":"100"}
70
- attribute :capacity_percent, Types::Integer.constrained(gteq: 0, lteq: 100)
73
+ attribute :capacity_percent, Types::Integer
74
+ include Mixins::CapacityPercent
71
75
  end
72
76
  attribute? :drone_in_dock, Types::Integer.enum(0, 1)
73
77
 
@@ -32,6 +32,8 @@ module DjiMqttConnect
32
32
  include Mixins::TemperatureConditional
33
33
 
34
34
  attribute :capacity_percent, Types::Integer
35
+ include Mixins::CapacityPercent
36
+
35
37
  attribute :firmware_version, Types::String | Types::Nil
36
38
  attribute? :high_voltage_storage_days, Types::Integer
37
39
  attribute :index, Types::Integer
@@ -42,7 +44,10 @@ module DjiMqttConnect
42
44
  attribute :type, Types::DeviceType
43
45
  attribute :voltage, Types::Integer
44
46
  end
47
+
45
48
  attribute :capacity_percent, Types::Integer
49
+ include Mixins::CapacityPercent
50
+
46
51
  attribute :landing_power, Types::Integer
47
52
  attribute :remain_flight_time, Types::Integer
48
53
  attribute :return_home_power, Types::Integer
@@ -8,6 +8,7 @@ module DjiMqttConnect
8
8
  include Mixins::LongitudeConditional
9
9
 
10
10
  attribute :capacity_percent, Types::Integer
11
+ include Mixins::CapacityPercent
11
12
 
12
13
  attribute :latitude, Types::Latitude
13
14
  attribute :longitude, Types::Longitude
@@ -98,7 +98,7 @@ module DjiMqttConnect
98
98
 
99
99
  attribute? :cameras, Types::Array do
100
100
  attribute? :camera_mode, Types::Integer
101
- attribute :liveview_world_region do
101
+ attribute? :liveview_world_region do
102
102
  attribute :bottom, Types::JSON::Decimal
103
103
  attribute :left, Types::JSON::Decimal
104
104
  attribute :right, Types::JSON::Decimal
@@ -195,7 +195,7 @@ module DjiMqttConnect
195
195
  attribute? :wireless_link_topo do
196
196
  attribute :center_node do
197
197
  attribute :sdr_id, Types::Integer
198
- attribute :sn, Types::SerialNumber
198
+ attribute :sn, Types::SerialNumber.optional
199
199
  end
200
200
 
201
201
  attribute :leaf_nodes, Types::Array do
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DjiMqttConnect
4
+ module Mixins
5
+ module CapacityPercent
6
+ def capacity_percent?
7
+ capacity_percent.present? && capacity_percent >= 0 && capacity_percent <= 100
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DjiMqttConnect
4
- VERSION = "0.1.26"
4
+ VERSION = "0.1.27.1"
5
5
  end
@@ -51,6 +51,7 @@ module DjiMqttConnect
51
51
  autoload :HighestPriorityUploadFlighttaskMediaEventsMessage, "dji_mqtt_connect/messages/thing/product/events/highest_priority_upload_flighttask_media"
52
52
  autoload :HmsEventsMessage, "dji_mqtt_connect/messages/thing/product/events/hms"
53
53
  autoload :OfflineMapSyncProgressEventsMessage, "dji_mqtt_connect/messages/thing/product/events/offline_map_sync_progress"
54
+ autoload :ReleaseTerminalControlAreaEventsMessage, "dji_mqtt_connect/messages/thing/product/events/release_terminal_control_area"
54
55
  autoload :ReturnHomeInfoEventsMessage, "dji_mqtt_connect/messages/thing/product/events/return_home_info"
55
56
  autoload :StatusCodeEventsMessage, "dji_mqtt_connect/messages/thing/product/events/status_code"
56
57
  autoload :TakeoffToPointProgressEventsMessage, "dji_mqtt_connect/messages/thing/product/events/takeoff_to_point_progress"
@@ -161,6 +162,7 @@ module DjiMqttConnect
161
162
 
162
163
  # Mixinx
163
164
  module Mixins
165
+ autoload :CapacityPercent, "dji_mqtt_connect/mixins/capacity_percent"
164
166
  autoload :EventsProgressChecks, "dji_mqtt_connect/mixins/events_progress_checks"
165
167
  autoload :HumanizedCameraIndex, "dji_mqtt_connect/mixins/humanized_camera_index"
166
168
  autoload :LatitudeConditional, "dji_mqtt_connect/mixins/latitude_conditional"
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.26
4
+ version: 0.1.27.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: 2025-02-19 00:00:00.000000000 Z
11
+ date: 2025-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -174,6 +174,7 @@ files:
174
174
  - lib/dji_mqtt_connect/messages/thing/product/events/highest_priority_upload_flighttask_media.rb
175
175
  - lib/dji_mqtt_connect/messages/thing/product/events/hms.rb
176
176
  - lib/dji_mqtt_connect/messages/thing/product/events/offline_map_sync_progress.rb
177
+ - lib/dji_mqtt_connect/messages/thing/product/events/release_terminal_control_area.rb
177
178
  - lib/dji_mqtt_connect/messages/thing/product/events/return_home_info.rb
178
179
  - lib/dji_mqtt_connect/messages/thing/product/events/status_code.rb
179
180
  - lib/dji_mqtt_connect/messages/thing/product/events/takeoff_to_point_progress.rb
@@ -246,6 +247,7 @@ files:
246
247
  - lib/dji_mqtt_connect/messages/thing/product/services_reply_message.rb
247
248
  - lib/dji_mqtt_connect/messages/thing/product/state_message.rb
248
249
  - lib/dji_mqtt_connect/messages/thing/product/state_reply_message.rb
250
+ - lib/dji_mqtt_connect/mixins/capacity_percent.rb
249
251
  - lib/dji_mqtt_connect/mixins/events_progress_checks.rb
250
252
  - lib/dji_mqtt_connect/mixins/humanized_camera_index.rb
251
253
  - lib/dji_mqtt_connect/mixins/latitude_conditional.rb