mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +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.STOP_TILT);
|
||||
|
||||
const supportsOpenCloseWithoutStop =
|
||||
const supportsOpenCloseOnly =
|
||||
supportsFeature(this.stateObj, CoverEntityFeature.OPEN) &&
|
||||
supportsFeature(this.stateObj, CoverEntityFeature.CLOSE) &&
|
||||
!supportsFeature(this.stateObj, CoverEntityFeature.STOP) &&
|
||||
!supportsFeature(this.stateObj, CoverEntityFeature.OPEN_TILT) &&
|
||||
!supportsFeature(this.stateObj, CoverEntityFeature.CLOSE_TILT);
|
||||
!supportsTilt &&
|
||||
!supportsPosition &&
|
||||
!supportsTiltPosition;
|
||||
|
||||
return html`
|
||||
<ha-more-info-state-header
|
||||
@ -133,7 +134,7 @@ class MoreInfoCover extends LitElement {
|
||||
${
|
||||
this._mode === "button"
|
||||
? html`
|
||||
${supportsOpenCloseWithoutStop
|
||||
${supportsOpenCloseOnly
|
||||
? html`
|
||||
<ha-state-control-cover-toggle
|
||||
.stateObj=${this.stateObj}
|
||||
|
@ -83,10 +83,11 @@ class MoreInfoValve extends LitElement {
|
||||
supportsFeature(this.stateObj, ValveEntityFeature.CLOSE) ||
|
||||
supportsFeature(this.stateObj, ValveEntityFeature.STOP);
|
||||
|
||||
const supportsOpenCloseWithoutStop =
|
||||
const supportsOpenCloseOnly =
|
||||
supportsFeature(this.stateObj, ValveEntityFeature.OPEN) &&
|
||||
supportsFeature(this.stateObj, ValveEntityFeature.CLOSE) &&
|
||||
!supportsFeature(this.stateObj, ValveEntityFeature.STOP);
|
||||
!supportsFeature(this.stateObj, ValveEntityFeature.STOP) &&
|
||||
!supportsPosition;
|
||||
|
||||
return html`
|
||||
<ha-more-info-state-header
|
||||
@ -113,7 +114,7 @@ class MoreInfoValve extends LitElement {
|
||||
${
|
||||
this._mode === "button"
|
||||
? html`
|
||||
${supportsOpenCloseWithoutStop
|
||||
${supportsOpenCloseOnly
|
||||
? html`
|
||||
<ha-state-control-valve-toggle
|
||||
.stateObj=${this.stateObj}
|
||||
|
Loading…
x
Reference in New Issue
Block a user