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.yamahareceiver.internal.config;
15 import java.util.Optional;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
23 * @author Tomasz Maruszak - Initial contribution.
26 public class YamahaBridgeConfig {
29 * The host name of the Yamaha AVR.
31 private @Nullable String host;
33 * Port under which the control interface is exposed on the Yamaha AVR.
35 private int port = 80;
37 * Interval (in seconds) at which state updates are polled.
39 private int refreshInterval = 60; // Default: Every 1min
41 * The default album image placeholder URL used when the source does not provide its own.
43 private String albumUrl = "";
45 * Input source mapping for each command. This is a comma separated list of settings.
47 private String inputMapping = "";
49 public @Nullable String getHost() {
53 public int getPort() {
57 public int getRefreshInterval() {
58 return refreshInterval;
61 public String getAlbumUrl() {
65 public Optional<String> getHostWithPort() {
66 final String str = host;
67 if (str == null || str.isEmpty()) {
68 return Optional.empty();
70 return Optional.of(str + ":" + port);
73 public String getInputMapping() {