-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c714b1e
commit 491460e
Showing
3 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Controller } from "./controller"; | ||
|
||
export class HumidifierController extends Controller { | ||
get _value() { | ||
return this.stateObj.attributes.humidity; | ||
} | ||
|
||
set _value(value) { | ||
this._hass.callService("humidifier", "set_humidity", { | ||
entity_id: this.stateObj.entity_id, | ||
humidity: value, | ||
}); | ||
} | ||
|
||
get string() { | ||
return `${this.value} %`; | ||
} | ||
|
||
get isOff() { | ||
return this.stateObj.state === "off"; | ||
} | ||
|
||
get _min() { | ||
return this.stateObj.attributes.min_humidity; | ||
} | ||
get _max() { | ||
return this.stateObj.attributes.max_humidity; | ||
} | ||
get _step() { | ||
return 1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters