public class ZwaveSwitch extends ZwaveDevice implements SwitchWithReturnState, SendDataListener
RequestFrameListener.RequestFrameError
Modifier and Type | Field and Description |
---|---|
static byte |
SWITCH_OFF |
static byte |
SWITCH_ON |
node
Constructor and Description |
---|
ZwaveSwitch(ZwaveNode node) |
Modifier and Type | Method and Description |
---|---|
void |
callbackComplete(byte[] bytes,
int commandClassIndex) |
int |
getLastKnownState()
Get the last known state of this device.
|
ZwaveNode |
getNode() |
void |
notifyComplete() |
void |
notifyError(RequestFrameListener.RequestFrameError error) |
void |
off()
Change the switch state to off.
|
void |
on()
Change the switch state to on.
|
void |
requestStateUpdate()
Ask for this device's state to be updated.
|
void |
setState(int newState) |
getDescriptor, getName, getParent
getChildren
public static final byte SWITCH_OFF
public static final byte SWITCH_ON
public ZwaveSwitch(ZwaveNode node)
public void on() throws java.io.IOException
Switch
public void off() throws java.io.IOException
Switch
public void notifyComplete()
notifyComplete
in interface RequestFrameListener
public void notifyError(RequestFrameListener.RequestFrameError error)
notifyError
in interface RequestFrameListener
public ZwaveNode getNode()
getNode
in interface SendDataListener
public int getLastKnownState()
SwitchWithReturnState
getLastKnownState
in interface SwitchWithReturnState
public void requestStateUpdate() throws java.io.IOException
SwitchWithReturnState
requestStateUpdate
in interface SwitchWithReturnState
java.io.IOException
- if there is a communication error with the devicepublic void setState(int newState)
newState
- the new state.public void callbackComplete(byte[] bytes, int commandClassIndex)
callbackComplete
in interface SendDataListener