mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-07 17:36:29 +00:00
Add getCardSize
This commit is contained in:
parent
34f8d47a61
commit
f386ddf7f9
@ -9,6 +9,7 @@ You're not just limited to the cards that we decided to include in the Lovelace
|
||||
- You define your custom card as a [custom element](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements). It's up to you to decide how to render your DOM inside your element. You can use Polymer, Angular, Preact or any other popular framework (except for React – more info [here](https://custom-elements-everywhere.com/)).
|
||||
- Home Assistant will set the `config` property when the configuration changes (rare).
|
||||
- Home Assistant will set the `hass` property when the state of Home Assistant changes (frequent). Whenever the state changes, the component will have to update itself to represent the latest state.
|
||||
- Home Assistant will call `getCardSize()` to request the size of the card. Size of the card is used for the automatic distribution of cards across columns. Both `config` and `hass` properties will be available. Defaults to `1` if function is not defined.
|
||||
|
||||
## Defining your card
|
||||
|
||||
@ -162,4 +163,4 @@ views:
|
||||
- input_boolean.switch_ac_kitchen
|
||||
- input_boolean.switch_ac_livingroom
|
||||
- input_boolean.switch_tv
|
||||
```
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user