2 * Copyright (c) 2010-2022 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.loxone.internal.types;
15 import org.openhab.binding.loxone.internal.controls.LxControl;
18 * Category of Loxone Miniserver's {@link LxControl} object.
20 * @author Pawel Pieczul - initial contribution
23 public class LxCategory extends LxContainer {
26 * Various categories that Loxone Miniserver's control can belong to.
28 * @author Pawel Pieczul - initial contribution
30 public enum CategoryType {
36 * Category for shading / rollershutter / blinds
40 * Category for temperatures
49 private String type; // deserialized from JSON
50 private CategoryType catType;
53 * Obtain the type of this category
55 * @return type of category
57 public CategoryType getType() {
58 if (catType == null && type != null) {
59 String tl = type.toLowerCase();
60 if ("lights".equals(tl)) {
61 catType = CategoryType.LIGHTS;
62 } else if ("shading".equals(tl)) {
63 catType = CategoryType.SHADING;
64 } else if ("indoortemperature".equals(tl)) {
65 catType = CategoryType.TEMPERATURE;
67 catType = CategoryType.UNDEFINED;