mirror of
https://github.com/zyphlar/LanternPowerMonitor.git
synced 2024-03-08 14:07:47 +00:00
Fix some timezone bugs.
This commit is contained in:
parent
5a1f97abca
commit
cb774d1950
|
@ -1,6 +1,7 @@
|
||||||
package com.lanternsoftware.datamodel.currentmonitor;
|
package com.lanternsoftware.datamodel.currentmonitor;
|
||||||
|
|
||||||
public enum BillingMode {
|
public enum BillingMode {
|
||||||
|
ANY_DIRECTION,
|
||||||
CONSUMPTION,
|
CONSUMPTION,
|
||||||
PRODUCTION;
|
PRODUCTION;
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,9 +119,9 @@ public class BillingRate {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isApplicable(BillingMode _mode, int _meter, double _monthKWh, Date _time, TimeZone _tz) {
|
public boolean isApplicable(BillingMode _mode, int _meter, double _monthKWh, Date _time, TimeZone _tz) {
|
||||||
if (mode != _mode)
|
if ((mode != BillingMode.ANY_DIRECTION) && (mode != _mode))
|
||||||
return false;
|
return false;
|
||||||
if (_meter != meter)
|
if ((meter != -1) && (_meter != meter))
|
||||||
return false;
|
return false;
|
||||||
if ((monthKWhStart > 0) && (_monthKWh < monthKWhStart))
|
if ((monthKWhStart > 0) && (_monthKWh < monthKWhStart))
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user