AmoebeLabs / swiss-army-knife-card

The versatile custom Swiss Army Knife card for Home Assistant allows you to create your unique visualization using several graphical tools, styling options and animations.
236 stars 21 forks source link

Add layout templates to re-use complete card designs #119

Closed AmoebeLabs closed 2 years ago

AmoebeLabs commented 2 years ago

The Problem To Be Solved

Currently, all sorts of templates are supported to enable the re-use of tools, toolsets, colors, JavaScript snippets, etc.

However, if one wants to use the created cards in views, it is still a lot of YAML, as you have to declare the full card layout: there are no layout templates available. Ie no re-use of cards like you can with the decluttering templates and the button card.

Additional background:

Usability for many users will be improved significantly with layout templates! Of course, these templates should support variables, as this greatly enhances the use of templates.

The usage of the functional card examples for instance could benefit from this!

Related Issues (if any)

(Optional): Suggested Solution

Layout templates should be consistent with existing templates.

Example:

       - type: 'custom:swiss-army-knife-card'
          entities:
            - entity: sensor.dsmr_reading_electricity_currently_delivered
              name: 'Sensor #2'
          layout:
            template:
              name: sak_layout_fce_sensor2
              variables:
                - sak_layout_sensor_segarc_scale_max: 2

(Optional): Alternative Solutions

Included in this feature

Apart from the software changes, the following changes are part of this feature request:

Tentative: