# frozen_string_literal: true module DjiMqttConnect module Thing::Product class DroneOsdMessage < OsdMessage attribute :data do attribute :attitude_head, Types::JSON::Decimal attribute :attitude_pitch, Types::JSON::Decimal attribute :attitude_roll, Types::JSON::Decimal attribute :battery do attribute :batteries, Types::Array do attribute :capacity_percent, Types::Integer attribute :firmware_version, Types::String attribute :index, Types::Integer attribute :loop_times, Types::Integer attribute :sn, Types::String attribute :sub_type, Types::DeviceSubType attribute :temperature, Types::JSON::Decimal attribute :type, Types::DeviceType attribute :voltage, Types::Integer end attribute :capacity_percent, Types::Integer attribute :landing_power, Types::Integer attribute :remain_flight_time, Types::Integer attribute :return_home_power, Types::Integer end attribute :distance_limit_status do attribute :distance_limit, Types::Integer attribute :state, Types::Integer end attribute :elevation, Types::JSON::Decimal attribute :firmware_version, Types::String attribute :gear, Types::Integer attribute :height, Types::JSON::Decimal attribute :height_limit, Types::JSON::Decimal attribute :home_distance, Types::JSON::Decimal attribute :horizontal_speed, Types::JSON::Decimal attribute :latitude, Types::Latitude attribute :longitude, Types::Longitude attribute :mode_code, Types::Integer attribute :position_state do attribute :gps_number, Types::Integer attribute :is_fixed, Types::Integer attribute :quality, Types::Integer attribute :rtk_number, Types::Integer end attribute :storage do attribute :total, Types::Integer attribute :used, Types::Integer end attribute :total_flight_distance, Types::Integer attribute :total_flight_time, Types::Integer attribute :track_id, Types::String attribute :vertical_speed, Types::JSON::Decimal attribute :wind_direction, Types::JSON::Decimal attribute :wind_speed, Types::JSON::Decimal def latitude? !Types::NullInteger.valid?(latitude) end def longitude? !Types::NullInteger.valid?(longitude) end end end end end