From 584b7fa1b6dfce50961aba0429226e2b9088888d Mon Sep 17 00:00:00 2001 From: David Geisler Date: Mon, 28 Nov 2022 23:44:50 +0100 Subject: [PATCH] Add speaker playback state --- .../device/speaker/SpeakerPlaybackState.java | 18 ++++++++++++++++++ .../device/speaker/SpeakerStateAttributes.java | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 dirigera-client-api/src/main/java/de/dvdgeisler/iot/dirigera/client/api/model/device/speaker/SpeakerPlaybackState.java diff --git a/dirigera-client-api/src/main/java/de/dvdgeisler/iot/dirigera/client/api/model/device/speaker/SpeakerPlaybackState.java b/dirigera-client-api/src/main/java/de/dvdgeisler/iot/dirigera/client/api/model/device/speaker/SpeakerPlaybackState.java new file mode 100644 index 0000000..1f54c24 --- /dev/null +++ b/dirigera-client-api/src/main/java/de/dvdgeisler/iot/dirigera/client/api/model/device/speaker/SpeakerPlaybackState.java @@ -0,0 +1,18 @@ +package de.dvdgeisler.iot.dirigera.client.api.model.device.speaker; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public enum SpeakerPlaybackState { + @JsonProperty("playbackIdle") + IDLE, + @JsonProperty("playbackPlaying") + PLAYING, + @JsonProperty("playbackPaused") + PAUSED, + @JsonProperty("playbackNext") + NEXT, + @JsonProperty("playbackPrevious") + PREVIOUS, + @JsonProperty("playbackBuffering") + BUFFERING +} diff --git a/dirigera-client-api/src/main/java/de/dvdgeisler/iot/dirigera/client/api/model/device/speaker/SpeakerStateAttributes.java b/dirigera-client-api/src/main/java/de/dvdgeisler/iot/dirigera/client/api/model/device/speaker/SpeakerStateAttributes.java index 7dec999..4a7af97 100644 --- a/dirigera-client-api/src/main/java/de/dvdgeisler/iot/dirigera/client/api/model/device/speaker/SpeakerStateAttributes.java +++ b/dirigera-client-api/src/main/java/de/dvdgeisler/iot/dirigera/client/api/model/device/speaker/SpeakerStateAttributes.java @@ -6,7 +6,7 @@ @JsonInclude(JsonInclude.Include.NON_NULL) public class SpeakerStateAttributes extends DeviceStateAttributes { - public String playback; + public SpeakerPlaybackState playback; public LocalDateTime playbackLastChangedTimestamp; public SpeakerAudioAttributes playbackAudio; public SpeakerPlaybackPosition playbackPosition;