Grizzly.SwitchBinary (grizzly v0.22.0) View Source
Commands for working with devices that support the Switch Binary command class
Link to this section Summary
Types
Optional parameters used when setting the switch state
The value the switch's state can be set to
Link to this section Types
Specs
report() :: %{ target_value: Grizzly.ZWave.Commands.SwitchBinaryReport.value(), current_value: Grizzly.ZWave.Commands.SwitchBinaryReport.value() | nil, duration: byte() | nil, version: 1 | 2 }
The report received after requesting the state fo the switch using the
get/1
function.
Specs
set_opt() :: {:duration, non_neg_integer()}
Optional parameters used when setting the switch state
:duration
- the duration that the transition from current state to target state should take (version 2).
Specs
set_value() :: :on | :off
The value the switch's state can be set to
Link to this section Functions
Specs
get(Grizzly.ZWave.node_id(), [Grizzly.command_opt()]) :: {:ok, report()} | {:queued, reference(), non_neg_integer()} | {:error, :timeout | :including | :updating_firmware | :nack_response | any()}
Request the current state of the switch
This command will return a report()
in response.
Specs
set(Grizzly.ZWave.node_id(), set_value(), [set_opt() | Grizzly.command_opt()]) :: :ok | {:queued, reference(), non_neg_integer()} | {:error, :timeout | :including | :updating_firmware | :nack_response | any()}
Set the target value of the binary switch
Devices that support version 2 of the switch binary command class and optionally be passed a duration that specifies the duration of the transition from the current value to the target value.