mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[tibber] Fix SAT warnings (#13835)
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
This commit is contained in:
parent
b696aebb36
commit
3b3d18cef4
@ -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"}
|
||||
|
@ -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());
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user