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.silvercrestwifisocket.internal.enums;
16 * This enum represents the available Wifi Socket vendors.
18 * @author Christian Heimerl - Initial contribution
21 public enum SilvercrestWifiSocketVendor {
22 LIDL_SILVERCREST("C1", "7150"),
23 ALDI_EASYHOME("C2", "92DD");
25 private final String companyCode;
26 private String authenticationCode;
28 SilvercrestWifiSocketVendor(String companyCode, String authenticationCode) {
29 this.companyCode = companyCode;
30 this.authenticationCode = authenticationCode;
34 * Gets the hexadecimal company code included in a request message.
36 * @return the hexadecimal company code
38 public String getCompanyCode() {
39 return this.companyCode;
43 * Gets the hexadecimal authentication code included in a request message
45 * @return the hexadecimal authentication code
47 public String getAuthenticationCode() {
48 return this.authenticationCode;
52 * Returns the SilvercrestWifiSocketVendor matching the given two digit company code.
54 * @param companyCode The two digit company code that should be searched for, e.g. C1
55 * @return A SilvercrestWifiSocketVendor or null if no vendor matches the company code.
57 public static SilvercrestWifiSocketVendor fromCode(String companyCode) {
58 for (SilvercrestWifiSocketVendor v : SilvercrestWifiSocketVendor.values()) {
59 if (v.getCompanyCode().equals(companyCode)) {