mirror of
https://github.com/danieldemus/openhab-addons
synced 2026-07-29 12:34:21 +02:00
Ignore REFRESH (#20192)
Signed-off-by: Paul Smedley <paul@smedley.id.au>
This commit is contained in:
+5
-1
@@ -68,6 +68,7 @@ import org.openhab.core.thing.binding.builder.ThingBuilder;
|
||||
import org.openhab.core.thing.type.ChannelType;
|
||||
import org.openhab.core.thing.type.ChannelTypeRegistry;
|
||||
import org.openhab.core.types.Command;
|
||||
import org.openhab.core.types.RefreshType;
|
||||
import org.openhab.core.types.State;
|
||||
import org.openhab.core.types.StateOption;
|
||||
import org.openhab.core.types.UnDefType;
|
||||
@@ -160,6 +161,9 @@ public class RoborockVacuumHandler extends BaseThingHandler {
|
||||
@Override
|
||||
public void handleCommand(ChannelUID channelUID, Command command) {
|
||||
try {
|
||||
if (RefreshType.REFRESH == command) {
|
||||
return;
|
||||
}
|
||||
if (channelUID.getId().equals(CHANNEL_RPC) || channelUID.getId().equals(CHANNEL_COMMAND)) {
|
||||
String[] commandArray = command.toFullString().split(",", 2);
|
||||
if (commandArray.length == 1) {
|
||||
@@ -219,7 +223,7 @@ public class RoborockVacuumHandler extends BaseThingHandler {
|
||||
updateState(RobotCapabilities.SEGMENT_CLEAN.getChannel(), new StringType("-"));
|
||||
return;
|
||||
}
|
||||
if (channelUID.getId().equals(CHANNEL_FAN_CONTROL)) {
|
||||
if (channelUID.getId().equals(CHANNEL_FAN_CONTROL) && command instanceof QuantityType) {
|
||||
if (Integer.valueOf(command.toString()) > 0) {
|
||||
sendRPCCommand(COMMAND_SET_MODE, "[" + command.toString() + "]");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user