]> git.basschouten.com Git - openhab-addons.git/blob
23b9fae8fc2407655b47bc5e84796409fff18fed
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2021 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.miele.internal.handler;
14
15 import org.openhab.binding.miele.internal.handler.MieleBridgeHandler.DeviceMetaData;
16 import org.openhab.core.types.State;
17
18 /**
19  * The {@link ApplianceChannelSelector} class defines a common interface for
20  * all the data structures used by appliance thing handlers. It is used to traverse
21  * the channels that possibly exist for an appliance, and convert data
22  * returned by the appliance to a compatible State
23  *
24  * @author Karel Goderis - Initial contribution
25  * @author Jacob Laursen - Added power/water consumption channels
26  */
27 public interface ApplianceChannelSelector {
28
29     @Override
30     String toString();
31
32     /**
33      * Returns the ChannelID for the given datapoint
34      */
35     String getChannelID();
36
37     /**
38      * Returns the Miele defined ID for the given datapoint
39      */
40     String getMieleID();
41
42     /**
43      * Returns true if the given datapoint is to be considered as a Property
44      * instead of a regular modifiable datapoint
45      */
46     boolean isProperty();
47
48     /**
49      * Returns true if the given channel is extracted from extended
50      * state information
51      */
52     boolean isExtendedState();
53
54     /**
55      *
56      * Returns a State for the given string, taking into
57      * account the metadata provided. The meta data is sent by
58      * the Miele appliance and is used to decide the State type
59      *
60      * @param s - the value to be used to instantiate the State
61      * @param dmd - the device meta data
62      */
63     State getState(String s, DeviceMetaData dmd);
64 }