]> git.basschouten.com Git - openhab-addons.git/blob
e9598b8def7d86b68ba0ebcd5360e00d871ec18c
[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.lcn.internal.common;
14
15 import java.math.BigDecimal;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.core.library.types.PercentType;
19
20 /**
21  * Holds the information to control dimmer outputs of an LCN module. Used when the user configured an "output" profile.
22  *
23  * @author Fabian Wolter - Initial Contribution
24  */
25 @NonNullByDefault
26 public class DimmerOutputCommand extends PercentType {
27     private static final long serialVersionUID = 8147502412107723798L;
28     private final boolean controlAllOutputs;
29     private final boolean controlOutputs12;
30     private final int rampMs;
31
32     public DimmerOutputCommand(BigDecimal value, boolean controlAllOutputs, boolean controlOutputs12, int rampMs) {
33         super(value);
34         this.controlAllOutputs = controlAllOutputs;
35         this.controlOutputs12 = controlOutputs12;
36         this.rampMs = rampMs;
37     }
38
39     /**
40      * Gets the ramp.
41      *
42      * @return ramp in milliseconds
43      */
44     public int getRampMs() {
45         return rampMs;
46     }
47
48     /**
49      * Returns if all dimmer outputs shall be controlled.
50      *
51      * @return true, if all dimmer outputs shall be controlled
52      */
53     public boolean isControlAllOutputs() {
54         return controlAllOutputs;
55     }
56
57     /**
58      * Returns if dimmer outputs 1+2 shall be controlled.
59      *
60      * @return true, if dimmer outputs 1+2 shall be controlled
61      */
62     public boolean isControlOutputs12() {
63         return controlOutputs12;
64     }
65 }