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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bunch of features #231

Merged
merged 14 commits into from Oct 21, 2019
Merged

Bunch of features #231

merged 14 commits into from Oct 21, 2019

Conversation

RomRider
Copy link
Collaborator

@RomRider RomRider commented Oct 19, 2019

Breaking Changes (& New Features)

  • Drop support for custom_updater, please upgrade to HACS
  • URL actions field has been renamed to url_path from url:
    old:
    xxx_action:
      action: url
      url: https://www.google.com
    new:
    xxx_action:
      action: url
      url_path: https://www.google.com
  • dbltap_action has been renamed to double_tap_action to match core (Fix Rename dbltap_action to double_tap_action to align with core聽#232)
  • confirmation is now an object and supports templates, and you can specify a different confirmation object for each action. You can also specify exempted users. See confirmation doc for more info (Fix template for (lock) confirmation field聽#228, Fix Confirmation linked to actions聽#217):
    confirmation: # If defined, this will apply to all the actions
      text: Are you sure?
      exemptions:
        - user: befc8496799848bda1824f2a8111e30a
    tap_action:
      confirmation:
        # Confirmation only for tap_action.
        # If a default confirmation is defined, it will be override it.
        text: '[[[ return `Toggle ${entity.attributes.friendly_name}? ]]]'
        exemptions:
          - user: befc8496799848bda1824f2a8111e30a
  • lock is now an object and unlock_users is deprecated.
    lock.enabled supports templating and you can set the duration of the unlocked state.
    You can define the type of clicks which will unlock the button with lock.unlock. Possible values are tap, hold and double_tap. Default is tap
    See lock doc for more info (Fix Add an option to configure the Lock time聽#192, Fix add lock (permanent-not switchable) and differentiate allow-lock聽#220, Fix allow lock to be set on Hold action聽#230).
    Old:
    lock: true
    unlock_users:
      - test
    New:
    lock:
      enabled: '[[[ return entity.state === 'on'; ]]]'
      unlock: hold
      duration: 10
      exemptions:
        - username: test
        - user: befc8496799848bda1824f2a8111e30a

New Features

  • The version of the card is displayed in the javascript console of your browser. Please verify if you're running the latest version before opening a bug report. If not, update and/or clear your cache:
    image
  • You can now embed any card in the custom fields 馃帀 (Fix Any card inside button-card聽#209). Note that to remove the box-shadow for specific cards, use card-mod.
    image
        - type: custom:button-card
          aspect_ratio: 1/1
          custom_fields:
            graph:
              card:
                type: sensor
                entity: sensor.sensor1
                graph: line
                # style is used by card-mod
                style: |
                  ha-card {
                    box-shadow: none;
                  }
          styles:
            custom_fields:
              graph:
                - filter: opacity(50%)
                - overflow: unset
            card:
              - overflow: unset
            grid:
              - grid-template-areas: '"i" "n" "graph"'
              - grid-template-columns: 1fr
              - grid-template-rows: 1fr min-content min-content
    
          entity: light.test_light
          hold_action:
            action: more-info

Fixes

src/button-card.ts Outdated Show resolved Hide resolved
src/create-thing.ts Outdated Show resolved Hide resolved
@RomRider RomRider merged commit bdf8767 into dev Oct 21, 2019
@delete-merged-branch delete-merged-branch bot deleted the card_field branch October 21, 2019 08:17
RomRider added a commit that referenced this pull request Oct 21, 2019
* Add support for any card in custom_fields

* Fix version script

* Drop support for custom_updater

* confirmation template support and per action confirmation

* Confirmation supports templates and exemptions

* Support for Safari 10

* Using createThing from cch

* Proper events handling for embedded cards

* Lock with exemptions and delay

* Fix locking documentation

* Fix default color documentation

* Updating templates documentation

* Support for different unlock clicks

* Update embedded card documentation
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

Successfully merging this pull request may close these issues.

None yet

2 participants