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.nikohomecontrol.internal.protocol.nhc2;
15 import static org.openhab.binding.nikohomecontrol.internal.protocol.NikoHomeControlConstants.THERMOSTATMODES;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
19 import org.openhab.binding.nikohomecontrol.internal.protocol.NhcThermostat;
20 import org.openhab.binding.nikohomecontrol.internal.protocol.NikoHomeControlCommunication;
21 import org.slf4j.Logger;
22 import org.slf4j.LoggerFactory;
25 * The {@link NhcThermostat2} class represents the thermostat Niko Home Control II communication object. It contains all
26 * fields representing a Niko Home Control thermostat and has methods to set the thermostat in Niko Home Control and
27 * receive thermostat updates.
29 * @author Mark Herwege - Initial Contribution
32 public class NhcThermostat2 extends NhcThermostat {
34 private final Logger logger = LoggerFactory.getLogger(NhcThermostat2.class);
36 private String deviceType;
37 private String deviceTechnology;
38 private String deviceModel;
40 protected NhcThermostat2(String id, String name, String deviceType, String deviceTechnology, String deviceModel,
41 @Nullable String location, NikoHomeControlCommunication nhcComm) {
42 super(id, name, location, nhcComm);
43 this.deviceType = deviceType;
44 this.deviceTechnology = deviceTechnology;
45 this.deviceModel = deviceModel;
49 public void executeMode(int mode) {
50 logger.debug("execute thermostat mode {} for {}", mode, id);
52 String program = THERMOSTATMODES[mode];
53 nhcComm.executeThermostat(id, program);
57 public void executeOverrule(int overrule, int overruletime) {
58 logger.debug("execute thermostat overrule {} during {} min for {}", overrule, overruletime, id);
60 nhcComm.executeThermostat(id, overrule, overruletime);
64 * @return type as returned from Niko Home Control
66 public String getDeviceType() {
71 * @return technology as returned from Niko Home Control
73 public String getDeviceTechnology() {
74 return deviceTechnology;
78 * @return model as returned from Niko Home Control
80 public String getDeviceModel() {