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

Favorite Button and Horizontal Fix #1256

Merged
merged 6 commits into from
Jun 12, 2023
Merged

Favorite Button and Horizontal Fix #1256

merged 6 commits into from
Jun 12, 2023

Conversation

benbur98
Copy link
Contributor

@benbur98 benbur98 commented Apr 6, 2023

Have added a Favorites button to the card:
image

Have also fixed the Horizontal mode display to display multiple options if selected:
image

This PR fixes or closes issue: fixes #1215 and #1251
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.
    I have followed the contribution guidelines
    This PR is for a custom-card or documentation change and therefore directed to the main branch.
  • This PR is for a official card or any other directly to the integration related change and therefore directed to the release branch.

@benbur98 benbur98 marked this pull request as ready for review April 11, 2023 16:46
@benbur98
Copy link
Contributor Author

As in issue #1215, changes to the horizontal mode to allow a 'priority' item are planned. I think it makes sense to have a separate PR for this as changes will likely be consistent on other cards too. This PR is hence ready for review/merge.

@basbruss
Copy link
Collaborator

The only problem I see for now is that if enable_tilt is set the slider is on the top line.
And what should be the placement if enable_slider, enable_tilt, and enable_controls are all set?
image

image

@benbur98
Copy link
Contributor Author

benbur98 commented Apr 12, 2023

@basbruss thanks for having a look, I've thought the same thing. I personally don't really have a preference of the order.

I don't know the best way for this to work (currently it's just in one order - buttons, slider, tilt)... open to ideas

@shift-del1
Copy link

@benbur98 @basbruss My recommendation would be the following:

  • define a default order for the controls, like
    • slider
    • movement control
    • tilt control
  • use the variable"horizontal" to pick one element from the list (so not a true/false anymore, but a given value), which should be removed from the vertical stack and be placed inline with the name/label
    Do you think it would make sense?

@benbur98
Copy link
Contributor Author

@shift-del1 I've implemented this as you've suggested in the last comment. Personally I think it's a little clumsy so will think about how best to do it in the future (this will be common across other cards too so need some common solution).

@shift-del1
Copy link

Thank you. This was just my idea, but I'm open for anything else better :-)

@basbruss basbruss merged commit 398aed6 into UI-Lovelace-Minimalist:release Jun 12, 2023
1 check passed
@dankarization
Copy link

After this "fix" it is impossible to get a card without controls, but with slider and 1 unit of height
image

  - type: "custom:button-card"
    template: card_cover
    entity: cover.drivent_453
    variables:
      ulm_card_cover_enable_controls: false
      ulm_card_cover_enable_slider: true
      ulm_card_cover_enable_horizontal: true
      ulm_card_cover_gate: false
      ulm_card_cover_garage: false

This is my previous configuration, getting me smth like the 2nd photo, but without tilt buttons at the bottom.
image

@benbur98
Copy link
Contributor Author

For this, changing ulm_card_cover_enable_horizontal: true -> ulm_card_cover_enable_horizontal: slider should allow this - it will set the slider as the priority horizontal element in the card. Maybe overlooked this change as a breaking change...

@dankarization
Copy link

Yep, changing true to slider helped, thx. This was not obvious at all, since all other parameters takes boolean inputs

@benbur98 benbur98 deleted the cover_card_favorite branch June 25, 2023 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants