dji_mqtt_connect 0.1.23.1 → 0.1.23.3

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: 7028627089ac05f602059d2510546c8ea90f0715890e4808256d72617680d51d
4
- data.tar.gz: 9e910c6aba0f54c1a8e0b7951ccc68a24b1769f3a11cbf5f03b7ad07dd67fe9d
3
+ metadata.gz: c02edaaaf852b86b7a232011a4cbddeac70d5002a0ed80b988280e74e7b53ed4
4
+ data.tar.gz: c626c5ec70d72cb5661f6ce0562143630d025b2ee9c7639a47d137c3c910c2cc
5
5
  SHA512:
6
- metadata.gz: fc15169b6decbc8ffe25e8f1577f3a6817c87ebab65a9a0f3d41ce8dc58baec37bce7e70d9dc59dfdfbaa20a492b316926f27ffdf6cb6da3296604fc1363a70a
7
- data.tar.gz: eb6cbfa4ff76d5578245b9c278ab70fc401b30e6b327d39fee99252a152e48f30559e74927070ecef628bf2c9be146d8f7c20d1136407ba48c65b127ba657a7e
6
+ metadata.gz: 569aab752ec15a303bee5846f38772057ef6a6df823c9655dd9483395d4cf47e18e491abceb64ff64382ff59129382280a6cd8a6fc08c042b7049ef5936adc44
7
+ data.tar.gz: 2a8d79beaa54ebfa8c94d8fe78c9ecf57f5ca0e6c8493b30113f3c6cc75dd4d3379ca9d3d61341657486cc5a95efd235001b43ad67e4bb2de54d9fa466ce28a2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dji_mqtt_connect (0.1.23.1)
4
+ dji_mqtt_connect (0.1.23.3)
5
5
  activesupport (>= 6.0, <= 8)
6
6
  dry-struct (~> 1.6)
7
7
  dry-transformer (~> 1.0)
@@ -4,6 +4,23 @@ module DjiMqttConnect
4
4
  module Factories::StateMessages
5
5
  ### Gateway Messages ###
6
6
 
7
+ def build_thing_product_firmware_version_state_message
8
+ message_data = {
9
+ firmware_version: "10.01.1607",
10
+ compatible_status: 0,
11
+ firmware_upgrade_status: 0
12
+ }
13
+
14
+ Thing::Product::StateMessage.new(
15
+ bid: Message.generate_bid,
16
+ tid: Message.generate_tid,
17
+ timestamp: Message.current_timestamp,
18
+ gateway: "GATEWAYSN",
19
+ _data: message_data,
20
+ data: message_data
21
+ )
22
+ end
23
+
7
24
  def build_thing_product_gateway_live_capacity_state_message
