Skip to content

Commit

Permalink
Add meter zero option
Browse files Browse the repository at this point in the history
  • Loading branch information
cdjackson committed Jun 29, 2014
1 parent e0706dc commit fbc09b0
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,9 @@ public void handleEvent(ZWaveCommandClassValueEvent event, Item item, Map<String
Object val = event.getValue();

// If we've set a zero, then anything below this value needs to be considered ZERO
if (meterZero != null && MeterScale.getMeterScale(meterScale) != meterEvent.getMeterScale()){
logger.debug("Meter - zero conversion - {}", val.toString());
if (meterZero != null) {
if(((BigDecimal)val).doubleValue() <= Double.parseDouble(meterZero))
val = BigDecimal.ZERO;
logger.debug("Meter - zero conversion - {}", val.toString());
}

State state = converter.convertFromValueToState(val);
Expand Down

0 comments on commit fbc09b0

Please sign in to comment.