]> git.basschouten.com Git - openhab-addons.git/blob
d9700913bd9c44f949f51c83efb6140787bd2059
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2021 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.nikohomecontrol.internal.protocol.nhc1;
14
15 /**
16  * Class {@link NhcMessageCmd1} used as input to gson to send commands to Niko Home Control. Extends
17  * {@link NhcMessageBase1}.
18  * <p>
19  * Example: <code>{"cmd":"executeactions","id":1,"value1":0}</code>
20  *
21  * @author Mark Herwege - Initial Contribution
22  */
23 @SuppressWarnings("unused")
24 class NhcMessageCmd1 extends NhcMessageBase1 {
25
26     private int id;
27     private int value1;
28     private int value2;
29     private int value3;
30     private int mode;
31     private int overrule;
32     private String overruletime;
33
34     NhcMessageCmd1(String cmd) {
35         super.setCmd(cmd);
36     }
37
38     NhcMessageCmd1(String cmd, int id) {
39         this(cmd);
40         this.id = id;
41     }
42
43     NhcMessageCmd1(String cmd, int id, int value1) {
44         this(cmd, id);
45         this.value1 = value1;
46     }
47
48     NhcMessageCmd1(String cmd, int id, int value1, int value2, int value3) {
49         this(cmd, id, value1);
50         this.value2 = value2;
51         this.value3 = value3;
52     }
53
54     NhcMessageCmd1 withMode(int mode) {
55         this.mode = mode;
56         return this;
57     }
58
59     NhcMessageCmd1 withOverrule(int overrule) {
60         this.overrule = overrule;
61         return this;
62     }
63
64     NhcMessageCmd1 withOverruletime(String overruletime) {
65         this.overruletime = overruletime;
66         return this;
67     }
68 }