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

Presets again broken with Home Assistant 2023.4.6? #128

Open
TobiasSchwarz74 opened this issue Apr 27, 2023 · 7 comments
Open

Presets again broken with Home Assistant 2023.4.6? #128

TobiasSchwarz74 opened this issue Apr 27, 2023 · 7 comments

Comments

@TobiasSchwarz74
Copy link

The problem

I tried to use the presets as defined in the documentation, but they are not working.
Only "mushroom" works, but no own preset templates.

Maybe again broken with Home Assistant 2023.4.6?

What version of Paper Buttons Row has the issue?

2.1.3

What version of Home Assistant are you running?

Home Assistant 2023.4.6

What version of the Frontend are you running?

Frontend 20230411.1 - latest

Example YAML snippet

see docs

Anything in the logs that might be useful for us?

No response

Additional information

No response

@ton6i
Copy link

ton6i commented May 8, 2023

I had the same and it will work after refresh the browser.

My preset:

paper_buttons_row:
presets:
main_button:
styles:
name:
color: var(--primary-text-color)
font-size: 15px
margin-left: 15px
button:
width: 100%
margin-left: 0%
justify-content: flex-start
state_styles:
'on':
icon:
color: var(--state-active-color)
'true':
icon:
color: var(--state-active-color)
state_button:
styles:
button:
height: 20px
width: 20px
margin-top: 3%
margin-left: 3%
margin-right: 0%
border: 0px solid
border-radius: 17px
name:
color: var(--secondary-text-color)
font-size: 10px
state:
color: var(--primary-text-color)
font-size: 16px
state_styles:
'on':
icon:
color: var(--state-active-color)
'true':
icon:
color: var(--state-active-color)

My control:

  • type: custom:paper-buttons-row
    buttons:
    • entity: light.lamp_hal_links
      preset: main_button
      name: hal
      layout: icon|name
      tap_action:
      action: call-service
      service: light.toggle
      service_data:
      entity_id: light.lamp_hal_links, light.lamp_hal_rechts
    • entity: light.lamp_hal_links
      preset: state_button
      layout: icon
    • entity: light.lamp_hal_rechts
      preset: state_button
      layout: icon

@TobiasSchwarz74
Copy link
Author

TobiasSchwarz74 commented May 8, 2023

paper_buttons_row:
  presets:
    scene_button:
      base_config:
        layout: icon_name
      styles:
        justify-content: flex-end
        button:
          min-width: 50px
          margin-top: '-10px'
          margin-bottom: '-10px'
        name:
          font-size: 80%
          margin-top: '-5px'
          color: var(--primary-text-color)
...
      - type: custom:paper-buttons-row
        preset: scene_button
        buttons:

doesn't work for layout and justify-content.

Have to write

      - type: custom:paper-buttons-row
        styles:
          justify-content: flex-end
        base_config:
          layout: icon_name
        preset: scene_button
        buttons:

@ton6i
Copy link

ton6i commented May 8, 2023

Your preset starts with '-paper_buttons_row:'

Forget the minus sign.
Try:
paper_buttons_row:
presets:
scene_button:
base_config:
layout: icon_name
styles:
justify-content: flex-end
button:
min-width: 50px
margin-top: '-10px'
margin-bottom: '-10px'
name:
font-size: 80%
margin-top: '-5px'
color: var(--primary-text-color)
...
- type: custom:paper-buttons-row
preset: scene_button
buttons:

After the change press F5 to refresh the browser!

@TobiasSchwarz74
Copy link
Author

The "-" was just a mistake in my comment (removed it).
The Preset is working, all width, margin, color and font-size options are appplied.
Only layout and justify-content doesn't work.

@ton6i
Copy link

ton6i commented May 8, 2023

Layout i didn't try.

I have justify-content unther the button configuration.

  styles:
    button:
      min-width: 50px
      margin-top: '-10px'
      margin-bottom: '-10px'
      justify-content: flex-end

@TobiasSchwarz74
Copy link
Author

Within "button", justify-content only applies to the button, not the whole container.
My Buttons in the paper-buttons-row schould be alligned to the right.

@luixal
Copy link

luixal commented Aug 8, 2023

Just hit this issue. justify-content doesn't work for me while in presets, but it does works setting it in the card itself.

Would be nice to have it fixed :)

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

No branches or pull requests

3 participants