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.
|
* 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
|
* @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.
|
* Returns the hours of the best price.
|
||||||
|
@ -76,8 +76,8 @@ public class AwattarConsecutiveBestPriceResult extends AwattarBestPriceResult {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isActive(Instant now) {
|
public boolean isActive(Instant pointInTime) {
|
||||||
return contains(now.toEpochMilli());
|
return contains(pointInTime.toEpochMilli());
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean contains(long timestamp) {
|
public boolean contains(long timestamp) {
|
||||||
|
@ -64,8 +64,8 @@ public class AwattarNonConsecutiveBestPriceResult extends AwattarBestPriceResult
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isActive(Instant now) {
|
public boolean isActive(Instant pointInTime) {
|
||||||
return members.stream().anyMatch(x -> x.timerange().contains(now.toEpochMilli()));
|
return members.stream().anyMatch(x -> x.timerange().contains(pointInTime.toEpochMilli()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user