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.max.internal.command;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
19 * The {@link FCommand} is used to query and update the NTP servers used by the Cube.
21 * @author Marcel Verpaalen - Initial Contribution
24 public class FCommand extends CubeCommand {
26 private String ntpServer1 = "";
27 private String ntpServer2 = "";
30 * Queries the Cube for the NTP info
36 * Updates the Cube the NTP info
38 public FCommand(@Nullable String ntpServer1, @Nullable String ntpServer2) {
39 this.ntpServer1 = ntpServer1 != null ? ntpServer1 : "";
40 this.ntpServer2 = ntpServer2 != null ? ntpServer2 : "";
44 public String getCommandString() {
46 if (ntpServer1.length() > 0 && ntpServer2.length() > 0) {
47 servers = ntpServer1 + "," + ntpServer2;
49 servers = ntpServer1 + ntpServer2;
51 return "f:" + servers + '\r' + '\n';
55 public String getReturnStrings() {