View Source Grizzly.VirtualDevices.Device behaviour (grizzly v3.0.0)

Behaviour for implementing virtual device specifics

Link to this section Summary

Types

t()

A module that implements this behaviour

Callbacks

Handle a Z-Wave command

Initialize the device

Link to this section Types

@type t() :: module()

A module that implements this behaviour

Link to this section Callbacks

Link to this callback

handle_command(t, state)

View Source
@callback handle_command(Grizzly.ZWave.Command.t(), state :: term()) ::
  {:reply, Grizzly.ZWave.Command.t() | :ack_response, state :: term()}
  | {:noreply, state :: term()}

Handle a Z-Wave command

@callback init() ::
  {:ok, state :: term(), Grizzly.ZWave.DeviceClass.t()} | {:error, term()}

Initialize the device