mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-26 02:36:37 +00:00
Show buttons in cover and valve more info if it supports position (#22569)
* Show buttons in cover more info if the cover supports position * Same for valve * Refactor
This commit is contained in:
parent
1542095138
commit
3180747a0a
@ -93,12 +93,13 @@ class MoreInfoCover extends LitElement {
|
|||||||
supportsFeature(this.stateObj, CoverEntityFeature.CLOSE_TILT) ||
|
supportsFeature(this.stateObj, CoverEntityFeature.CLOSE_TILT) ||
|
||||||
supportsFeature(this.stateObj, CoverEntityFeature.STOP_TILT);
|
supportsFeature(this.stateObj, CoverEntityFeature.STOP_TILT);
|
||||||
|
|
||||||
const supportsOpenCloseWithoutStop =
|
const supportsOpenCloseOnly =
|
||||||
supportsFeature(this.stateObj, CoverEntityFeature.OPEN) &&
|
supportsFeature(this.stateObj, CoverEntityFeature.OPEN) &&
|
||||||
supportsFeature(this.stateObj, CoverEntityFeature.CLOSE) &&
|
supportsFeature(this.stateObj, CoverEntityFeature.CLOSE) &&
|
||||||
!supportsFeature(this.stateObj, CoverEntityFeature.STOP) &&
|
!supportsFeature(this.stateObj, CoverEntityFeature.STOP) &&
|
||||||
!supportsFeature(this.stateObj, CoverEntityFeature.OPEN_TILT) &&
|
!supportsTilt &&
|
||||||
!supportsFeature(this.stateObj, CoverEntityFeature.CLOSE_TILT);
|
!supportsPosition &&
|
||||||
|
!supportsTiltPosition;
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<ha-more-info-state-header
|
<ha-more-info-state-header
|
||||||
@ -133,7 +134,7 @@ class MoreInfoCover extends LitElement {
|
|||||||
${
|
${
|
||||||
this._mode === "button"
|
this._mode === "button"
|
||||||
? html`
|
? html`
|
||||||
${supportsOpenCloseWithoutStop
|
${supportsOpenCloseOnly
|
||||||
? html`
|
? html`
|
||||||
<ha-state-control-cover-toggle
|
<ha-state-control-cover-toggle
|
||||||
.stateObj=${this.stateObj}
|
.stateObj=${this.stateObj}
|
||||||
|
@ -83,10 +83,11 @@ class MoreInfoValve extends LitElement {
|
|||||||
supportsFeature(this.stateObj, ValveEntityFeature.CLOSE) ||
|
supportsFeature(this.stateObj, ValveEntityFeature.CLOSE) ||
|
||||||
supportsFeature(this.stateObj, ValveEntityFeature.STOP);
|
supportsFeature(this.stateObj, ValveEntityFeature.STOP);
|
||||||
|
|
||||||
const supportsOpenCloseWithoutStop =
|
const supportsOpenCloseOnly =
|
||||||
supportsFeature(this.stateObj, ValveEntityFeature.OPEN) &&
|
supportsFeature(this.stateObj, ValveEntityFeature.OPEN) &&
|
||||||
supportsFeature(this.stateObj, ValveEntityFeature.CLOSE) &&
|
supportsFeature(this.stateObj, ValveEntityFeature.CLOSE) &&
|
||||||
!supportsFeature(this.stateObj, ValveEntityFeature.STOP);
|
!supportsFeature(this.stateObj, ValveEntityFeature.STOP) &&
|
||||||
|
!supportsPosition;
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<ha-more-info-state-header
|
<ha-more-info-state-header
|
||||||
@ -113,7 +114,7 @@ class MoreInfoValve extends LitElement {
|
|||||||
${
|
${
|
||||||
this._mode === "button"
|
this._mode === "button"
|
||||||
? html`
|
? html`
|
||||||
${supportsOpenCloseWithoutStop
|
${supportsOpenCloseOnly
|
||||||
? html`
|
? html`
|
||||||
<ha-state-control-valve-toggle
|
<ha-state-control-valve-toggle
|
||||||
.stateObj=${this.stateObj}
|
.stateObj=${this.stateObj}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user