th3jesta / ha-lcars

LCARS theme for Home Assistant
MIT License
275 stars 19 forks source link

support for tile card? #30

Closed JonGilmore closed 1 year ago

JonGilmore commented 1 year ago

Has anybody tested the tile card with this theme? I'm new to this theme, but I can't seem to get it render like I'd expect. Here's my code and a screenshot how it renders.

      - type: tile
        entity: group.main_floor_lights
        name: Main
        icon: mdi:lightbulb
        tap_action:
          action: navigate
          navigation_path: "/ui-lcars/lights-main"
        icon_tap_action:
          action: call-service
          service: button.press
          target:
            entity_id: button.basement_equipment_room_phantom_kp_position_1_keypad_main_off
        card_mod:
          class: button-bullet
image
th3jesta commented 1 year ago

I haven't addressed that card specifically yet. I assume you are wanting it to render like the button-bullet? In your screenshot, it looks like Tile is functionally just a button, so I would recommend making a button for you Main light, and then applying the bullet class to it for the following effect (in your selected theme colors, of course):

image

It will span the length of your column, so ignore the discrepancy in length.

JonGilmore commented 1 year ago

Thanks! I liked the icon_tap_action vs tap_action that the tile card offers, but it looks like I can make this same functionality work with tap_action and double_tap_action. For anybody that stumbles upon this, here's what I ended up doing.

          - type: button
            entity: group.main_floor_lights
            icon: mdi:lightbulb
            name: Main
            show_state: true
            tap_action:
              action: call-service
              service: button.press
              data:
                entity_id: button.basement_equipment_room_phantom_kp_position_1_keypad_main_off
            double_tap_action:
              action: navigate
              navigation_path: "/ui-lcars/lights-main"
            card_mod:
              class: button-bullet