mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 10:16:46 +00:00
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:
parent
15a88385c2
commit
a7fdbc069b
@ -81,15 +81,15 @@ class MoreInfoFan extends LocalizeMixin(EventsMixin(PolymerElement)) {
|
|||||||
<div>[[localize('ui.card.fan.direction')]]</div>
|
<div>[[localize('ui.card.fan.direction')]]</div>
|
||||||
<paper-icon-button
|
<paper-icon-button
|
||||||
icon="hass:rotate-left"
|
icon="hass:rotate-left"
|
||||||
on-click="onDirectionLeft"
|
on-click="onDirectionReverse"
|
||||||
title="Left"
|
title="[[localize('ui.card.fan.reverse')]]"
|
||||||
disabled="[[computeIsRotatingLeft(stateObj)]]"
|
disabled="[[computeIsRotatingReverse(stateObj)]]"
|
||||||
></paper-icon-button>
|
></paper-icon-button>
|
||||||
<paper-icon-button
|
<paper-icon-button
|
||||||
icon="hass:rotate-right"
|
icon="hass:rotate-right"
|
||||||
on-click="onDirectionRight"
|
on-click="onDirectionForward"
|
||||||
title="Right"
|
title="[[localize('ui.card.fan.forward')]]"
|
||||||
disabled="[[computeIsRotatingRight(stateObj)]]"
|
disabled="[[computeIsRotatingForward(stateObj)]]"
|
||||||
></paper-icon-button>
|
></paper-icon-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -164,25 +164,25 @@ class MoreInfoFan extends LocalizeMixin(EventsMixin(PolymerElement)) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onDirectionLeft() {
|
onDirectionReverse() {
|
||||||
this.hass.callService("fan", "set_direction", {
|
this.hass.callService("fan", "set_direction", {
|
||||||
entity_id: this.stateObj.entity_id,
|
entity_id: this.stateObj.entity_id,
|
||||||
direction: "reverse",
|
direction: "reverse",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onDirectionRight() {
|
onDirectionForward() {
|
||||||
this.hass.callService("fan", "set_direction", {
|
this.hass.callService("fan", "set_direction", {
|
||||||
entity_id: this.stateObj.entity_id,
|
entity_id: this.stateObj.entity_id,
|
||||||
direction: "forward",
|
direction: "forward",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
computeIsRotatingLeft(stateObj) {
|
computeIsRotatingReverse(stateObj) {
|
||||||
return stateObj.attributes.direction === "reverse";
|
return stateObj.attributes.direction === "reverse";
|
||||||
}
|
}
|
||||||
|
|
||||||
computeIsRotatingRight(stateObj) {
|
computeIsRotatingForward(stateObj) {
|
||||||
return stateObj.attributes.direction === "forward";
|
return stateObj.attributes.direction === "forward";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -416,7 +416,9 @@
|
|||||||
"fan": {
|
"fan": {
|
||||||
"speed": "Speed",
|
"speed": "Speed",
|
||||||
"oscillate": "Oscillate",
|
"oscillate": "Oscillate",
|
||||||
"direction": "Direction"
|
"direction": "Direction",
|
||||||
|
"forward": "Forward",
|
||||||
|
"reverse": "Reverse"
|
||||||
},
|
},
|
||||||
"light": {
|
"light": {
|
||||||
"brightness": "Brightness",
|
"brightness": "Brightness",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user