]> git.basschouten.com Git - openhab-addons.git/blob
61bd74619808cb46c5981406c763740c8d19a290
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.somfytahoma.internal.handler;
14
15 import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.core.thing.Thing;
19
20 /**
21  * The {@link SomfyTahomaCurtainHandler} is responsible for handling commands,
22  * which are sent to one of the channels of the curtain thing.
23  *
24  * @author Tobias Ammann - Initial contribution
25  * @author Ondrej Pecta - Code optimization
26  */
27 @NonNullByDefault
28 public class SomfyTahomaCurtainHandler extends SomfyTahomaRollerShutterHandler {
29
30     public SomfyTahomaCurtainHandler(Thing thing) {
31         super(thing);
32     }
33
34     @Override
35     protected String getTahomaCommand(String command) {
36         switch (command) {
37             case "OFF":
38             case "DOWN":
39             case "CLOSE":
40                 return COMMAND_CLOSE;
41             case "ON":
42             case "UP":
43             case "OPEN":
44                 return COMMAND_OPEN;
45             case "MOVE":
46             case "MY":
47                 return COMMAND_MY;
48             case "STOP":
49                 return COMMAND_STOP;
50             default:
51                 return COMMAND_SET_CLOSURE;
52         }
53     }
54 }