]> git.basschouten.com Git - openhab-addons.git/blob
a722f0499b1adddd91f7e69f6abaac85636430a1
[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.homematic.internal.converter;
14
15 import org.openhab.binding.homematic.internal.model.HmDatapoint;
16 import org.openhab.core.types.State;
17 import org.openhab.core.types.Type;
18
19 /**
20  * Converter interface for converting between openHAB states/commands and Homematic values.
21  *
22  * @author Gerhard Riegler - Initial contribution
23  */
24 public interface TypeConverter<T extends State> {
25
26     /**
27      * Converts an openHAB type to a Homematic value.
28      */
29     Object convertToBinding(Type type, HmDatapoint dp) throws ConverterException;
30
31     /**
32      * Converts a Homematic value to an openHAB type.
33      */
34     T convertFromBinding(HmDatapoint dp) throws ConverterException;
35 }