2 * Copyright (c) 2010-2021 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);
37 private String technology;
39 protected NhcThermostat2(String id, String name, String model, String technology, @Nullable String location,
40 NikoHomeControlCommunication nhcComm) {
41 super(id, name, location, nhcComm);
43 this.technology = technology;
47 public void executeMode(int mode) {
48 logger.debug("execute thermostat mode {} for {}", mode, id);
50 String program = THERMOSTATMODES[mode];
51 nhcComm.executeThermostat(id, program);
55 public void executeOverrule(int overrule, int overruletime) {
56 logger.debug("execute thermostat overrule {} during {} min for {}", overrule, overruletime, id);
58 nhcComm.executeThermostat(id, overrule, overruletime);
62 * @return model as returned from Niko Home Control
64 public String getModel() {
69 * @return technology as returned from Niko Home Control
71 public String getTechnology() {