use of org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveAssociationCommandClass.ZWaveAssociationEvent in project openhab1-addons by openhab.
the class ZWaveConfiguration method ZWaveIncomingEvent.
/**
* Event handler method for incoming Z-Wave events.
*
* @param event
* the incoming Z-Wave event.
*/
@Override
public void ZWaveIncomingEvent(ZWaveEvent event) {
if (event instanceof ZWaveConfigurationParameterEvent) {
// Write the node to disk
ZWaveNodeSerializer nodeSerializer = new ZWaveNodeSerializer();
nodeSerializer.SerializeNode(zController.getNode(event.getNodeId()));
// We've received an updated configuration parameter
// See if this is something in our 'pending' list and remove it
PendingCfg.Remove(ZWaveCommandClass.CommandClass.CONFIGURATION.getKey(), event.getNodeId(), ((ZWaveConfigurationParameterEvent) event).getParameter().getIndex());
return;
}
if (event instanceof ZWaveAssociationEvent) {
// Write the node to disk
ZWaveNodeSerializer nodeSerializer = new ZWaveNodeSerializer();
nodeSerializer.SerializeNode(zController.getNode(event.getNodeId()));
// See if this is something in our 'pending' list and remove it
for (ZWaveNode node : zController.getNodes()) {
PendingCfg.Remove(ZWaveCommandClass.CommandClass.ASSOCIATION.getKey(), event.getNodeId(), ((ZWaveAssociationEvent) event).getGroup(), node.getNodeId());
}
return;
}
if (event instanceof ZWaveWakeUpCommandClass.ZWaveWakeUpEvent) {
// We only care about the wake-up report
if (((ZWaveWakeUpCommandClass.ZWaveWakeUpEvent) event).getEvent() != ZWaveWakeUpCommandClass.WAKE_UP_INTERVAL_REPORT) {
return;
}
// Write the node to disk
ZWaveNodeSerializer nodeSerializer = new ZWaveNodeSerializer();
nodeSerializer.SerializeNode(zController.getNode(event.getNodeId()));
// Remove this node from the pending list
PendingCfg.Remove(ZWaveCommandClass.CommandClass.WAKE_UP.getKey(), event.getNodeId());
return;
}
if (event instanceof ZWaveSwitchAllCommandClass.ZWaveSwitchAllModeEvent) {
ZWaveSwitchAllCommandClass.ZWaveSwitchAllModeEvent e = (ZWaveSwitchAllCommandClass.ZWaveSwitchAllModeEvent) event;
// Write the node to disk
ZWaveNodeSerializer nodeSerializer = new ZWaveNodeSerializer();
nodeSerializer.SerializeNode(zController.getNode(event.getNodeId()));
// Remove this node from the pending list
PendingCfg.Remove(ZWaveCommandClass.CommandClass.SWITCH_ALL.getKey(), e.getNodeId());
return;
}
if (event instanceof ZWaveInclusionEvent) {
handleInclusionEvent((ZWaveInclusionEvent) event);
}
}
Aggregations