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.solarmax.internal.connector;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
18 * The {@link SolarMaxCommandKey} enum defines the commands that are understood by the SolarMax device
20 * @author Jamie Townsend - Initial contribution
23 public enum SolarMaxCommandKey {
24 // for further commands, that are not implemented here, see this binding's README.md file
26 // Valid commands which returned a non-null value during testing
27 buildNumber("BDN"), //
29 acPhase1Current("IL1"), //
30 acPhase2Current("IL2"), //
31 acPhase3Current("IL3"), //
32 energyGeneratedToday("KDY"), //
33 operatingHours("KHR"), //
34 energyGeneratedYesterday("KLD"), //
35 energyGeneratedLastMonth("KLM"), //
36 energyGeneratedLastYear("KLY"), //
37 energyGeneratedThisMonth("KMT"), //
38 energyGeneratedTotal("KT0"), //
39 energyGeneratedThisYear("KYR"), //
40 currentPowerGenerated("PAC"), //
41 softwareVersion("SWV"), //
42 heatSinkTemperature("TKK"), //
43 acFrequency("TNF"), //
44 acPhase1Voltage("UL1"), //
45 acPhase2Voltage("UL2"), //
46 acPhase3Voltage("UL3"), //
47 UNKNOWN("UNKNOWN") // really unknown - shouldn't ever be sent to the device
50 private String commandKey;
52 private SolarMaxCommandKey(String commandKey) {
53 this.commandKey = commandKey;
56 public String getCommandKey() {
57 return this.commandKey;
60 public static SolarMaxCommandKey getKeyFromString(String commandKey) {
61 for (SolarMaxCommandKey key : SolarMaxCommandKey.values()) {
62 if (key.commandKey.equals(commandKey)) {