Skip to content

v2.7.1

Choose a tag to compare

@nutteloost nutteloost released this 05 Dec 22:20

Simple Swipe Card v2.7.1

New Features ✨

  • JavaScript Template Support: You can now use JavaScript templates alongside the existing Jinja2 templates! JavaScript templates work in the same configuration fields (reset_target_card, reset_after_timeout, auto_swipe_interval) and are perfect if you prefer JavaScript syntax over Jinja2. Simply wrap your JavaScript code in [[[ and ]]] delimiters. (closes #82)
Example: Show different card based on user
type: custom:simple-swipe-card
enable_reset_after: true
reset_target_card: |
  [[[
    if (user.name === 'Admin') {
      return 2;
    }
    return 1;
  ]]]
cards:
  - type: markdown
    content: "Default card"
  - type: markdown
    content: "Admin card"

Improvements 🛠️

  • Independent Start Card Setting: You can now set which card to start on without enabling the auto-reset feature. Previously, configuring reset_target_card required enable_reset_after: true, but now you can set your preferred starting card independently. This gives you more control over the initial card display without unwanted reset behavior. (closes #84)

Bug Fixes 🩹

  • Conditional Card Entity Monitoring: Fixed issue where entities used in conditional card rules weren't being monitored for changes. When you had conditional cards inside the swipe card that show/hide based on entity states, those cards wouldn't properly appear or disappear when the entity changed. The card now correctly watches all conditional card entities and updates visibility in real-time. (closes #86)