2 * Copyright (c) 2010-2020 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;
16 * All panel zone names
18 * @author Laurent Garnier - Initial contribution
20 public enum PowermaxZoneName {
23 ZONE_1(1, "Back door"),
24 ZONE_2(2, "Basement"),
25 ZONE_3(3, "Bathroom"),
27 ZONE_5(5, "Child room"),
30 ZONE_8(8, "Dining room"),
31 ZONE_9(9, "Downstairs"),
32 ZONE_10(10, "Emergency"),
34 ZONE_12(12, "Front door"),
35 ZONE_13(13, "Garage"),
36 ZONE_14(14, "Garage door"),
37 ZONE_15(15, "Guest room"),
39 ZONE_17(17, "Kitchen"),
40 ZONE_18(18, "Laundry room"),
41 ZONE_19(19, "Living room"),
42 ZONE_20(20, "Master bathroom"),
43 ZONE_21(21, "Master bedroom"),
44 ZONE_22(22, "Office"),
45 ZONE_23(23, "Upstairs"),
46 ZONE_24(24, "Utility room"),
48 ZONE_26(26, "Custom 1"),
49 ZONE_27(27, "Custom 2"),
50 ZONE_28(28, "Custom 3"),
51 ZONE_29(29, "Custom 4"),
52 ZONE_30(30, "Custom 5"),
53 ZONE_31(31, "Not Installed");
58 private PowermaxZoneName(int id, String name) {
71 * @return the zone name
73 public String getName() {
78 * Update the zone name
80 * @param name the new zone name
82 public void setName(String name) {
87 * Get the ENUM value from its id
89 * @param id the zone id
91 * @return the corresponding ENUM value
93 * @throws IllegalArgumentException if no ENUM value corresponds to this id
95 public static PowermaxZoneName fromId(int id) throws IllegalArgumentException {
96 for (PowermaxZoneName zone : PowermaxZoneName.values()) {
97 if (zone.getId() == id) {
102 throw new IllegalArgumentException("Invalid id: " + id);