]> git.basschouten.com Git - openhab-addons.git/blob
76cae077c136a89ce947c2b5b020de67594a3d32
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 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.somneo.internal.model;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16
17 import com.google.gson.annotations.SerializedName;
18
19 /**
20  * This class represents the program timer state from the API.
21  *
22  * @author Michael Myrcik - Initial contribution
23  */
24 @NonNullByDefault
25 public class TimerData {
26
27     @SerializedName("rlxmn")
28     private int relaxMinutes;
29
30     @SerializedName("rlxsc")
31     private int relaxSeconds;
32
33     @SerializedName("dskmn")
34     private int sunsetMinutes;
35
36     @SerializedName("dsksc")
37     private int sunsetSeconds;
38
39     public int remainingTimeRelax() {
40         return relaxMinutes * 60 + relaxSeconds;
41     }
42
43     public int remainingTimeSunset() {
44         return sunsetMinutes * 60 + sunsetSeconds;
45     }
46 }