[tibber] Fix SAT warnings (#13835)

Signed-off-by: Leo Siepel <leosiepel@gmail.com>
This commit is contained in:
lsiepel 2022-12-04 12:18:20 +01:00 committed by GitHub
parent b696aebb36
commit 3b3d18cef4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 5 deletions

View 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"}

View 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());

View 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) {