dji_mqtt_connect 0.1.15 → 0.1.15.2
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/Gemfile.lock +1 -1
- data/lib/dji_mqtt_connect/marshals/thing/product/events_marshal.rb +1 -0
- data/lib/dji_mqtt_connect/marshals/thing/product/osd_marshal.rb +12 -3
- data/lib/dji_mqtt_connect/messages/thing/product/osd/drone.rb +11 -11
- data/lib/dji_mqtt_connect/messages/thing/product/osd/remote.rb +6 -4
- data/lib/dji_mqtt_connect/version.rb +1 -1
- metadata +1 -1
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: bb8872af639f12c94d0751642d2ca74a6d809e9530e8e25d0715a7cbbf8c4eeb
         | 
| 4 | 
            +
              data.tar.gz: 4a58c4539b4b62f6d4e7b64197ecdd62e7847d6f3b328224f969ea60a23d55a0
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 332544ae378bacb8646e9e53534b64e6e1b7a0efae99a3b0d6c77e70710bbeae1887b0180337445c4b8f9988ae33ad3c623e0b631c769a1a9c18b9e765fb5a34
         | 
| 7 | 
            +
              data.tar.gz: f64b0fc4d8aab154481139dd44e4a3ddd336b3ddff738f7878bc247f5aedc7cb7ee29eb2dbd3044d6a1fc0eb0bd92cfe8ca2f5eed175d22814e89ba224c27926
         | 
    
        data/Gemfile.lock
    CHANGED
    
    
| @@ -39,9 +39,11 @@ module DjiMqttConnect | |
| 39 39 | 
             
                    parsed_message = JSON.parse(raw_message)
         | 
| 40 40 |  | 
| 41 41 | 
             
                    message_data = parsed_message.fetch("data", {})
         | 
| 42 | 
            +
             | 
| 42 43 | 
             
                    message_class = if drone_osd_data_attributes.all? { |attribute| message_data.key?(attribute.to_s) }
         | 
| 43 44 | 
             
                      DroneOsdMessage
         | 
| 44 | 
            -
                    elsif  | 
| 45 | 
            +
                    elsif required_remote_osd_data_attributes.all? { |attribute| message_data.key?(attribute.to_s) } &&
         | 
| 46 | 
            +
                        optional_remote_osd_data_attributes.any? { |attribute| message_data.key?(attribute.to_s) }
         | 
| 45 47 | 
             
                      RemoteOsdMessage
         | 
| 46 48 | 
             
                    elsif dock_osd_data_attributes.any? { |attribute| message_data.key?(attribute.to_s) }
         | 
| 47 49 | 
             
                      DockOsdMessage
         | 
| @@ -72,12 +74,19 @@ module DjiMqttConnect | |
| 72 74 | 
             
                    @drone_osd_data_attributes ||= DroneOsdMessage::STABLE_DATA_ATTRIBUTES.map(&:to_s)
         | 
| 73 75 | 
             
                  end
         | 
| 74 76 |  | 
| 75 | 
            -
                  def  | 
| 76 | 
            -
                    @ | 
| 77 | 
            +
                  def required_remote_osd_data_attributes
         | 
| 78 | 
            +
                    @required_remote_osd_data_attributes ||= begin
         | 
| 77 79 | 
             
                      data_keys = DjiMqttConnect::Thing::Product::RemoteOsdMessage::Data.schema.keys
         | 
| 78 80 | 
             
                      data_keys.select(&:required?).map(&:name)
         | 
| 79 81 | 
             
                    end
         | 
| 80 82 | 
             
                  end
         | 
| 83 | 
            +
             | 
| 84 | 
            +
                  def optional_remote_osd_data_attributes
         | 
| 85 | 
            +
                    @optional_remote_osd_data_attributes ||= begin
         | 
| 86 | 
            +
                      data_keys = DjiMqttConnect::Thing::Product::RemoteOsdMessage::Data.schema.keys
         | 
| 87 | 
            +
                      data_keys.reject(&:required?).map(&:name)
         | 
| 88 | 
            +
                    end
         | 
| 89 | 
            +
                  end
         | 
| 81 90 | 
             
                end
         | 
| 82 91 | 
             
              end
         | 
| 83 92 | 
             
            end
         | 
| @@ -87,37 +87,37 @@ module DjiMqttConnect | |
| 87 87 | 
             
                    # M30 Fields
         | 
| 88 88 |  | 
| 89 89 | 
             
                    attribute? :cameras, Types::Array do
         | 
| 90 | 
            +
                      attribute :payload_index, Types::String
         | 
| 91 | 
            +
             | 
| 90 92 | 
             
                      # {"0":"Photo taking","1":"Recording"}
         | 
| 91 | 
            -
                      attribute :camera_mode, Types::Integer.enum(0, 1)
         | 
| 93 | 
            +
                      attribute? :camera_mode, Types::Integer.enum(0, 1)
         | 
| 92 94 |  | 
| 93 95 | 
             
                      # {"min":2,"max":20}
         | 
| 94 | 
            -
                      attribute :ir_zoom_factor, Types::JSON::Decimal
         | 
