View Source Grizzly.CommandHandler behaviour (grizzly v8.6.6)

Behaviour for how commands should handle incoming Z-Wave messages

Summary

Types

handle_response()

@type handle_response() ::
  {:complete, response :: any()} | {:continue, state :: any()}

Callbacks

handle_ack(state)

@callback handle_ack(state :: any()) :: handle_response()

handle_command(incoming_command, state)

(optional)
@callback handle_command(incoming_command :: Grizzly.ZWave.Command.t(), state :: any()) ::
  handle_response()

init(original_command, init_state)

@callback init(original_command :: Grizzly.ZWave.Command.t(), init_state :: any()) ::
  {:ok, state :: any()}