Skip to content

Commit

Permalink
gson fields alias (openhab#15829)
Browse files Browse the repository at this point in the history
Signed-off-by: Leo Siepel <[email protected]>
  • Loading branch information
lsiepel authored and andrewfg committed Nov 26, 2023
1 parent 2d5ce5a commit 19cfbcf
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

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.
Expand All @@ -29,7 +31,8 @@ public MessageRecognizerLoopRecordBegin() {
}

public static class Context {
public String client_name = "";
@SerializedName("client_name")
public String clientName = "";
public String source = "";
public String destination = "";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

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.
Expand All @@ -29,7 +31,8 @@ public MessageRecognizerLoopRecordEnd() {
}

public static class Context {
public String client_name = "";
@SerializedName("client_name")
public String clientName = "";
public String source = "";
public String destination = "";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

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.
Expand All @@ -36,7 +38,7 @@ public MessageRecognizerLoopUtterance() {
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");
}
Expand All @@ -46,7 +48,8 @@ public static class Data {
}

public static class Context {
public String client_name = "";
@SerializedName("client_name")
public String clientName = "";
public String source = "";
public List<String> destination = new ArrayList<>();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

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.
Expand All @@ -41,11 +43,13 @@ public MessageSpeak(String textToSay) {

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 = "";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

import org.openhab.binding.mycroft.internal.api.MessageType;

import com.google.gson.annotations.SerializedName;

/**
* This message asks Mycroft to decrease the volume by 10%
*
Expand All @@ -28,6 +30,7 @@ public MessageVolumeDecrease() {
}

public static class Data {
public Boolean play_sound = true;
@SerializedName("play_sound")
public Boolean playSound = true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

import org.openhab.binding.mycroft.internal.api.MessageType;

import com.google.gson.annotations.SerializedName;

/**
* This message asks Mycroft to increase the volume by 10%
*
Expand All @@ -28,6 +30,7 @@ public MessageVolumeIncrease() {
}

public static class Data {
public Boolean play_sound = true;
@SerializedName("play_sound")
public Boolean playSound = true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

import org.openhab.binding.mycroft.internal.api.MessageType;

import com.google.gson.annotations.SerializedName;

/**
* This message asks Mycroft to mute the volume
*
Expand All @@ -28,6 +30,7 @@ public MessageVolumeMute() {
}

public static class Data {
public Boolean speak_message = false;
@SerializedName("speak_messsage")
public Boolean speakMesssage = false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

import org.openhab.binding.mycroft.internal.api.MessageType;

import com.google.gson.annotations.SerializedName;

/**
* This message asks Mycroft to unmute the volume
*
Expand All @@ -28,6 +30,7 @@ public MessageVolumeUnmute() {
}

public static class Data {
public Boolean speak_message = false;
@SerializedName("speak_messsage")
public Boolean speakMessage = false;
}
}

0 comments on commit 19cfbcf

Please sign in to comment.