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.paradoxalarm.internal.communication.messages;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.slf4j.Logger;
17 import org.slf4j.LoggerFactory;
20 * The {@link PartitionCommand} Enum representing the possible commands for a partition with the respective integer
21 * values that are sent as nibbles in the packet.
23 * @author Konstantin Polihronov - Initial contribution
26 public enum PartitionCommand {
35 private static final Logger logger = LoggerFactory.getLogger(PartitionCommand.class);
39 PartitionCommand(int command) {
40 this.command = command;
43 public int getCommand() {
47 public static PartitionCommand parse(String command) {
49 return PartitionCommand.valueOf(command);
50 } catch (IllegalArgumentException e) {
51 logger.debug("Unable to parse command={}. Fallback to UNKNOWN.", command);
52 return PartitionCommand.UNKNOWN;