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 climate preset tile feature #17946

Merged
merged 6 commits into from
Sep 21, 2023

Conversation

Weissnix4711
Copy link
Contributor

@Weissnix4711 Weissnix4711 commented Sep 17, 2023

Proposed change

Adds climate preset mode feature to tile card.

Preview 1

Preview 2

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 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:

@home-assistant

This comment was marked as resolved.

@Weissnix4711 Weissnix4711 marked this pull request as ready for review September 17, 2023 16:06
@piitaya
Copy link
Member

piitaya commented Sep 19, 2023

Hello 👋 Thank you for the contribution.
Preset can be custom so we will not have icon for every preset so I don't think we can use icon only for presets. But in the other hand, using the preset name will not be fine too because it will not fit this design. That's the main reason we didn't add this feature for now. I will discuss that with the team.

Here's an example of my thermostat :
CleanShot 2023-09-19 at 11 07 36

@Weissnix4711
Copy link
Contributor Author

Weissnix4711 commented Sep 19, 2023

Yup, I realised when messing with it.

Maybe we could either exclude custom presets, or allow the user to configure an icon for each custom preset?

Only issue with the latter would be how to handle additional presets which turn up after the card has already been configured. We could include them (with no icon, which just doesn't fix anything), or just ignore them and the card must manually be reconfigured for them to show up. Either way, not an ideal solution.

Maybe use the custom preset's first letter as opposed to the entire name? But again, won't work very well if there are multiple custom presets which start with the same letter.

Idk, if you can come up with a better solution, please let me know.

@piitaya
Copy link
Member

piitaya commented Sep 19, 2023

I discussed with the design team and we can not use icon only component for custom presets because some custom presets doesn't have icon.
We will look to add a select dropdown component that fit the tile feature (similar than the one we have in the more info). This component could be used for preset mode, fan mode, swing mode but also for select and input_select.

We will also look how we can provide icons for custom presets (not only in tile card but for more info too) and then having icon only component for preset mode can make sense.

@Weissnix4711
Copy link
Contributor Author

we can not use icon only component for custom presets

No worries, makes sense. As a compromise, how about only including presets with known icons (ie. all the default ones) for now, until a better solution is found?

We will also look how we can provide icons for custom presets (not only in tile card but for more info too)

That would be quite interesting. I feel like the tile cards work so well because of their simplicity, and the other option, a drop down, might undo some of that. I guess it's always better to have something than nothing though, and if the dropdown feature could be reused for other stuff, that's even better.

@piitaya
Copy link
Member

piitaya commented Sep 21, 2023

Hello 👋
We added dropdown for select and input_select feature. I will merge this PR and then do another PR to add support for both style (icons and dropdown). I will also let the user choose which preset to display because preset list can be huge and will not work with icons style.

@piitaya piitaya merged commit bf12eaa into home-assistant:dev Sep 21, 2023
8 checks passed
@frenck frenck added the Noteworthy Marks a PR as noteworthy and should be in the release notes (in case it normally would not appear) label Sep 21, 2023
@Weissnix4711 Weissnix4711 deleted the climate-preset-tile-feature branch September 21, 2023 15:54
@github-actions github-actions bot locked and limited conversation to collaborators Sep 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-signed Noteworthy Marks a PR as noteworthy and should be in the release notes (in case it normally would not appear) Tile card
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants