mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 10:16:46 +00:00
Use horizontal control icons for devices that commonly move horizontally (#5309)
* Use horizontal control icons for devices that commonly move horizontally including: awning curtain gate * no need to check * remove debug * reduce - js is so permissive * remove curtain
This commit is contained in:
parent
ce92add096
commit
3763d7a1d0
@ -19,7 +19,7 @@ class HaCoverControls extends PolymerElement {
|
||||
<div class="state">
|
||||
<paper-icon-button
|
||||
aria-label="Open cover"
|
||||
icon="hass:arrow-up"
|
||||
icon="[[computeOpenIcon(stateObj)]]"
|
||||
on-click="onOpenTap"
|
||||
invisible$="[[!entityObj.supportsOpen]]"
|
||||
disabled="[[computeOpenDisabled(stateObj, entityObj)]]"
|
||||
@ -32,7 +32,7 @@ class HaCoverControls extends PolymerElement {
|
||||
></paper-icon-button>
|
||||
<paper-icon-button
|
||||
aria-label="Close cover"
|
||||
icon="hass:arrow-down"
|
||||
icon="[[computeCloseIcon(stateObj)]]"
|
||||
on-click="onCloseTap"
|
||||
invisible$="[[!entityObj.supportsClose]]"
|
||||
disabled="[[computeClosedDisabled(stateObj, entityObj)]]"
|
||||
@ -60,6 +60,26 @@ class HaCoverControls extends PolymerElement {
|
||||
return new CoverEntity(hass, stateObj);
|
||||
}
|
||||
|
||||
computeOpenIcon(stateObj) {
|
||||
switch (stateObj.attributes.device_class) {
|
||||
case "awning":
|
||||
case "gate":
|
||||
return "hass:arrow-expand-horizontal";
|
||||
default:
|
||||
return "hass:arrow-up";
|
||||
}
|
||||
}
|
||||
|
||||
computeCloseIcon(stateObj) {
|
||||
switch (stateObj.attributes.device_class) {
|
||||
case "awning":
|
||||
case "gate":
|
||||
return "hass:arrow-collapse-horizontal";
|
||||
default:
|
||||
return "hass:arrow-down";
|
||||
}
|
||||
}
|
||||
|
||||
computeOpenDisabled(stateObj, entityObj) {
|
||||
var assumedState = stateObj.attributes.assumed_state === true;
|
||||
return (entityObj.isFullyOpen || entityObj.isOpening) && !assumedState;
|
||||
|
Loading…
x
Reference in New Issue
Block a user