Sha256: 54e6c88766ab3b461e44be537418d31171fb95c49f899f1d71109b8002d96622

Contents?: true

Size: 689 Bytes

Versions: 2

Compression:

Stored size: 689 Bytes

Contents

# frozen_string_literal: true

module DjiMqttConnect
  module Thing::Product
    class OsdMessage < DjiMqttConnect::Message
      attribute :tid, Types::UUID
      attribute :bid, Types::UUID
      attribute :timestamp, Types::Timestamp

      # Can be determined from the topic, but included for convenience
      attribute :gateway, Types::SerialNumber

      # Backup of received data
      attribute :_data, Types::Hash

      attribute :data, Types::Hash.default({}.freeze)

      def humanized_summary
        Translations.thing_product_osd_summary(**humanized_summary_interpolation)
      end

      def humanized_summary_interpolation
        data.to_h
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dji_mqtt_connect-0.1.25.1 lib/dji_mqtt_connect/messages/thing/product/osd_message.rb
dji_mqtt_connect-0.1.25 lib/dji_mqtt_connect/messages/thing/product/osd_message.rb