Mixin for actions that should refuse to run unless the robot's safety
controller is :armed.
Usage
defmodule MyAction do
use Jido.Action,
name: "my_action",
schema: [robot: [type: :atom, required: true]]
use BB.Jido.Action.SafetyAware
@impl Jido.Action
def run(params, context) do
# only reached when robot is :armed
{:ok, %{...}}
end
endThe robot module is looked up first in params[:robot], then in
context[:robot]. If the robot is not :armed, the action returns
{:error, {:safety_not_armed, state}} without invoking run/2.