Remove deprecated handleUpdate from ThingHandler (#8558)

The handleUpdate method was deprecated when profiles were introduced (see eclipse-archived/smarthome#4108).
Instead the "follow profile" can be used which forwards item updates as commands to handlers.
This profile works with any binding instead of only those that implement the handleUpdate method.

Related to openhab/openhab-core#1669

Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
Wouter Born
2020-09-24 17:50:47 +02:00
committed by GitHub
parent 4d67ef2a6b
commit cc042dabff
16 changed files with 4 additions and 88 deletions

View File

@@ -202,20 +202,20 @@ public class Cm11aBridgeHandler extends BaseBridgeHandler implements ReceivedDat
// Perform appropriate update based on X10Command received
// Handle ON/OFF commands
if (cmd == X10ReceivedData.X10COMMAND.ON) {
handleUpdate(channelUid, OnOffType.ON);
updateState(channelUid, OnOffType.ON);
handler.setCurrentState(OnOffType.ON);
} else if (cmd == X10ReceivedData.X10COMMAND.OFF) {
handleUpdate(channelUid, OnOffType.OFF);
updateState(channelUid, OnOffType.OFF);
handler.setCurrentState(OnOffType.OFF);
// Handle DIM/Bright commands
} else if (cmd == X10ReceivedData.X10COMMAND.DIM) {
State newState = handler.addDimsToCurrentState(dims);
handleUpdate(channelUid, newState);
updateState(channelUid, newState);
handler.setCurrentState(newState);
logger.debug("Current state set to: {}", handler.getCurrentState().toFullString());
} else if (cmd == X10ReceivedData.X10COMMAND.BRIGHT) {
State newState = handler.addBrightsToCurrentState(dims);
handleUpdate(channelUid, newState);
updateState(channelUid, newState);
handler.setCurrentState(newState);
logger.debug("Current state set to: {}", handler.getCurrentState().toFullString());
} else {
@@ -223,16 +223,6 @@ public class Cm11aBridgeHandler extends BaseBridgeHandler implements ReceivedDat
}
}
/**
* The default implementation of this method doesn't do anything. We need it to update the ui as done by the
* updateState function.
* And, update state can not be called directly because it is protected
*/
@Override
public void handleUpdate(ChannelUID channelUID, State newState) {
updateState(channelUID, newState);
}
/**
* Get the X10Interface
*