gson fields alias (#15829)

Signed-off-by: Leo Siepel <leosiepel@gmail.com>
This commit is contained in:
lsiepel 2023-11-03 22:05:31 +01:00 committed by GitHub
parent 888f4388a3
commit 7724f16e7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 35 additions and 10 deletions

View File

@ -14,6 +14,8 @@ package org.openhab.binding.mycroft.internal.api.dto;
import org.openhab.binding.mycroft.internal.api.MessageType;
import com.google.gson.annotations.SerializedName;
/**
* This message informs the bus clients that Mycroft
* is actively listening and trying to do STT.
@ -29,7 +31,8 @@ public class MessageRecognizerLoopRecordBegin extends BaseMessage {
}
public static class Context {
public String client_name = "";
@SerializedName("client_name")
public String clientName = "";
public String source = "";
public String destination = "";
}

View File

@ -14,6 +14,8 @@ package org.openhab.binding.mycroft.internal.api.dto;
import org.openhab.binding.mycroft.internal.api.MessageType;
import com.google.gson.annotations.SerializedName;
/**
* This message informs the bus clients that Mycroft
* finished listening to the mic.
@ -29,7 +31,8 @@ public class MessageRecognizerLoopRecordEnd extends BaseMessage {
}
public static class Context {
public String client_name = "";
@SerializedName("client_name")
public String clientName = "";
public String source = "";
public String destination = "";
}

View File

@ -17,6 +17,8 @@ import java.util.List;
import org.openhab.binding.mycroft.internal.api.MessageType;
import com.google.gson.annotations.SerializedName;
/**
* This message is sent to the skills
* module to trigger an intent from a text.
@ -36,7 +38,7 @@ public class MessageRecognizerLoopUtterance extends BaseMessage {
public MessageRecognizerLoopUtterance(String utterance) {
this();
this.data.utterances.add(utterance);
this.context.client_name = "java_api";
this.context.clientName = "java_api";
this.context.source = "audio";
this.context.destination.add("skills");
}
@ -46,7 +48,8 @@ public class MessageRecognizerLoopUtterance extends BaseMessage {
}
public static class Context {
public String client_name = "";
@SerializedName("client_name")
public String clientName = "";
public String source = "";
public List<String> destination = new ArrayList<>();
}

View File

@ -17,6 +17,8 @@ import java.util.List;
import org.openhab.binding.mycroft.internal.api.MessageType;
import com.google.gson.annotations.SerializedName;
/**
* This message is sent to the Mycroft audio module
* to trigger a TTS action.
@ -41,11 +43,13 @@ public class MessageSpeak extends BaseMessage {
public static class Data {
public String utterance = "";
public String expect_response = "";
@SerializedName("expect_response")
public String expectResponse = "";
};
public static class Context {
public String client_name = "";
@SerializedName("client_name")
public String clientName = "";
public List<String> source = new ArrayList<>();
public String destination = "";
}

View File

@ -14,6 +14,8 @@ package org.openhab.binding.mycroft.internal.api.dto;
import org.openhab.binding.mycroft.internal.api.MessageType;
import com.google.gson.annotations.SerializedName;
/**
* This message asks Mycroft to decrease the volume by 10%
*
@ -28,6 +30,7 @@ public class MessageVolumeDecrease extends BaseMessage {
}
public static class Data {
public Boolean play_sound = true;
@SerializedName("play_sound")
public Boolean playSound = true;
}
}

View File

@ -14,6 +14,8 @@ package org.openhab.binding.mycroft.internal.api.dto;
import org.openhab.binding.mycroft.internal.api.MessageType;
import com.google.gson.annotations.SerializedName;
/**
* This message asks Mycroft to increase the volume by 10%
*
@ -28,6 +30,7 @@ public class MessageVolumeIncrease extends BaseMessage {
}
public static class Data {
public Boolean play_sound = true;
@SerializedName("play_sound")
public Boolean playSound = true;
}
}

View File

@ -14,6 +14,8 @@ package org.openhab.binding.mycroft.internal.api.dto;
import org.openhab.binding.mycroft.internal.api.MessageType;
import com.google.gson.annotations.SerializedName;
/**
* This message asks Mycroft to mute the volume
*
@ -28,6 +30,7 @@ public class MessageVolumeMute extends BaseMessage {
}
public static class Data {
public Boolean speak_message = false;
@SerializedName("speak_messsage")
public Boolean speakMesssage = false;
}
}

View File

@ -14,6 +14,8 @@ package org.openhab.binding.mycroft.internal.api.dto;
import org.openhab.binding.mycroft.internal.api.MessageType;
import com.google.gson.annotations.SerializedName;
/**
* This message asks Mycroft to unmute the volume
*
@ -28,6 +30,7 @@ public class MessageVolumeUnmute extends BaseMessage {
}
public static class Data {
public Boolean speak_message = false;
@SerializedName("speak_messsage")
public Boolean speakMessage = false;
}
}