| 96 | 
            +
                      attribute? :ir_zoom_factor, Types::JSON::Decimal
         | 
| 95 97 |  | 
| 96 | 
            -
                      attribute :liveview_world_region do
         | 
| 98 | 
            +
                      attribute? :liveview_world_region do
         | 
| 97 99 | 
             
                        attribute :bottom, Types::JSON::Decimal.constrained(gteq: 0, lteq: 1)
         | 
| 98 100 | 
             
                        attribute :left, Types::JSON::Decimal.constrained(gteq: 0, lteq: 1)
         | 
| 99 101 | 
             
                        attribute :right, Types::JSON::Decimal.constrained(gteq: 0, lteq: 1)
         | 
| 100 102 | 
             
                        attribute :top, Types::JSON::Decimal.constrained(gteq: 0, lteq: 1)
         | 
| 101 103 | 
             
                      end
         | 
| 102 104 |  | 
| 103 | 
            -
                      attribute :payload_index, Types::String
         | 
| 104 | 
            -
             | 
| 105 105 | 
             
                      # {"0":"Idle","1":"Taking photo"}
         | 
| 106 | 
            -
                      attribute :photo_state, Types::Integer.enum(0, 1)
         | 
| 106 | 
            +
                      attribute? :photo_state, Types::Integer.enum(0, 1)
         | 
| 107 107 |  | 
| 108 108 | 
             
                      # {"0":"Idle","1":"Recording"}
         | 
| 109 | 
            -
                      attribute :recording_state, Types::Integer.enum(0, 1)
         | 
| 109 | 
            +
                      attribute? :recording_state, Types::Integer.enum(0, 1)
         | 
| 110 110 |  | 
| 111 111 | 
             
                      # {"unit":"s"}
         | 
| 112 | 
            -
                      attribute :record_time, Types::Integer
         | 
| 112 | 
            +
                      attribute? :record_time, Types::Integer
         | 
| 113 113 |  | 
| 114 | 
            -
                      attribute :remain_photo_num, Types::Integer
         | 
| 114 | 
            +
                      attribute? :remain_photo_num, Types::Integer
         | 
| 115 115 |  | 
| 116 116 | 
             
                      # {"unit":"s"}
         | 
| 117 | 
            -
                      attribute :remain_record_duration, Types::Integer
         | 
| 117 | 
            +
                      attribute? :remain_record_duration, Types::Integer
         | 
| 118 118 |  | 
| 119 119 | 
             
                      # {"min":2,"max":200}
         | 
| 120 | 
            -
                      attribute :zoom_factor, Types::JSON::Decimal
         | 
| 120 | 
            +
                      attribute? :zoom_factor, Types::JSON::Decimal
         | 
| 121 121 | 
             
                    end
         | 
| 122 122 |  | 
| 123 123 | 
             
                    # {"0":"Continue to execute the wayline task","1":"Exit the wayline task, and execute the remote controller out of control action."}
         | 
| @@ -8,15 +8,17 @@ module DjiMqttConnect | |
| 8 8 | 
             
                    include Mixins::LongitudeConditional
         | 
| 9 9 |  | 
| 10 10 | 
             
                    attribute :capacity_percent, Types::Integer
         | 
| 11 | 
            +
             | 
| 11 12 | 
             
                    attribute :latitude, Types::Latitude
         | 
| 12 | 
            -
                    attribute : | 
| 13 | 
            +
                    attribute :longitude, Types::Longitude
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                    attribute? :live_status do
         | 
| 13 16 | 
             
                      attribute :live_time, Types::Integer
         | 
| 14 17 | 
             
                      attribute :live_trendline, Types::Integer
         | 
| 15 18 | 
             
                      attribute :video_id, Types::String
         | 
| 16 19 | 
             
                      attribute :video_quality, Types::Integer
         | 
| 17 20 | 
             
                    end
         | 
| 18 | 
            -
                    attribute : | 
| 19 | 
            -
                    attribute :transmission_signal_quality, Types::Integer
         | 
| 21 | 
            +
                    attribute? :transmission_signal_quality, Types::Integer
         | 
| 20 22 | 
             
                    attribute? :wireless_link do
         | 
| 21 23 | 
             
                      attribute :_4g_freq_band, Types::JSON::Decimal
         | 
| 22 24 | 
             
                      attribute :_4g_gnd_quality, Types::Integer
         | 
| @@ -29,7 +31,7 @@ module DjiMqttConnect | |
| 29 31 | 
             
                      attribute :sdr_link_state, Types::Integer
         | 
| 30 32 | 
             
                      attribute :sdr_quality, Types::Integer
         | 
| 31 33 | 
             
                    end
         | 
| 32 | 
            -
                    attribute :wireless_link_state do
         | 
| 34 | 
            +
                    attribute? :wireless_link_state do
         | 
| 33 35 | 
             
                      attribute :download_quality, Types::Integer
         | 
| 34 36 | 
             
                      attribute :frequency_band, Types::Integer
         | 
| 35 37 | 
             
                      attribute :upward_quality, Types::Integer
         |