dji_mqtt_connect 0.1.22.1 → 0.1.22.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 904fc18520b674341b8c69c048a1a15c13d9f3e0cc7d053fa4141bb0a45479b8
4
- data.tar.gz: fbf55a2a6858ecca53d5154683ebd9fc6c1d3d3d87075e8d2c4db9c778b7708a
3
+ metadata.gz: 8648b1f1ab8a35bab447677cacc7e465716a7b30b31dc9cf26230d9e4f00000f
4
+ data.tar.gz: 33fa2572acded95529962bc32703599c6750118c3238879584aad4a06db0bcf5
5
5
  SHA512:
6
- metadata.gz: 3a6992caed4090fb4a9498226d70faf1b584918bfe9681242a234ab46e8877682000574e83b3809dc7d0825d778056651a10211183278dde55b3f4b939dc4441
7
- data.tar.gz: 70c74955236b489540ad2854695e2ece19d141b52b99ff2ca50461747c321c2f3f6381d00ac1079d19ddfc9c69b0686567188d004e2d233f6e63ee66fb392345
6
+ metadata.gz: ce0796ec8ca31bf90482a16fb3e601e40d2dccc1cdf045ecbc149fc0838f294a7297af69aef3d8cebfdb7e9714e33b4c5464b3680acadf38a1e771d78f163f32
7
+ data.tar.gz: b75eaafa64707ec784514792188fe3722bb17abbce767c4ea5843ddf61f8c3e4d170980301ec31606e50cac0f9f04ea1ea42ece7daa0e2c56c20c38fc4470ad7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dji_mqtt_connect (0.1.22.1)
4
+ dji_mqtt_connect (0.1.22.2)
5
5
  activesupport (>= 6.0, <= 8)
6
6
  dry-struct (~> 1.6)
7
7
  dry-transformer (~> 1.0)
@@ -20,6 +20,9 @@ module DjiMqttConnect
20
20
  wind_speed
21
21
  ]
22
22
 
23
+ CAMERA_MODE_PHOTO_TAKING = 0
24
+ CAMREA_MODE_RECORDING = 1
25
+
23
26
  attribute :data do
24
27
  include Mixins::LatitudeConditional
25
28
  include Mixins::LongitudeConditional
@@ -90,7 +93,14 @@ module DjiMqttConnect
90
93
  attribute :payload_index, Types::String
91
94
 
92
95
  # {"0":"Photo taking","1":"Recording"}
93
- attribute? :camera_mode, Types::Integer.enum(0, 1)
96
+ attribute? :camera_mode, Types::Integer.enum(
97
+ CAMERA_MODE_PHOTO_TAKING,
98
+ CAMREA_MODE_RECORDING
99
+ ) | Types::ErrorInteger
100
+
101
+ def camera_mode?
102
+ camera_mode && !Types::ErrorInteger.valid?(camera_mode)
103
+ end
94
104
 
95
105
  # {"min":2,"max":20}
96
106
  attribute? :ir_zoom_factor, Types::JSON::Decimal
@@ -10,6 +10,9 @@ module DjiMqttConnect
10
10
  # DJI does not like null, so it returns Integer 0 instead of a Decimal...
11
11
  NullInteger = Types::Strict::Integer.constrained(eql: 0)
12
12
 
13
+ # Negative values indicate a fault
14
+ ErrorInteger = Types::Strict::Integer.constrained(lt: 0)
15
+
13
16
  # Not a Strict UUID format... turns out DJI doesn't follow one
14
17
  UUID = Strict::String.constrained(format: /\A[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\z/i)
15
18
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DjiMqttConnect
4
- VERSION = "0.1.22.1"
4
+ VERSION = "0.1.22.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dji_mqtt_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.22.1
4
+ version: 0.1.22.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sphere Drones