]> git.basschouten.com Git - openhab-addons.git/blob
1a3d6da161cee2efe94f7b3531983762818a2c86
[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.regoheatpump.internal.handler;
14
15 import org.openhab.binding.regoheatpump.internal.RegoHeatPumpBindingConstants;
16 import org.openhab.binding.regoheatpump.internal.protocol.IpRegoConnection;
17 import org.openhab.binding.regoheatpump.internal.protocol.RegoConnection;
18 import org.openhab.core.thing.Thing;
19
20 /**
21  * The {@link IpRego6xxHeatPumpHandler} is responsible for handling commands, which are
22  * sent to one of the channels.
23  *
24  * @author Boris Krivonog - Initial contribution
25  */
26 public class IpRego6xxHeatPumpHandler extends Rego6xxHeatPumpHandler {
27     public IpRego6xxHeatPumpHandler(Thing thing) {
28         super(thing);
29     }
30
31     @Override
32     protected RegoConnection createConnection() {
33         String host = (String) getConfig().get(RegoHeatPumpBindingConstants.HOST_PARAMETER);
34         Integer port = ((Number) getConfig().get(RegoHeatPumpBindingConstants.TCP_PORT_PARAMETER)).intValue();
35
36         return new IpRegoConnection(host, port);
37     }
38 }