2 * Copyright (c) 2010-2023 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.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17 import org.openhab.binding.miele.internal.MieleTranslationProvider;
18 import org.openhab.binding.miele.internal.api.dto.DeviceMetaData;
19 import org.openhab.core.types.State;
22 * The {@link ApplianceChannelSelector} class defines a common interface for
23 * all the data structures used by appliance thing handlers. It is used to traverse
24 * the channels that possibly exist for an appliance, and convert data
25 * returned by the appliance to a compatible State
27 * @author Karel Goderis - Initial contribution
28 * @author Jacob Laursen - Added power/water consumption channels
31 public interface ApplianceChannelSelector {
37 * Returns the ChannelID for the given datapoint
39 String getChannelID();
42 * Returns the Miele defined ID for the given datapoint
47 * Returns true if the given datapoint is to be considered as a Property
48 * instead of a regular modifiable datapoint
53 * Returns true if the given channel is extracted from extended
56 boolean isExtendedState();
59 * Returns a State for the given string, taking into
60 * account the metadata provided as well as text
61 * translations for corresponding numeric values.
63 * @param s - the value to be used to instantiate the State
64 * @param dmd - the device meta data
65 * @param translationProvider {@link MieleTranslationProvider} instance
67 State getState(String s, @Nullable DeviceMetaData dmd, MieleTranslationProvider translationProvider);
70 * Returns a State for the given string, taking into
71 * account the metadata provided. The meta data is sent by
72 * the Miele appliance and is used to decide the State type
74 * @param s - the value to be used to instantiate the State
75 * @param dmd - the device meta data
77 State getState(String s, @Nullable DeviceMetaData dmd);
80 * Returns a raw State for the given string, not taking into
81 * account any metadata.
83 * @param s - the value to be used to instantiate the State
85 State getState(String s);