View Source Grizzly.VirtualDevices (grizzly v4.0.0)
Virtual devices
Virtual devices are in-memory devices that act like a Z-Wave device
Link to this section Summary
Types
Options for adding a virtual devices
Id for a virtual device
Options for removing virtual devices
Functions
Add a new virtual device to the virtual device network
List all the virtual devices on the virtual device network
Remove a virtual device from the virtual device network
Send a Z-Wave command to a virtual device
Link to this section Types
@type add_opt() :: {:inclusion_handler, Grizzly.handler()}
Options for adding a virtual devices
:inclusion_handler
- if an inclusion handler is provider via the add options it will override the initial inclusion handle argument to the network server if one was provided only for that one call toadd_device/2
.
@type id() :: {:virtual, integer()}
Id for a virtual device
@type remove_opt() :: {:inclusion_handler, Grizzly.handler()}
Options for removing virtual devices
:inclusion_handler
- if an inclusion handler is provider via the add options it will override the initial inclusion handle argument to the network server if one was provided only for that one call toremove_device/2
.
Link to this section Functions
@spec add_device( Grizzly.VirtualDevices.Device.t() | {Grizzly.VirtualDevices.Device.t(), term()}, [ add_opt() ] ) :: {:ok, id()}
Add a new virtual device to the virtual device network
To add a virtual device you must supply a module that implements the
Grizzly.VirtualDevices.Device
behaviour.
If the device takes any options you can pass a tuple of {device, opts}
.
@spec list_nodes() :: [id()]
List all the virtual devices on the virtual device network
@spec remove_device(id(), [remove_opt()]) :: :ok
Remove a virtual device from the virtual device network
@spec send_command(id(), Grizzly.ZWave.Command.t()) :: Grizzly.send_command_response()
Send a Z-Wave command to a virtual device