2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.loxone.internal.controls;
15 import java.io.IOException;
17 import org.openhab.binding.loxone.internal.types.LxUuid;
18 import org.openhab.core.library.types.OnOffType;
19 import org.openhab.core.types.Command;
22 * A pushbutton type of control on Loxone Miniserver.
24 * According to Loxone API documentation, a pushbutton control covers virtual input of type pushbutton
26 * @author Pawel Pieczul - initial contribution
29 class LxControlPushbutton extends LxControlSwitch {
31 static class Factory extends LxControlInstance {
33 LxControl create(LxUuid uuid) {
34 return new LxControlPushbutton(uuid);
44 * Command string used to set control's state to ON and OFF (tap)
46 private static final String CMD_PULSE = "Pulse";
48 LxControlPushbutton(LxUuid uuid) {
53 void handleSwitchCommands(Command command) throws IOException {
54 if (command instanceof OnOffType onOffCommand) {
55 if (onOffCommand == OnOffType.ON) {
56 sendAction(CMD_PULSE);