AutoApi.VehicleStatusState.put_state

You're seeing just the function put_state, go back to AutoApi.VehicleStatusState module for more information.
Link to this function

put_state(vehicle_state, state)

View Source

Specs

put_state(t(), AutoApi.State.t()) :: t()

Add a state entry to the provided VehicleStatus state.

This is intended as a convenience wrapper on AutoApi.State.put that wraps the provided state into a SetCommand.

This is because VehicleStatus.states entries makes only sense as a SetCommand (as they contain the states data).

Example

iex> empty_vs_state = AutoApi.VehicleStatusState.base()
iex> state = %AutoApi.HoodState{position: %AutoApi.Property{data: :open}}
iex> vs_state = AutoApi.VehicleStatusState.put_state(empty_vs_state, state)
iex> %{states: [%AutoApi.Property{data: hood_command}]} = vs_state
iex> %AutoApi.SetCommand{capability: AutoApi.HoodCapability, state: hood_state} = hood_command
iex> hood_state
%AutoApi.HoodState{position: %AutoApi.Property{data: :open}}