]> git.basschouten.com Git - openhab-addons.git/commitdiff
[tibber] Fix SAT warnings (#13835)
authorlsiepel <leosiepel@gmail.com>
Sun, 4 Dec 2022 11:18:20 +0000 (12:18 +0100)
committerGitHub <noreply@github.com>
Sun, 4 Dec 2022 11:18:20 +0000 (12:18 +0100)
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
bundles/org.openhab.binding.tibber/README.md
bundles/org.openhab.binding.tibber/src/main/java/org/openhab/binding/tibber/internal/handler/TibberHandler.java
bundles/org.openhab.binding.tibber/src/main/java/org/openhab/binding/tibber/internal/handler/TibberPriceConsumptionHandler.java

index 3407a3ef98e152fec89d4167f476ca17191e6849..4935e15263c7b8ec4b6390ebd13f655ad4b4cf7b 100644 (file)
@@ -212,7 +212,7 @@ Thing tibber:tibberapi:7cfae492 [ homeid="xxx", token="xxxxxxx" ]
 ```
 
 ### demo.items:
-.
+
 ```
 Number:Dimensionless       TibberAPICurrentTotal                 "Current Total Price [%.2f NOK]"            {channel="tibber:tibberapi:7cfae492:current_total"}
 DateTime                   TibberAPICurrentStartsAt              "Timestamp - Current Price"                 {channel="tibber:tibberapi:7cfae492:current_startsAt"}
index 27ca48e64d6696861f2c722bb1dad9298f539ead..307993fee48bf101c3cda0670bccca9ac1a1ef51 100644 (file)
@@ -206,7 +206,6 @@ public class TibberHandler extends BaseThingHandler {
 
                     updateChannel(DAILY_COST, myObject.get("cost").toString());
                     updateChannel(DAILY_CONSUMPTION, myObject.get("consumption").toString());
-
                 } catch (JsonSyntaxException e) {
                     updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR,
                             "Error communicating with Tibber API: " + e.getMessage());
@@ -226,7 +225,6 @@ public class TibberHandler extends BaseThingHandler {
 
                     updateChannel(HOURLY_COST, myObject.get("cost").toString());
                     updateChannel(HOURLY_CONSUMPTION, myObject.get("consumption").toString());
-
                 } catch (JsonSyntaxException e) {
                     updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR,
                             "Error communicating with Tibber API: " + e.getMessage());
index a32db9f5576f909305d9adcf21507c4df38f274e..7b603858f4b5e1895cfc2ea949a8edd459ac9132 100644 (file)
@@ -32,9 +32,9 @@ public class TibberPriceConsumptionHandler {
     }
 
     public InputStream getInputStream(String homeId) {
-        String Query = "{\"query\": \"{viewer {home (id: \\\"" + homeId
+        String query = "{\"query\": \"{viewer {home (id: \\\"" + homeId
                 + "\\\") {currentSubscription {priceInfo {current {total startsAt level } tomorrow { startsAt total }}} daily: consumption(resolution: DAILY, last: 1) {nodes {from to cost unitPrice consumption consumptionUnit}} hourly: consumption(resolution: HOURLY, last: 1) {nodes {from to cost unitPrice consumption consumptionUnit}}}}}\"}";
-        return new ByteArrayInputStream(Query.getBytes(StandardCharsets.UTF_8));
+        return new ByteArrayInputStream(query.getBytes(StandardCharsets.UTF_8));
     }
 
     public InputStream getRealtimeInputStream(String homeId) {