]> git.basschouten.com Git - openhab-addons.git/blob
65e1dae5be9dd34dc948946428387c1e893fc8ab
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2020 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.hydrawise.internal.api.model;
14
15 import com.google.gson.annotations.SerializedName;
16
17 /**
18  * The {@link Relay} class models the Relay response message
19  *
20  * @author Dan Cunningham - Initial contribution
21  */
22 public class Relay {
23
24     public Integer relayId;
25
26     public Integer relay;
27
28     public String name;
29
30     public String icon;
31
32     public String lastwater;
33
34     public Integer time;
35
36     public Integer type;
37
38     @SerializedName("run")
39     public String runTime;
40
41     @SerializedName("run_seconds")
42     public Integer runTimeSeconds;
43
44     public String nicetime;
45
46     public String id;
47
48     /**
49      * Returns back the actual relay number when multiple controllers are chained.
50      *
51      * @return
52      */
53     public int getRelayNumber() {
54         int quotient = relay / 100;
55         return (relay - (quotient * 100)) + (quotient * 12);
56     }
57 }