Update input-number-controller.js

refactored after Thomas review
This commit is contained in:
Matus Ivanecky authored and Thomas Lovén committed 2019-08-04 20:22:56 +02:00
1 parent 0e8175b38d
commit 9b36cf25bb
1 file changed
+1 -4
+1 -4
View File
@@ -14,10 +14,7 @@ export class InputNumberController extends Controller {
}
get string() {
if (typeof this.stateObj.attributes.unit_of_measurement === "undefined") {
this.stateObj.attributes.unit_of_measurement = "";
}
return `${parseFloat(this.stateObj.state)} ${this.stateObj.attributes.unit_of_measurement}`;
return `${parseFloat(this.stateObj.state)} ${this.stateObj.attributes.unit_of_measurement || ""}`.trim();
}
get isOff() {