Update fan direction (#3547)

* Handle current_direction in more-info-fan

* remove current_direction changes

* add forward/reverse to translations
This commit is contained in:
Ian Richardson 2019-08-30 19:29:17 -05:00 committed by Paulus Schoutsen
parent 15a88385c2
commit a7fdbc069b
2 changed files with 13 additions and 11 deletions

View File

@ -81,15 +81,15 @@ class MoreInfoFan extends LocalizeMixin(EventsMixin(PolymerElement)) {
<div>[[localize('ui.card.fan.direction')]]</div>
<paper-icon-button
icon="hass:rotate-left"
on-click="onDirectionLeft"
title="Left"
disabled="[[computeIsRotatingLeft(stateObj)]]"
on-click="onDirectionReverse"
title="[[localize('ui.card.fan.reverse')]]"
disabled="[[computeIsRotatingReverse(stateObj)]]"
></paper-icon-button>
<paper-icon-button
icon="hass:rotate-right"
on-click="onDirectionRight"
title="Right"
disabled="[[computeIsRotatingRight(stateObj)]]"
on-click="onDirectionForward"
title="[[localize('ui.card.fan.forward')]]"
disabled="[[computeIsRotatingForward(stateObj)]]"
></paper-icon-button>
</div>
</div>
@ -164,25 +164,25 @@ class MoreInfoFan extends LocalizeMixin(EventsMixin(PolymerElement)) {
});
}
onDirectionLeft() {
onDirectionReverse() {
this.hass.callService("fan", "set_direction", {
entity_id: this.stateObj.entity_id,
direction: "reverse",
});
}
onDirectionRight() {
onDirectionForward() {
this.hass.callService("fan", "set_direction", {
entity_id: this.stateObj.entity_id,
direction: "forward",
});
}
computeIsRotatingLeft(stateObj) {
computeIsRotatingReverse(stateObj) {
return stateObj.attributes.direction === "reverse";
}
computeIsRotatingRight(stateObj) {
computeIsRotatingForward(stateObj) {
return stateObj.attributes.direction === "forward";
}
}

View File

@ -416,7 +416,9 @@
"fan": {
"speed": "Speed",
"oscillate": "Oscillate",
"direction": "Direction"
"direction": "Direction",
"forward": "Forward",
"reverse": "Reverse"
},
"light": {
"brightness": "Brightness",