Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add secondary info type option to Tile card #16661

Closed

Conversation

MadMaxMcKinney
Copy link

@MadMaxMcKinney MadMaxMcKinney commented May 29, 2023

Proposed change

This PR provides an optional setting to the Tile card where a user can hide the state value. This is useful for Entities like Buttons where the state is often not useful information, or for navigational elements.

This PR by default keeps the state information shown, so existing dashboards should remain unaffected.

To expand on this feature, and the reason the UX is a dropdown, is I think adding template support or manual overrides for the secondary information in the Tile could be a great next addition! These additional options can be slotted into the dropdown.

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

Show state

type: tile
entity: sensor.sun_next_dawn
secondary_info_type: state
ha-tile-second-state

Show none

type: tile
entity: sensor.sun_next_dawn
secondary_info_type: none
ha-tile-second-none

UI Configuration

CleanShot 2023-05-29 at 16 59 56@2x

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • 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:

  • Documentation added/updated for www.home-assistant.io
    TODO: Branch made here, will make PR once this PR is approved (unless there's a different process here).

@home-assistant
Copy link

Hi @MadMaxMcKinney

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@@ -256,6 +282,9 @@ export class HuiTileCardEditor
`ui.panel.lovelace.editor.card.tile.${schema.name}`
);

case "secondary_info_type":
return "Secondary info type";
Copy link
Member

Choose a reason for hiding this comment

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

This should be translated/localized

@spacegaier
Copy link
Member

I think the YAML parameter should be just secondary_info to match what we have in the non tile cards (where we have secondary_info and secondary_info_attribute).

Also in the non-tiles we have more secondary info options. Shouldn't those then also exist in the title cards?

@MadMaxMcKinney
Copy link
Author

@spacegaier Good call, I'll add more of the expected secondary options and localize it using the strings from the existing tags.

@piitaya
Copy link
Member

piitaya commented Aug 17, 2023

Hi !
Thanks for the proposal. We discussed that with @bramkragten and we think it can be nice to go a little futher to allow flexibility

Here's the proposal

Allow array of options for secondary_info witch can using state, attributes, last-changed, last-updated.

secondary_info:
   - state
   - preset_mode
   - temperature

It will display : Heat · Eco · 22 °C

As it's a bigger feature, I will make a PR for that proposal.

@piitaya piitaya closed this Aug 18, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Aug 17, 2024
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