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() { | ||||
|     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() { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user