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

state-switch: box-shadow not displayed #67

Open
ildar170975 opened this issue Nov 4, 2021 · 15 comments
Open

state-switch: box-shadow not displayed #67

ildar170975 opened this issue Nov 4, 2021 · 15 comments

Comments

@ildar170975
Copy link

Since some update the outer border's shadow is not displayed with a default theme:

image

title: state-switch-5
path: test-state-switch-5
cards:

  - type: entities
    entities:
      - input_boolean.test_boolean

  - type: custom:state-switch
    entity: input_boolean.test_boolean
    states:
      "on":
        type: entities
        entities:
          - entity: sun.sun
          - entity: binary_sensor.updater
          - entity: zone.home
      "off":
        type: entities
        entities:
          - entity: zone.home
          - entity: sun.sun
          - entity: binary_sensor.updater
@ildar170975
Copy link
Author

Downgraded to ver. 8 - shadows are OK.

@martinhoess
Copy link

martinhoess commented Dec 29, 2021

Problem still exists with latest HA 2021.12.7

image

type: horizontal-stack
cards:
  - type: custom:restriction-card
    condition:
      entity: switch.pc
      value: 'on'
    card:
      type: entity-button
      entity: switch.pc
      hold_action:
        action: call-service
        service: shell_command.pc_sleep
      icon: mdi:desktop-tower-monitor
      name: PC
      tap_action:
        action: toggle
  - type: custom:restriction-card
    card:
      type: custom:state-switch
      entity: binary_sensor.work
      states:
        'on':
          type: entity-button
          entity: switch.momentary_work_clock_out
        'off':
          type: entity-button
          entity: switch.momentary_work_clock_in

@ildar170975
Copy link
Author

ildar170975 commented May 30, 2022

The problem is present again after update to 1.9.4 (((

image

image

@ildar170975
Copy link
Author

Fixed again in 1.9.5

@iptvcld
Copy link

iptvcld commented Aug 26, 2022

This is broken again on HA 2022.8.7 and state-switch 1.9.5

@thomasloven thomasloven reopened this Aug 26, 2022
@ildar170975
Copy link
Author

@iptvcld
Strange, I do not seen any problems with my test example from the 1st post.
Could you post a small MWE demonstrating the issue?

@iptvcld
Copy link

iptvcld commented Aug 27, 2022

On 1.9.5

11

Downgraded to 1.9.4 - still same issue
Downgraded to 1.9.3 - shows ok!

Made sure browser cache was cleared and tested on multiple devices

Thank you,

@ildar170975
Copy link
Author

This is not an MWE.

@ildar170975
Copy link
Author

Post a code.

@iptvcld
Copy link

iptvcld commented Aug 28, 2022

Sorry; please see the code below. On version 1.95

type: custom:state-switch
view_layout:
  column: 3
entity: user
states:
  HomeAssistant:
    type: entity-filter
    show_empty: false
    entities:
      - light.exterior_potlights
      - switch.eb0ab69dddd36bfc06u0qj
      - switch.master_room
    state_filter:
      - 'on'
    card:
      state_color: true
      show_header_toggle: false
      title: TEST

t1

Then when i go to 1.93 - it shows fine.
t1

@ildar170975
Copy link
Author

This is not about state-switch, it is about entity-filter - seems it does not have box-shadow itself.
Replace it with Entities card, see it by yourself.

Check this example - the 2nd card is forced to be w/o box-shadow:

type: vertical-stack
cards:
  - type: entities
    entities:
      - input_boolean.test_boolean

  - type: custom:state-switch
    entity: input_boolean.test_boolean
    states:
      "on":
        type: entities
        entities:
          - entity: sun.sun
          - entity: zone.home
        card_mod:
          style: |
            ha-card {
              color: red;
            }

      "off":
        type: entities
        entities:
          - entity: zone.home
          - entity: sun.sun
        card_mod:
          style: |
            ha-card {
              color: cyan;
              box-shadow: none;
            }

изображение

изображение

@AndLindemann
Copy link

I also have the box shadow issue:

      - type: custom:state-switch
        entity: sensor.abfall_graue_tonne
        states:
          5:
            type: custom:button-card
            entity: sensor.abfall_graue_tonne
            label: |
              [[[
                var days_to = entity.state
                if (days_to == 0)
                { return "Heute" }
                else if (days_to == 1)
                { return "Morgen" }
                else
                { return days_to + " Tage" }
              ]]]
            tap_action:
              action: "more-info"
            show_icon: true
            show_label: true
            show_name: false
            show_state: false
            styles:
              icon:
                - color: gray
              label:
                - justify-self: "center"
                - padding: "0px 6px"
                - font-weight: "bold"
                - font-size: "12px"
                - margin-left: "0px"
              img_cell:
                - place-self: "center"
                - width: "14px"
                - height: "24px"
              grid:
                - grid-template-areas: "'i l'"
                - grid-template-columns: "max_content auto"
                - grid-template-rows: "min-content"
              card:
                - border-radius: "18px"
                - box-shadow: "var(--box-shadow)"
                - height: "36px"
                - width: "auto"
                - padding-right: "6px"
                - padding-top: "6px"
                - padding-button: "6px"
                - padding-left: "12px"
            size: "100%"

Bildschirmfoto 2022-09-02 um 12 33 22

@ildar170975
Copy link
Author

ildar170975 commented Sep 2, 2022

@AndLindemann
Next time please post a simple MWE to demonstrate your issue.
https://en.wikipedia.org/wiki/Minimal_reproducible_example

Check this example:

type: vertical-stack
cards:
  - type: entities
    entities:
      - input_select.test_value
  - type: custom:state-switch
    entity: input_select.test_value
    states:
      one:
        type: entities
        title: entities
        entities:
          - entity: sun.sun
          - entity: binary_sensor.service_on_value
          - entity: zone.home
      two:
        type: glance
        entities:
          - sun.sun
        title: glance
      three:
        type: button
        entity: sun.sun
        name: button
      four:
        type: entity
        entity: sensor.processor_use
      five:
        type: history-graph
        entities:
          - sun.sun
      six:
        type: horizontal-stack
        cards:
          - type: button
            entity: sun.sun
          - type: button
            entity: sun.sun
      seven:
        type: custom:button-card
        entity: sun.sun
        name: custom button-card
      eight:
        type: custom:mini-graph-card
        entities:
          - sensor.processor_use
      nine:
        type: custom:apexcharts-card
        series:
          - entity: sensor.processor_use
      ten:
        type: vertical-stack
        cards:
          - type: custom:apexcharts-card
            series:
              - entity: sensor.processor_use

It shows an input_select and a card inside state-switch:
image

Code for input_select:

input_select:
  test_value:
    options:
      - one
      - two
      - three
      - four
      - five
      - six
      - seven
      - eight
      - nine
      - ten
      - eleven
      - twelve

As you will see, every STANDARD card is displayed PROPERLY.
And every CUSTOM card is displayed CLIPPED.
I guess this is about how a custom card handles an overflow property from the container (which is a state-switch).

How to solve the issue - place the whole custom card into vertical-stack - see this case:

      ten:
        type: vertical-stack
        cards:
          - type: custom:apexcharts-card
            series:
              - entity: sensor.processor_use

@AndLindemann
Copy link

...
How to solve the issue - place the whole custom card into vertical-stack - see this case:

      ten:
        type: vertical-stack
        cards:
          - type: custom:apexcharts-card
            series:
              - entity: sensor.processor_use

Just checked, you're right, that actually works. Thanks for the hint!

@ildar170975
Copy link
Author

ildar170975 commented Sep 2, 2022

Great.
A small picture for my example:
image

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

5 participants