Skip to content

Commit

Permalink
Show buttons in cover more info if the cover supports position
Browse files Browse the repository at this point in the history
  • Loading branch information
piitaya committed Oct 28, 2024
1 parent 9db1e52 commit a2c0ab0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/dialogs/more-info/controls/more-info-cover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,15 @@ 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);
!supportsFeature(this.stateObj, CoverEntityFeature.CLOSE_TILT) &&
!supportsFeature(this.stateObj, CoverEntityFeature.STOP_TILT) &&
!supportsFeature(this.stateObj, CoverEntityFeature.SET_POSITION) &&
!supportsFeature(this.stateObj, CoverEntityFeature.SET_TILT_POSITION);

return html`
<ha-more-info-state-header
Expand Down Expand Up @@ -133,7 +136,7 @@ class MoreInfoCover extends LitElement {
${
this._mode === "button"
? html`
${supportsOpenCloseWithoutStop
${supportsOpenCloseOnly
? html`
<ha-state-control-cover-toggle
.stateObj=${this.stateObj}
Expand Down

0 comments on commit a2c0ab0

Please sign in to comment.