You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: bundles/org.openhab.binding.energidataservice/README.md
+54-6
Original file line number
Diff line number
Diff line change
@@ -283,10 +283,18 @@ For this reason the resulting `Map` will not contain the keys `LowestPrice` and
283
283
284
284
Example:
285
285
286
-
```javascript
286
+
:::: tabs
287
+
288
+
::: tab DSL
289
+
290
+
```java
287
291
varMap<String, Object> result = actions.calculateCheapestPeriod(now.toInstant(), now.plusHours(12).toInstant(), Duration.ofMinutes(90))
288
292
```
289
293
294
+
:::
295
+
296
+
::::
297
+
290
298
#### `calculateCheapestPeriod` from Duration and Power
291
299
292
300
| Parameter | Type | Description |
@@ -301,10 +309,18 @@ As a result the price is also included in the result.
301
309
302
310
Example:
303
311
304
-
```javascript
312
+
:::: tabs
313
+
314
+
::: tab DSL
315
+
316
+
```java
305
317
varMap<String, Object> result = actions.calculateCheapestPeriod(now.toInstant(), now.plusHours(12).toInstant(), Duration.ofMinutes(90), 250|W)
306
318
```
307
319
320
+
:::
321
+
322
+
::::
323
+
308
324
#### `calculateCheapestPeriod` from Power Phases
309
325
310
326
| Parameter | Type | Description |
@@ -322,7 +338,11 @@ This can be considered as different phases of using power, so each list member r
322
338
323
339
Example:
324
340
325
-
```javascript
341
+
:::: tabs
342
+
343
+
::: tab DSL
344
+
345
+
```java
326
346
val ArrayList<Duration> durationPhases =newArrayList<Duration>()
327
347
durationPhases.add(Duration.ofMinutes(37))
328
348
durationPhases.add(Duration.ofMinutes(8))
@@ -346,6 +366,10 @@ powerPhases.add(0 | W)
346
366
varMap<String, Object> result = actions.calculateCheapestPeriod(now.toInstant(), now.plusHours(12).toInstant(), durationPhases, powerPhases)
347
367
```
348
368
369
+
:::
370
+
371
+
::::
372
+
349
373
Please note that the total duration will be calculated automatically as a sum of provided duration phases.
350
374
Therefore, if the total duration is longer than the sum of phase durations, the remaining duration must be provided as last item with a corresponding 0 W power item.
351
375
This is to ensure that the full program will finish before the provided `latestEnd`.
@@ -368,7 +392,11 @@ Since a last phase may use no significant energy, the total duration must be pro
368
392
369
393
Example:
370
394
371
-
```javascript
395
+
:::: tabs
396
+
397
+
::: tab DSL
398
+
399
+
```java
372
400
val ArrayList<Duration> durationPhases =newArrayList<Duration>()
0 commit comments