]> git.basschouten.com Git - openhab-addons.git/blob
bd2a8d6196af09b160aa27c203966bcff992d1cd
[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.yamahareceiver.internal.protocol;
14
15 /**
16  * Performs conversion logic between canonical input names and underlying Yamaha protocol.
17  *
18  * For example, AVRs when setting input 'AUDIO_X' (or HDMI_X) need the input to be sent in this form.
19  * However, what comes back in the status update from the AVR is 'AUDIOX' (and 'HDMIX') respectively.
20  *
21  * @author Tomasz Maruszak - Initial contribution
22  */
23 public interface InputConverter {
24
25     /**
26      * Converts the canonical input name to name used by the protocol
27      *
28      * @param name canonical name
29      * @return command name
30      */
31     String toCommandName(String name);
32
33     /**
34      * Converts the state name used by the protocol to canonical input name
35      *
36      * @param name state name
37      * @return canonical name
38      */
39     String fromStateName(String name);
40 }