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
UNKNOWN_NAME
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
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getChildren, getDescriptor, getName, getParent
public static final byte SWITCH_OFF
public static final byte SWITCH_ON
public ZwaveSwitch(ZwaveNode node)
public void callbackComplete(byte[] bytes, int commandClassIndex)
callbackComplete
in interface SendDataListener
public int getLastKnownState()
SwitchWithReturnState
getLastKnownState
in interface SwitchWithReturnState
public ZwaveNode getNode()
getNode
in interface SendDataListener
public void notifyComplete()
notifyComplete
in interface RequestFrameListener
public void notifyError(RequestFrameListener.RequestFrameError error)
notifyError
in interface RequestFrameListener
public void off() throws IOException
Switch
off
in interface Switch
IOException
- if there is a communication error with the devicepublic void on() throws IOException
Switch
on
in interface Switch
IOException
- if there is a communication error with the devicepublic void requestStateUpdate() throws IOException
SwitchWithReturnState
requestStateUpdate
in interface SwitchWithReturnState
IOException
- if there is a communication error with the devicepublic void setState(int newState)
newState
- the new state.