-
Notifications
You must be signed in to change notification settings - Fork 782
Conversation
Travis fails in unrelkated JSON storage test. |
Retriggering build |
I don‘t understand why so many builds fail lately. This is clearly unrelated, unfortunately before the core tests. |
retriggering build after tests are finally fixed |
fixes #5341 Signed-off-by: Jan N. Klug <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my inline comments. Its all about using predefined conversion factors.
@@ -122,13 +123,19 @@ public String getName() { | |||
public static final Unit<Time> WEEK = addUnit(Units.WEEK); | |||
public static final Unit<Time> YEAR = addUnit(Units.YEAR); | |||
public static final Unit<Volume> LITRE = addUnit(Units.LITRE); | |||
public static final Unit<Energy> WATT_SECOND = addUnit(new ProductUnit<Energy>(Units.WATT.multiply(Units.SECOND))); | |||
public static final Unit<Energy> WATT_HOUR = addUnit(WATT_SECOND.multiply(3600)); | |||
public static final Unit<Energy> KILOWATT_HOUR = addUnit(WATT_HOUR.multiply(1000)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to use the KILO
prefix here:
import static org.eclipse.smarthome.core.library.unit.MetricPrefix.KILO;
// and
public static final Unit<Energy> KILOWATT_HOUR = addUnit(KILO(WATT_HOUR));
@@ -122,13 +123,19 @@ public String getName() { | |||
public static final Unit<Time> WEEK = addUnit(Units.WEEK); | |||
public static final Unit<Time> YEAR = addUnit(Units.YEAR); | |||
public static final Unit<Volume> LITRE = addUnit(Units.LITRE); | |||
public static final Unit<Energy> WATT_SECOND = addUnit(new ProductUnit<Energy>(Units.WATT.multiply(Units.SECOND))); | |||
public static final Unit<Energy> WATT_HOUR = addUnit(WATT_SECOND.multiply(3600)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure but maybe we should define WATT_HOUR also by ProductUnit with Units.HOUR. It already has the factor defined.
done. and integrated in #5336 to avoid merge conflicts |
fixes #5341
Signed-off-by: Jan N. Klug [email protected]