]> git.basschouten.com Git - openhab-addons.git/blob
933466e94560d0f2a2e2a658f9b32e7a8b4b3284
[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.homematic.internal.model;
14
15 /**
16  * Configuration object for sending a datapoint.
17  *
18  * @author Gerhard Riegler - Initial contribution
19  */
20 public class HmDatapointConfig {
21     private Double delay;
22     private Double receiveDelay;
23
24     /**
25      * Returns the delay in seconds for sending the datapoint.
26      */
27     public double getDelay() {
28         return delay == null ? 0.0 : delay;
29     }
30
31     /**
32      * Sets the delay in seconds for sending the datapoint.
33      */
34     public void setDelay(Double delay) {
35         this.delay = delay;
36     }
37
38     /**
39      * Returns the delay in seconds for receiving a new datapoint event.
40      */
41     public Double getReceiveDelay() {
42         return receiveDelay == null ? 0.0 : receiveDelay;
43     }
44
45     /**
46      * Sets the delay in seconds for receiving a datapoint event.
47      */
48     public void setReceiveDelay(Double receiveDelay) {
49         this.receiveDelay = receiveDelay;
50     }
51
52     @Override
53     public String toString() {
54         return String.format("%s[delay=%f,receiveDelay=%f]", getClass().getSimpleName(), delay, receiveDelay);
55     }
56 }