dji_mqtt_connect 0.1.27 → 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: febe819881174b9cea42366a7b84af6a0aeac15b67ef961bddecc3fb010b2939
4
- data.tar.gz: fb92a5a086fb526be0a9c4a00113f270f0b146c2fb79f722ea7b14002fa3e13e
3
+ metadata.gz: 4d113b4a90197a2407938bb1abf366bd64f9f366da3d2e47cc55ca7f310f8558
4
+ data.tar.gz: c25dd47a5c174a55bbb60877bde526a41114281b8eecd9171979c31087a5c20b
5
5
  SHA512:
6
- metadata.gz: fa06a22f69a7a603152fd2ebe1c914e56b3cbb3f600cf04c6a8fc26823681a7e12b8f12e086eedcd65d7c0dab919137d0e21cf440bde6e022eadf4eeb0ed3ae5
7
- data.tar.gz: f5692ab2e3dd027f8619efc6ffff890ab08845c5dce5856c53f7d011839a77e0aaaaa75527900d61786fb2fdc45d0e56be0134a4b4bb4084aecba8b3e0918ce8
6
+ metadata.gz: 418b9a5c98eb6b885fbdf5d60a94ee894c33a0445455b00bf80e47d304ef719d144deca221ba36bfe5c2b31f99b6a7b5034532562c0b1d83b37f21618a00ded8
7
+ data.tar.gz: a956bf2bbb77776a51ccb17ce1d8453b0de0d6a0e613e73b966e85547843fa2b54e568e595f575e40838749cd72dc49eb48cd55c1a9f718c802e8a26bef9a377
@@ -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
@@ -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.27"
4
+ VERSION = "0.1.27.1"
5
5
  end
@@ -162,6 +162,7 @@ module DjiMqttConnect
162
162
 
163
163
  # Mixinx
164
164
  module Mixins
165
+ autoload :CapacityPercent, "dji_mqtt_connect/mixins/capacity_percent"
165
166
  autoload :EventsProgressChecks, "dji_mqtt_connect/mixins/events_progress_checks"
166
167
  autoload :HumanizedCameraIndex, "dji_mqtt_connect/mixins/humanized_camera_index"
167
168
  autoload :LatitudeConditional, "dji_mqtt_connect/mixins/latitude_conditional"
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.27
4
+ version: 0.1.27.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sphere Drones
@@ -247,6 +247,7 @@ files:
247
247
  - lib/dji_mqtt_connect/messages/thing/product/services_reply_message.rb
248
248
  - lib/dji_mqtt_connect/messages/thing/product/state_message.rb
249
249
  - lib/dji_mqtt_connect/messages/thing/product/state_reply_message.rb
250
+ - lib/dji_mqtt_connect/mixins/capacity_percent.rb
250
251
  - lib/dji_mqtt_connect/mixins/events_progress_checks.rb
251
252
  - lib/dji_mqtt_connect/mixins/humanized_camera_index.rb
252
253
  - lib/dji_mqtt_connect/mixins/latitude_conditional.rb