Module: DjiMqttConnect::Mixins::DroneChargeState

Defined in:
lib/dji_mqtt_connect/mixins/drone_charge_state.rb

Instance Method Summary collapse

Instance Method Details

#humanized_stateObject



6
7
8
9
10
11
12
13
14
# File 'lib/dji_mqtt_connect/mixins/drone_charge_state.rb', line 6

def humanized_state
  state_key = case state
  when Types::DRONE_CHARGE_STATE_NOT_CHARGING
    "Not Charging"
  when Types::DRONE_CHARGE_STATE_CHARGING
    "Charging"
  end
  I18n.t(state_key.parameterize.underscore, scope: "dji_mqtt_connect.dock_drone_charge_state.state", default: state_key)
end