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:
@@ -120,7 +120,7 @@ public class TibberHandler extends BaseThingHandler {
|
||||
String jsonResponse = HttpUtil.executeUrl("POST", BASE_URL, httpHeader, inputStream, null,
|
||||
REQUEST_TIMEOUT);
|
||||
|
||||
JsonObject object = (JsonObject) new JsonParser().parse(jsonResponse);
|
||||
JsonObject object = (JsonObject) JsonParser.parseString(jsonResponse);
|
||||
rtEnabled = object.getAsJsonObject("data").getAsJsonObject("viewer").getAsJsonObject("home")
|
||||
.getAsJsonObject("features").get("realTimeConsumptionEnabled").toString();
|
||||
|
||||
@@ -152,7 +152,7 @@ public class TibberHandler extends BaseThingHandler {
|
||||
updateStatus(ThingStatus.ONLINE);
|
||||
}
|
||||
|
||||
JsonObject object = (JsonObject) new JsonParser().parse(jsonResponse);
|
||||
JsonObject object = (JsonObject) JsonParser.parseString(jsonResponse);
|
||||
|
||||
if (jsonResponse.contains("total")) {
|
||||
try {
|
||||
@@ -434,7 +434,7 @@ public class TibberHandler extends BaseThingHandler {
|
||||
logger.debug("Error/terminate received from server: {}", message);
|
||||
close();
|
||||
} else if (message.contains("liveMeasurement")) {
|
||||
JsonObject object = (JsonObject) new JsonParser().parse(message);
|
||||
JsonObject object = (JsonObject) JsonParser.parseString(message);
|
||||
JsonObject myObject = object.getAsJsonObject("payload").getAsJsonObject("data")
|
||||
.getAsJsonObject("liveMeasurement");
|
||||
if (myObject.has("timestamp")) {
|
||||
|
||||
Reference in New Issue
Block a user