Class: DjiMqttConnect::Thing::Product::FlightHubDroneOsdMessage

Inherits:
OsdMessage
  • Object
show all
Defined in:
lib/dji_mqtt_connect/messages/thing/product/osd/flight_hub_drone.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from OsdMessage

#humanized_summary_interpolation

Methods inherited from Message

current_timestamp, generate_bid, generate_tid, #to_s

Class Method Details

.matches?(parsed_message_data) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
9
10
11
12
13
14
# File 'lib/dji_mqtt_connect/messages/thing/product/osd/flight_hub_drone.rb', line 6

def self.matches?(parsed_message_data)
  required_keys = FlightHubDroneOsdMessage::Data::Host.schema.keys.select(&:required?)

  parsed_message_data.key?("OrganizationUUID") &&
    parsed_message_data.dig("data", "host").is_a?(Hash) &&
    required_keys.all? do |key|
      parsed_message_data.dig("data", "host").key?(key.name.to_s)
    end
end

Instance Method Details

#humanized_summaryObject



251
252
253
# File 'lib/dji_mqtt_connect/messages/thing/product/osd/flight_hub_drone.rb', line 251

def humanized_summary
  Translations.thing_product_flight_hub_drone_osd_summary(**humanized_summary_interpolation)
end