8
25
  message_data = {
9
26
  live_capacity: {
@@ -11,10 +11,10 @@ module DjiMqttConnect
11
11
  attribute :device_binding_code, Types::String | Types::Nil
12
12
  attribute :organization_id, Types::String | Types::Nil
13
13
  attribute :device_callsign, Types::String | Types::Nil
14
- attribute :sn, Types::String
14
+ attribute :sn, Types::String | Types::Nil
15
15
  attribute :device_model_key, Types::String
16
- attribute :device_nonce, Types::String
17
- attribute :device_secret, Types::String
16
+ attribute :device_nonce, Types::String | Types::Nil
17
+ attribute :device_secret, Types::String | Types::Nil
18
18
  end
19
19
  end
20
20
  end
@@ -6,6 +6,7 @@ module DjiMqttConnect
6
6
  attribute :tid, Types::UUID
7
7
  attribute :bid, Types::UUID
8
8
  attribute :timestamp, Types::Timestamp
9
+ attribute? :gateway, Types::String
9
10
 
10
11
  attribute :_data, Types::Hash
11
12
  attribute :_method, Types::String
@@ -8,7 +8,10 @@ module DjiMqttConnect
8
8
  new(
9
9
  _method: offline_map_get._method,
10
10
  data: {
11
- result: result
11
+ result: result,
12
+ output: {
13
+ files: []
14
+ }
12
15
  },
13
16
  tid: offline_map_get.tid,
14
17
  bid: offline_map_get.bid,
@@ -23,6 +26,11 @@ module DjiMqttConnect
23
26
  attribute :_method, Types::String.enum("offline_map_get")
24
27
  attribute :data do
25
28
  attribute :result, Types::ResultCode
29
+
30
+ # Debugging issues related to the offline map
31
+ attribute :output do
32
+ attribute :files, Types::Array.default([].freeze)
33
+ end
26
34
  end
27
35
  end
28
36
  end
@@ -171,6 +171,10 @@ module DjiMqttConnect
171
171
  attribute? :uom_real_name_state, Types::Integer
172
172
  attribute? :wpmz_version, Types::String
173
173
 
174
+ attribute? :firmware_version, Types::String
175
+ attribute? :compatible_status, Types::Integer
176
+ attribute? :firmware_upgrade_status, Types::Integer
177
+
174
178
  attribute? :low_battery_warning_threshold, Types::Integer
175
179
  attribute? :serious_low_battery_warning_threshold, Types::Integer
176
180
  end
@@ -17,6 +17,9 @@ module DjiMqttConnect
17
17
 
18
18
  logger.info("Received #{message} from #{device_sn}")
19
19
 
20
+ # Broadcast a generic received events message event
21
+ broadcast(:received_events_message, device_sn, message)
22
+
20
23
  if message.instance_of?(EventsMessage)
21
24
  # Broadcast an unsupported message event
22
25
  broadcast(:unsupported_message, topic, raw_message)
@@ -25,9 +28,6 @@ module DjiMqttConnect
25
28
  event_name = message.class.name.demodulize.sub(/sMessage\z/, "").underscore.to_sym
26
29
  broadcast(event_name, device_sn, message)
27
30
  end
28
-
29
- # Broadcast a generic received events message event
30
- broadcast(:received_events_message, device_sn, message)
31
31
  rescue ParseError => error
32
32
  broadcast(:parse_error, error, topic, raw_message)
33
33
  end
@@ -17,6 +17,9 @@ module DjiMqttConnect
17
17
 
18
18
  logger.info("Received #{message} from #{device_sn}")
19
19
 
20
+ # Broadcast a generic received osd message event
21
+ broadcast(:received_osd_message, device_sn, message)
22
+
20
23
  if message.instance_of?(OsdMessage)
21
24
  # Broadcast an unsupported message event
22
25
  broadcast(:unsupported_message, topic, raw_message)
@@ -25,9 +28,6 @@ module DjiMqttConnect
25
28
  event_name = message.class.name.demodulize.sub(/Message\z/, "Update").underscore.to_sym
26
29
  broadcast(event_name, device_sn, message)
27
30
  end
28
-
29
- # Broadcast a generic received osd message event
30
- broadcast(:received_osd_message, device_sn, message)
31
31
  rescue ParseError => error
32
32
  broadcast(:parse_error, error, topic, raw_message)
33
33
  end
@@ -17,6 +17,9 @@ module DjiMqttConnect
17
17
 
18
18
  logger.info("Received #{message} from #{gateway_sn}")
19
19
 
20
+ # Broadcast a generic received requests message event
21
+ broadcast(:received_requests_message, gateway_sn, message)
22
+
20
23
  if message.instance_of?(RequestsMessage)
21
24
  # Broadcast an unsupported message event
22
25
  broadcast(:unsupported_message, topic, raw_message)
@@ -24,9 +27,6 @@ module DjiMqttConnect
24
27
  # Build event name and broadcast (i.e. ::ConfigRequestsMessage => config)
25
28
  broadcast(message._method.to_sym, gateway_sn, message)
26
29
  end
27
-
28
- # Broadcast a generic received requests message event
29
- broadcast(:received_requests_message, gateway_sn, message)
30
30
  rescue ParseError => error
31
31
  broadcast(:parse_error, error, topic, raw_message)
32
32
  end
@@ -17,6 +17,9 @@ module DjiMqttConnect
17
17
 
18
18
  logger.info("Received #{message} from #{gateway_sn}")
19
19
 
20
+ # Broadcast a generic received services reply message event
21
+ broadcast(:received_services_reply_message, gateway_sn, message)
22
+
20
23
  if message.instance_of?(ServicesReplyMessage)
21
24
  # Broadcast an unsupported message event
22
25
  broadcast(:unsupported_message, topic, raw_message)
@@ -25,9 +28,6 @@ module DjiMqttConnect
25
28
  event_name = "#{message._method.to_sym}_reply"
26
29
  broadcast(event_name, gateway_sn, message)
27
30
  end
28
-
29
- # Broadcast a generic received services reply message event
30
- broadcast(:received_services_reply_message, gateway_sn, message)
31
31
  rescue ParseError => error
32
32
  broadcast(:parse_error, error, topic, raw_message)
33
33
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DjiMqttConnect
4
- VERSION = "0.1.23.1"
4
+ VERSION = "0.1.23.3"
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.23.1
4
+ version: 0.1.23.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sphere Drones
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-23 00:00:00.000000000 Z
11
+ date: 2024-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport