mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[awattar] rename now to pointInTime
Signed-off-by: Thomas Leber <thomas@tl-photography.at>
This commit is contained in:
parent
71b17c018e
commit
11f60da2d6
@ -52,10 +52,10 @@ public abstract class AwattarBestPriceResult {
|
||||
/**
|
||||
* Returns true if the best price is active.
|
||||
*
|
||||
* @param now the current time
|
||||
* @param pointInTime the current time
|
||||
* @return true if the best price is active, false otherwise
|
||||
*/
|
||||
public abstract boolean isActive(Instant now);
|
||||
public abstract boolean isActive(Instant pointInTime);
|
||||
|
||||
/**
|
||||
* Returns the hours of the best price.
|
||||
|
@ -76,8 +76,8 @@ public class AwattarConsecutiveBestPriceResult extends AwattarBestPriceResult {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive(Instant now) {
|
||||
return contains(now.toEpochMilli());
|
||||
public boolean isActive(Instant pointInTime) {
|
||||
return contains(pointInTime.toEpochMilli());
|
||||
}
|
||||
|
||||
public boolean contains(long timestamp) {
|
||||
|
@ -64,8 +64,8 @@ public class AwattarNonConsecutiveBestPriceResult extends AwattarBestPriceResult
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive(Instant now) {
|
||||
return members.stream().anyMatch(x -> x.timerange().contains(now.toEpochMilli()));
|
||||
public boolean isActive(Instant pointInTime) {
|
||||
return members.stream().anyMatch(x -> x.timerange().contains(pointInTime.toEpochMilli()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user