]> git.basschouten.com Git - openhab-addons.git/commitdiff
gson fields alias (#15829)
authorlsiepel <leosiepel@gmail.com>
Fri, 3 Nov 2023 21:05:31 +0000 (22:05 +0100)
committerGitHub <noreply@github.com>
Fri, 3 Nov 2023 21:05:31 +0000 (22:05 +0100)
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
bundles/org.openhab.binding.mycroft/src/main/java/org/openhab/binding/mycroft/internal/api/dto/MessageRecognizerLoopRecordBegin.java
bundles/org.openhab.binding.mycroft/src/main/java/org/openhab/binding/mycroft/internal/api/dto/MessageRecognizerLoopRecordEnd.java
bundles/org.openhab.binding.mycroft/src/main/java/org/openhab/binding/mycroft/internal/api/dto/MessageRecognizerLoopUtterance.java
bundles/org.openhab.binding.mycroft/src/main/java/org/openhab/binding/mycroft/internal/api/dto/MessageSpeak.java
bundles/org.openhab.binding.mycroft/src/main/java/org/openhab/binding/mycroft/internal/api/dto/MessageVolumeDecrease.java
bundles/org.openhab.binding.mycroft/src/main/java/org/openhab/binding/mycroft/internal/api/dto/MessageVolumeIncrease.java
bundles/org.openhab.binding.mycroft/src/main/java/org/openhab/binding/mycroft/internal/api/dto/MessageVolumeMute.java
bundles/org.openhab.binding.mycroft/src/main/java/org/openhab/binding/mycroft/internal/api/dto/MessageVolumeUnmute.java

index 44386f267b35fe757d60d6097c9420a92c19c51a..a1cadc4dddecf58254ec2540b168d9fa8d18d46a 100644 (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 = "";
     }
index c6998b8dae429463484a685f04a3d5656359c2d1..3da0b2aefa4624803c56ccc92223b00c369558b6 100644 (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 = "";
     }
index b6d6ab4939db71cac723e652bec9fe3aa7ae5b6f..243e7c59f0f39fc30ecbe1498d9ede3cd7180449 100644 (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<>();
     }
index b2ceb9bcfe9e0242b64337ca85c884f20d5a913c..c6335ccf578cc0cf098715eb7aad9da43e5dcdac 100644 (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 = "";
     }
index 2f1e2c8946752719812e79a815796c26aaaebb11..e46fedb1b01d19928c00cddf3932cf09d92a8d7d 100644 (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;
     }
 }
index bd95c180caa7a6cc491d5cdbf8adbaa9d9005d1b..5b38d7852aa469c3f2dd20f020d28fa901cc4fac 100644 (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;
     }
 }
index 4c2ab434af01ce7512936ca4d0603a315206175c..7013f85346943816a72811b4b0cc99d2379f7084 100644 (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;
     }
 }
index 91602e87256d23ff5ed349f0e6cdd5f1e3b6b944..7334cc6c9a7b41e36f404334d32f40a7a5091473 100644 (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;
     }
 }