dji_mqtt_connect 0.1.35 → 0.1.35.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 +4 -4
- data/config/locales/thing_product_events.en.yml +1 -0
- data/lib/dji_mqtt_connect/factories/events/camera_photo_take_progress.rb +32 -0
- data/lib/dji_mqtt_connect/messages/thing/product/events/camera_photo_take_progress.rb +44 -0
- data/lib/dji_mqtt_connect/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: adb1d63889b820dd0c1df792d2253030ae911e0d08a5d24f727ab00b0ff8f2c2
|
|
4
|
+
data.tar.gz: 31ababecf779a61bc6a7712dc7ecdbb268e49fc4f904df104af1dc7ea442bd89
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e25128b88bf8447c88cb4bf21917779802c4f97dc0c4acd6b3a4a6584e45a44571b77d0ec7026736040321e14bde6f494918c0ffa299d0100b6c49a0334e3a85
|
|
7
|
+
data.tar.gz: f788894f1b081e966b90b552f2e5180d214e58e269f5cad6e9df29a54fd7e5d624c34a3195c4f5f40ffecd1d7151763bdbab635be934a6c59eaf86595128c5a0
|
|
@@ -2,6 +2,7 @@ en:
|
|
|
2
2
|
dji_mqtt_connect:
|
|
3
3
|
thing_product_events_summary:
|
|
4
4
|
default: "Received %{method} event: %{result}"
|
|
5
|
+
camera_photo_take_progress: "Photo Capture Progress: %{status} (%{percent}%)"
|
|
5
6
|
charge_close: "Stop Charging: %{status} (%{step_key} %{percent}%)"
|
|
6
7
|
charge_open: "Start Charging: %{status} (%{step_key} %{percent}%)"
|
|
7
8
|
cover_close: "Cover closing: %{status} (%{current_step}/%{total_steps} %{percent}%)"
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Factories::EventsMessages
|
|
5
|
+
def build_thing_product_camera_photo_take_progress_events_message
|
|
6
|
+
message_data = {
|
|
7
|
+
output: {
|
|
8
|
+
ext: {
|
|
9
|
+
camera_mode: 3
|
|
10
|
+
},
|
|
11
|
+
progress: {
|
|
12
|
+
current_step: 0,
|
|
13
|
+
percent: 100
|
|
14
|
+
},
|
|
15
|
+
status: "ok"
|
|
16
|
+
},
|
|
17
|
+
result: 0
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
Thing::Product::CameraPhotoTakeProgressEventsMessage.new(
|
|
21
|
+
bid: Message.generate_bid,
|
|
22
|
+
tid: Message.generate_tid,
|
|
23
|
+
timestamp: Message.current_timestamp,
|
|
24
|
+
gateway: "GATEWAYSN",
|
|
25
|
+
_method: "camera_photo_take_progress",
|
|
26
|
+
need_reply: 1,
|
|
27
|
+
data: message_data,
|
|
28
|
+
_data: message_data
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Thing::Product
|
|
5
|
+
# Persistent progress updates for camera_photo_take (e.g. panorama or other persistent photo capturing).
|
|
6
|
+
# https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock3/drc.html#upload-capture-progress
|
|
7
|
+
class CameraPhotoTakeProgressEventsMessage < EventsMessage
|
|
8
|
+
attribute :_method, Types::String.enum("camera_photo_take_progress")
|
|
9
|
+
|
|
10
|
+
attribute :data do
|
|
11
|
+
attribute :result, Types::ResultCode
|
|
12
|
+
include Mixins::ResultCode
|
|
13
|
+
|
|
14
|
+
attribute :output do
|
|
15
|
+
attribute :status, Types::ServicesOutputStatus
|
|
16
|
+
|
|
17
|
+
def humanized_status
|
|
18
|
+
I18n.t(status, scope: "dji_mqtt_connect.services_output_status", default: status.titleize)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
attribute :progress do
|
|
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
|
|
25
|
+
|
|
26
|
+
attribute :percent, Types::Integer.constrained(gteq: 0, lteq: 100)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
attribute? :ext do
|
|
30
|
+
# {"0":"Capturing","1":"Recording","2":"Smart Low-Light","3":"Panorama","-1":"Unsupported mode","4":"Timed Shot"}
|
|
31
|
+
attribute? :camera_mode, Types::CameraMode
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def humanized_summary_interpolation
|
|
37
|
+
super.merge(
|
|
38
|
+
status: data.output.humanized_status,
|
|
39
|
+
percent: data.output.progress.percent
|
|
40
|
+
)
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
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.35
|
|
4
|
+
version: 0.1.35.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
|
+
date: 2026-08-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -139,6 +139,7 @@ files:
|
|
|
139
139
|
- lib/dji_mqtt_connect/client.rb
|
|
140
140
|
- lib/dji_mqtt_connect/error.rb
|
|
141
141
|
- lib/dji_mqtt_connect/factories.rb
|
|
142
|
+
- lib/dji_mqtt_connect/factories/events/camera_photo_take_progress.rb
|
|
142
143
|
- lib/dji_mqtt_connect/factories/events/charge_close.rb
|
|
143
144
|
- lib/dji_mqtt_connect/factories/events/charge_open.rb
|
|
144
145
|
- lib/dji_mqtt_connect/factories/events/cover_close.rb
|
|
@@ -200,6 +201,7 @@ files:
|
|
|
200
201
|
- lib/dji_mqtt_connect/messages/sys/product/status_reply/update_topo.rb
|
|
201
202
|
- lib/dji_mqtt_connect/messages/sys/product/status_reply_message.rb
|
|
202
203
|
- lib/dji_mqtt_connect/messages/thing/product/events/airsense_warning.rb
|
|
204
|
+
- lib/dji_mqtt_connect/messages/thing/product/events/camera_photo_take_progress.rb
|
|
203
205
|
- lib/dji_mqtt_connect/messages/thing/product/events/charge_close.rb
|
|
204
206
|
- lib/dji_mqtt_connect/messages/thing/product/events/charge_open.rb
|
|
205
207
|
- lib/dji_mqtt_connect/messages/thing/product/events/cover_close.rb
|