jcwillox / lovelace-paper-buttons-row

Adds highly configurable buttons that use actions and per-state styling.
MIT License
310 stars 10 forks source link

paper-buttons-row in head of custom:fold-entity-row DOES NOT send the service call #190

Open drew1kun opened 3 months ago

drew1kun commented 3 months ago

The problem

paper-buttons-row in head of custom:fold-entity-row DOES NOT send the service call

What version of Paper Buttons Row has the issue?

v2.2.0

What version of Home Assistant are you running?

Home Assistant 2024.7.4

What version of the Frontend are you running?

Frontend 20240710.0

Example YAML snippet

Hi, I am not sure should it be the issue or a feature request..

The issue as it is in the title

This DOES NOT send the service call to update the Google Maps Travel Time sensor:

cards:
- type: vertical-stack
  cards:
  - type: entities
    title: Outdoors Info
    icon: 'mdi:sun-thermometer'
    entities:
    - type: custom:fold-entity-row
      padding: 0
      head:
        type: custom:paper-buttons-row
        buttons:
        - icon: 'mdi:cart-outline'
          name: Costco
          tap_action:
            action: call-service
            service: homeassistant.update_entity
            target:
              entity_id:
              - sensor.drive_to_costco
      entities:
      - entity: sensor.drive_to_costco
        name: Drive to Costco
        icon: 'mdi:cart-outline'
        secondary_info: last-changed

However, this WORKS as expected:

cards:
- type: vertical-stack
  cards:
  - type: entities
    title: Outdoors Info
    icon: 'mdi:sun-thermometer'
    entities:
    - type: custom:paper-buttons-row
      buttons:
      - icon: 'mdi:cart-outline'
        name: Costco
        tap_action:
          action: call-service
          service: homeassistant.update_entity
          target:
            entity_id:
            - sensor.drive_to_costco
          service_data:
            entity_id:
            - sensor.drive_to_costco

    - entity: sensor.drive_to_costco
      name: Drive to Costco
      icon: 'mdi:cart-outline'
      secondary_info: last-changed

Anything in the logs that might be useful for us?

Custom-ui 20240118 is installed  add attributes icon_color and templates 
custom-ui.js:12 Readme: https://github.com/Mariusthvdb/custom-ui
card-mod.js:1 CARD-MOD 3.4.3 IS INSTALLED
mini-graph-card-bundle.js:1  MINI-GRAPH-CARD  0.12.1 
paper-buttons-row.js:1367  PAPER-BUTTONS-ROW  2.2.0 
paper-buttons-row.js:1372 branch   : main
paper-buttons-row.js:1373 commit   : 51525db3a22e8ff1f2e39b67c79cba7380259d4f
paper-buttons-row.js:1374 built at : 2024-07-27T17:06:05.515Z
paper-buttons-row.js:1375 https://github.com/jcwillox/lovelace-paper-buttons-row
ha-card-weather-conditions.js:1 

       Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
load_resource.ts:13 Uncaught (in promise) https://ha-cipherpunk-ca.duckdns.org/hacsfiles/ha-card-weather-conditions/ha-card-weather-conditions.jsUnderstand this error
auto-entities.js:172 AUTO-ENTITIES 1.13.0 IS INSTALLED
lovelace-card-preloader.js:1 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'config')
    at lovelace-card-preloader.js:1:1933Understand this error
decluttering-card.js:186  DECLUTTERING-CARD    Version 1.0.0   
template-entity-row.js:1 TEMPLATE-ENTITY-ROW 1.4.1 IS INSTALLED 
fold-entity-row.js:78 FOLD-ENTITY-ROW 2.2.0 IS INSTALLED 
vertical-stack-in-card.js:1 vertical-stack-in-cardVersion: 0.4.4
multiple-entity-row.js:1  MULTIPLE-ENTITY-ROW  4.5.1 
config-template-card.js:329 The main 'lit-element' module entrypoint is deprecated. Please update your imports to use the 'lit' package: 'lit' and 'lit/decorators.ts' or import from 'lit-element/lit-element.ts'. See https://lit.dev/msg/deprecated-import-path for more information.
(anonymous) @ config-template-card.js:329Understand this warning
config-template-card.js:735   CONFIG-TEMPLATE-CARD    Version 1.3.6         

Additional information

The former looks the way I want (with the fold):

Screenshot 2024-08-07 at 12 17 33

The latter obviously does not have a fold:

Screenshot 2024-08-07 at 12 16 49

Please let me know if there is any other way to achieve what I want (basically a clickable working button in the header of the fold)

And thank you for your work and this beautiful card!