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.heos.internal.json.dto;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17 import org.slf4j.Logger;
18 import org.slf4j.LoggerFactory;
21 * Enum to reference the different HEOS events
23 * @author Martin van Wingerden - Initial contribution
26 public enum HeosEvent {
31 PLAYER_NOW_PLAYING_CHANGED,
32 PLAYER_NOW_PLAYING_PROGRESS,
33 PLAYER_PLAYBACK_ERROR,
35 PLAYER_VOLUME_CHANGED,
41 private static final Logger LOGGER = LoggerFactory.getLogger(HeosEvent.class);
44 public static HeosEvent valueOfString(@Nullable String eventCommand) {
45 if (eventCommand == null) {
49 String command = eventCommand.substring(6);
50 return HeosEvent.valueOf(command.toUpperCase());
51 } catch (IllegalArgumentException e) {
52 LOGGER.debug("Unsupported event {}", eventCommand);