2 * Copyright (c) 2010-2021 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.miele.internal.handler;
15 import org.openhab.binding.miele.internal.handler.MieleBridgeHandler.DeviceMetaData;
16 import org.openhab.core.types.State;
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
24 * @author Karel Goderis - Initial contribution
25 * @author Jacob Laursen - Added power/water consumption channels
27 public interface ApplianceChannelSelector {
33 * Returns the ChannelID for the given datapoint
35 String getChannelID();
38 * Returns the Miele defined ID for the given datapoint
43 * Returns true if the given datapoint is to be considered as a Property
44 * instead of a regular modifiable datapoint
49 * Returns true if the given channel is extracted from extended
52 boolean isExtendedState();
55 * Returns a State for the given string, taking into
56 * account the metadata provided. The meta data is sent by
57 * the Miele appliance and is used to decide the State type
59 * @param s - the value to be used to instantiate the State
60 * @param dmd - the device meta data
62 State getState(String s, DeviceMetaData dmd);
65 * Returns a raw State for the given string, not taking into
66 * account any metadata.
68 * @param s - the value to be used to instantiate the State
70 State getState(String s);