Update input-number-controller.js
refactored after Thomas review
This commit is contained in:
parent
0e8175b38d
commit
9b36cf25bb
@ -14,10 +14,7 @@ export class InputNumberController extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get string() {
|
get string() {
|
||||||
if (typeof this.stateObj.attributes.unit_of_measurement === "undefined") {
|
return `${parseFloat(this.stateObj.state)} ${this.stateObj.attributes.unit_of_measurement || ""}`.trim();
|
||||||
this.stateObj.attributes.unit_of_measurement = "";
|
|
||||||
}
|
|
||||||
return `${parseFloat(this.stateObj.state)} ${this.stateObj.attributes.unit_of_measurement}`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get isOff() {
|
get isOff() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user