Skip to content

Releases: custom-cards/button-card

3.4.0-0

04 Oct 22:33
Compare
Choose a tag to compare
3.4.0-0 Pre-release
Pre-release

New Features

  • Support for configuring the card size for the auto-layout feature of lovelace using card_size. Default value is still 3, but you can now override it. Lovelace multiplies the value by about 50px for the auto layout feature.
    type: custom:button-card
    entity: switch.my_switch
    card_size: 42
  • Support for displaying a tooltip while hoovering the card for 1.5s using the tooltip parameter. It supports javascript templates. You can also apply any CSS style to the tooltip (either in the main styles config object or in any of the state entry).
    type: custom:button-card
    entity: switch.my_switch
    tooltip: |
      [[[
        return entity.state
      ]]]
    styles:
      tooltip:
        - color: '[[[ return entity.state === "on" ? "red" : "green" ]]]'
    or
    type: custom:button-card
    entity: switch.my_switch
    tooltip: |
      [[[
        return entity.state
      ]]]
    state:
      - value: 'on'
        styles:
          tooltip:
            - color: red
      - value: 'off'
        styles:
          tooltip:
            - color: green
   

3.3.7-0

27 Sep 14:49
Compare
Choose a tag to compare
3.3.7-0 Pre-release
Pre-release

Bug fixes:

  • Fix deprecation of --paper-card-background-color
  • Fix Timer not updating on page change (#365)

Other

  • Documentation typos (Thanks to all the contributors)
  • Updated dependencies

3.3.6

07 Jun 17:45
Compare
Choose a tag to compare

Bugfixes

  • Fix some more issues with HA >= 0.110 (Fix #337)
  • Fix a long running issue: embedded cards would refresh completely on every update (Fix #334)

3.3.5

22 May 17:18
Compare
Choose a tag to compare

Bugfixes

  • The ripple effect and the hold effect are back (Fix #325)
  • Font-awesome icons were not sized correclty (Fix #328)

Other

  • For dark cards, it can be useful to change the feedback color when clicking the button. The ripple effect uses a mwc-ripple element so you can style it with the CSS variables it supports.

    For example:

    styles:
      card:
        - --mdc-ripple-color: blue
        - --mdc-ripple-press-opacity: 0.5

3.3.4

17 May 20:09
Compare
Choose a tag to compare

Bugfixes

  • Fix icon dimensions in HA >= 0.110

3.3.3

05 May 16:50
Compare
Choose a tag to compare

Bugfixes

  • Units would be shown even with show_units: false (Fix #321)
  • Card would not work properly with HA < 0.107 (Fix #322)

3.3.2

29 Apr 20:08
Compare
Choose a tag to compare

Bugfixes

  • Fix text would be cropped with 0.109 (Fix #316)
  • Fix for translations not behaving properly with 0.109 (Fix #319)

3.3.1

26 Apr 16:43
Compare
Choose a tag to compare

Breaking Change

  • triggers_update is a new field that enables you to define which entities should trigger an update of the card itself (this rule doesn't apply for nested cards in custom_fields as they are always updated with the latest state. This is expected and fast!). Before 3.3.0, if you were using javascript [[[ ]]] templates, the card would update itself everytime ANY entity was updated in HA introducing a lot of load on the browser.
    If you don't have javascript [[[ ]]] templates in your config, you don't need to do anything, else read further.
    If unset, the card will parse your code and look for entities that it can match (it only matches states['ENTITY_ID']) so:
     return states['switch.myswitch'].state // will match switch.myswitch
     // but
     const test = switch.myswitch
     return states[test].state // will not match anything
    In this second case, you have 2 options:
    • Set the value of triggers_update to all (This was the behavior of button-card < 3.3.0)
      triggers_update: all
    • Set the value of triggers_update to a list of entities. When any of the entities in this list is updated, the card will be updated. The logic is the same as the internal home-assistant * templates integration (see here for example):
      type: custom:button-card
      entity: sensor.mysensor # No need to repeat this one in the triggers_update, it is added by default
      triggers_update:
        - switch.myswitch
        - light.mylight

New Features

  • Supports defining multiple button template:
    type: custom:button-card
    template:
      - template1
      - template2
    The button templates will be applied in the order they are defined: template2 will be merged with template1 and then the local config will be merged with the result. You can still chain templates together (ie. define template in a button-card template. It will follow the path recursively).
  • The card will display an error on screen instead of just disappearing from your layout when an error occurs. If it is an error in your javascript templates, it will display an error card with ButtonCardJSTemplateError and display the beginning of your template so that you can identify it:
    image

BugFixes

  • The button might not have been clickable in some cases when the action of a *_action was a template.
  • Nested cards should be updated properly now when there is a state change.
  • Fixes when a timer entity was defined and the button was in a vertical-stack/horizontal-stack
  • Fix for button-card using templates not working in Lovelave panels when casting (Fix #315)

Other stuff

  • A lot of refactor in the code, I hope I didn't break too much things 😄

3.3.0-4

20 Apr 23:06
b7f354d
Compare
Choose a tag to compare
3.3.0-4 Pre-release
Pre-release

New Features

  • The card will display an error on screen instead of just disappearing from your layout when an error occurs. If it is an error in your javascript templates, it will display an error card with ButtonCardJSTemplateError and display the beginning of your template so that you can identify it:
    image

3.3.0-3

13 Apr 19:02
Compare
Choose a tag to compare
3.3.0-3 Pre-release
Pre-release

Revert the revert on extra_styles...