Resolve itest runbundles for Gson and Commons Lang upgrades and fix JsonParser deprecations (#10345)
* Resolve itest runbundles for Gson and Commons Lang upgrades * Fix JsonParser deprecations too * Fix feature verification Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
@@ -39,7 +39,7 @@ public class CeilingDevice extends DeviceBase {
|
||||
|
||||
@Override
|
||||
public void onNotify(String msg) {
|
||||
JsonObject result = new JsonParser().parse(msg).getAsJsonObject();
|
||||
JsonObject result = JsonParser.parseString(msg).getAsJsonObject();
|
||||
try {
|
||||
if (result.has("id")) {
|
||||
String id = result.get("id").getAsString();
|
||||
|
||||
@@ -41,7 +41,7 @@ public class CeilingDeviceWithAmbientDevice extends CeilingDevice
|
||||
public void onNotify(String msg) {
|
||||
logger.debug("Got state: {}", msg);
|
||||
|
||||
JsonObject result = new JsonParser().parse(msg).getAsJsonObject();
|
||||
JsonObject result = JsonParser.parseString(msg).getAsJsonObject();
|
||||
|
||||
if (result.has("id")) {
|
||||
String id = result.get("id").getAsString();
|
||||
|
||||
@@ -40,7 +40,7 @@ public class CeilingDeviceWithNightDevice extends CeilingDevice implements Devic
|
||||
public void onNotify(String msg) {
|
||||
logger.debug("Got state: {}", msg);
|
||||
|
||||
JsonObject result = new JsonParser().parse(msg).getAsJsonObject();
|
||||
JsonObject result = JsonParser.parseString(msg).getAsJsonObject();
|
||||
|
||||
if (result.has("id")) {
|
||||
String id = result.get("id").getAsString();
|
||||
|
||||
@@ -39,7 +39,7 @@ public class CtBulbDevice extends DeviceBase {
|
||||
|
||||
@Override
|
||||
public void onNotify(String msg) {
|
||||
JsonObject result = new JsonParser().parse(msg).getAsJsonObject();
|
||||
JsonObject result = JsonParser.parseString(msg).getAsJsonObject();
|
||||
try {
|
||||
if (result.has("id")) {
|
||||
String id = result.get("id").getAsString();
|
||||
|
||||
@@ -39,7 +39,7 @@ public class DesklampDevice extends DeviceBase {
|
||||
|
||||
@Override
|
||||
public void onNotify(String msg) {
|
||||
JsonObject result = new JsonParser().parse(msg).getAsJsonObject();
|
||||
JsonObject result = JsonParser.parseString(msg).getAsJsonObject();
|
||||
try {
|
||||
if (result.has("id")) {
|
||||
String id = result.get("id").getAsString();
|
||||
|
||||
@@ -76,13 +76,13 @@ public abstract class DeviceBase {
|
||||
|
||||
public void onNotify(String response) {
|
||||
boolean needNotify = true;
|
||||
JsonObject message = new JsonParser().parse(response).getAsJsonObject();
|
||||
JsonObject message = JsonParser.parseString(response).getAsJsonObject();
|
||||
try {
|
||||
if (message.has("method")) {
|
||||
String method = message.get("method").toString().replace("\"", "");
|
||||
if (method.equals("props")) {// Property notify
|
||||
String params = message.get("params").toString();
|
||||
JsonObject propsObject = new JsonParser().parse(params).getAsJsonObject();
|
||||
JsonObject propsObject = JsonParser.parseString(params).getAsJsonObject();
|
||||
for (Entry<String, JsonElement> prop : propsObject.entrySet()) {
|
||||
final YeelightDeviceProperty property = YeelightDeviceProperty.fromString(prop.getKey());
|
||||
if (null == property) {
|
||||
|
||||
@@ -37,7 +37,7 @@ public class MonoDevice extends DeviceBase {
|
||||
|
||||
@Override
|
||||
public void onNotify(String msg) {
|
||||
JsonObject result = new JsonParser().parse(msg).getAsJsonObject();
|
||||
JsonObject result = JsonParser.parseString(msg).getAsJsonObject();
|
||||
try {
|
||||
if (result.has("id")) {
|
||||
String id = result.get("id").getAsString();
|
||||
|
||||
@@ -39,7 +39,7 @@ public class PitayaDevice extends DeviceBase {
|
||||
|
||||
@Override
|
||||
public void onNotify(String msg) {
|
||||
JsonObject result = new JsonParser().parse(msg).getAsJsonObject();
|
||||
JsonObject result = JsonParser.parseString(msg).getAsJsonObject();
|
||||
try {
|
||||
if (result.has("id")) {
|
||||
String id = result.get("id").getAsString();
|
||||
|
||||
@@ -39,7 +39,7 @@ public class WonderDevice extends DeviceBase {
|
||||
|
||||
@Override
|
||||
public void onNotify(String msg) {
|
||||
JsonObject result = new JsonParser().parse(msg).getAsJsonObject();
|
||||
JsonObject result = JsonParser.parseString(msg).getAsJsonObject();
|
||||
try {
|
||||
if (result.has("id")) {
|
||||
String id = result.get("id").getAsString();
|
||||
|
||||
Reference in New Issue
Block a user