2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.radiothermostat.internal.dto;
15 import com.google.gson.annotations.SerializedName;
18 * The {@link RadioThermostatTimeDTO} is responsible for storing
19 * the "time" node from the thermostat JSON response
21 * @author Michael Lobstein - Initial contribution
23 public class RadioThermostatTimeDTO {
24 @SerializedName("day")
25 private Integer dayOfWeek;
27 @SerializedName("hour")
30 @SerializedName("minute")
31 private Integer minute;
33 public RadioThermostatTimeDTO() {
36 public Integer getDayOfWeek() {
40 public Integer getHour() {
44 public Integer getMinute() {
49 * Convenience method to return the total number of runtime minutes
51 * @return {runtime hours + minutes as minutes Integer}
53 public Integer getRuntime() {
54 return (hour * 60) + minute;
58 * Get formatted thermostat date stamp
60 * @return {Day of week/Time string}
62 public String getThemostatDateTime() {
65 switch (dayOfWeek.toString()) {
90 return day + hour + ":" + String.format("%02d", minute);