Skip to content

Add buttons header-footer#4601

Merged
bramkragten merged 4 commits into
devfrom
buttons-header-footer
Jan 27, 2020
Merged

Add buttons header-footer#4601
bramkragten merged 4 commits into
devfrom
buttons-header-footer

Conversation

@balloob
Copy link
Copy Markdown
Member

@balloob balloob commented Jan 25, 2020

Breaking change

Proposed change

Proposal for a buttons header/footer card to be able to easily activate scripts/scenes. Bare minimum implemented, MVP.

Screen Shot 2020-01-24 at 21 22 18

Screen Shot 2020-01-24 at 21 22 34

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

return html`
<div>
<state-badge
@click=${this._toggle}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@click=${this._toggle}
.title=${computeTooltip(this.hass, entityConf)}
@click=${this._toggle}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this, but was this your strategy so that I would fix computeTooltip to work ? :P

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😂 it didn't work? No, I had no idea

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It only works if you had an action defined. I currently only do toggle.

(element as LovelaceRow).hass = hass;
}
);
this.shadowRoot!.querySelectorAll(".header-footer > *").forEach(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use @queryAll(".header-footer > *") decorator

import { toggleEntity } from "../common/entity/toggle-entity";

@customElement("hui-buttons-header-footer")
export class HuiGlanceCard extends LitElement implements LovelaceHeaderFooter {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export class HuiGlanceCard extends LitElement implements LovelaceHeaderFooter {
export class HuiButtonsHeaderFooter extends LitElement implements LovelaceHeaderFooter {

@balloob
Copy link
Copy Markdown
Member Author

balloob commented Jan 25, 2020

Addressed comments.

@balloob
Copy link
Copy Markdown
Member Author

balloob commented Jan 27, 2020

@bramkragten bramkragten merged commit 82fb622 into dev Jan 27, 2020
@delete-merged-branch delete-merged-branch Bot deleted the buttons-header-footer branch January 27, 2020 08:34
@lock lock Bot locked and limited conversation to collaborators Jan 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants