]> git.basschouten.com Git - openhab-addons.git/blob
8f78a0d4b43d014ac0c2a350ba24e07ee3a2118c
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 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.nikohomecontrol.internal.protocol.nhc1;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17 import org.openhab.binding.nikohomecontrol.internal.protocol.NhcThermostat;
18 import org.openhab.binding.nikohomecontrol.internal.protocol.NikoHomeControlCommunication;
19 import org.slf4j.Logger;
20 import org.slf4j.LoggerFactory;
21
22 /**
23  * The {@link NhcThermostat1} class represents the thermostat Niko Home Control I communication object. It contains all
24  * fields representing a Niko Home Control thermostat and has methods to set the thermostat in Niko Home Control and
25  * receive thermostat updates.
26  *
27  * @author Mark Herwege - Initial Contribution
28  */
29 @NonNullByDefault
30 public class NhcThermostat1 extends NhcThermostat {
31
32     private final Logger logger = LoggerFactory.getLogger(NhcThermostat1.class);
33
34     NhcThermostat1(String id, String name, @Nullable String location, NikoHomeControlCommunication nhcComm) {
35         super(id, name, location, nhcComm);
36     }
37
38     /**
39      * Sends thermostat mode to Niko Home Control.
40      *
41      * @param mode
42      */
43     @Override
44     public void executeMode(int mode) {
45         logger.debug("execute thermostat mode {} for {}", mode, id);
46
47         nhcComm.executeThermostat(id, Integer.toString(mode));
48     }
49
50     /**
51      * Sends thermostat setpoint to Niko Home Control.
52      *
53      * @param overrule temperature to overrule the setpoint in 0.1°C multiples
54      * @param overruletime time duration in min for overrule
55      */
56     @Override
57     public void executeOverrule(int overrule, int overruletime) {
58         logger.debug("execute thermostat overrule {} during {} min for {}", overrule, overruletime, id);
59
60         nhcComm.executeThermostat(id, overrule, overruletime);
61     }
62 }