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.powermax.internal.state;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
18 * All panel zone names
20 * @author Laurent Garnier - Initial contribution
23 public enum PowermaxZoneName {
26 ZONE_1(1, "Back door"),
27 ZONE_2(2, "Basement"),
28 ZONE_3(3, "Bathroom"),
30 ZONE_5(5, "Child room"),
33 ZONE_8(8, "Dining room"),
34 ZONE_9(9, "Downstairs"),
35 ZONE_10(10, "Emergency"),
37 ZONE_12(12, "Front door"),
38 ZONE_13(13, "Garage"),
39 ZONE_14(14, "Garage door"),
40 ZONE_15(15, "Guest room"),
42 ZONE_17(17, "Kitchen"),
43 ZONE_18(18, "Laundry room"),
44 ZONE_19(19, "Living room"),
45 ZONE_20(20, "Master bathroom"),
46 ZONE_21(21, "Master bedroom"),
47 ZONE_22(22, "Office"),
48 ZONE_23(23, "Upstairs"),
49 ZONE_24(24, "Utility room"),
51 ZONE_26(26, "Custom 1"),
52 ZONE_27(27, "Custom 2"),
53 ZONE_28(28, "Custom 3"),
54 ZONE_29(29, "Custom 4"),
55 ZONE_30(30, "Custom 5"),
56 ZONE_31(31, "Not Installed");
61 private PowermaxZoneName(int id, String name) {
74 * @return the zone name
76 public String getName() {
81 * Update the zone name
83 * @param name the new zone name
85 public void setName(String name) {
90 * Get the ENUM value from its id
92 * @param id the zone id
94 * @return the corresponding ENUM value
96 * @throws IllegalArgumentException if no ENUM value corresponds to this id
98 public static PowermaxZoneName fromId(int id) throws IllegalArgumentException {
99 for (PowermaxZoneName zone : PowermaxZoneName.values()) {
100 if (zone.getId() == id) {
105 throw new IllegalArgumentException("Invalid id: " + id);