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