Menu for different pages of documents

This commit is contained in:
Philip Abbey
2024-01-20 11:31:50 +00:00
parent 13d3ffd1ec
commit ce2f4d38d0
9 changed files with 57 additions and 25 deletions

View File

@ -1,3 +1,5 @@
[Home](../README.md) | [Switches](Switches.md) | Actions | [Templates](Templates.md) | [Battery Reporting](../BatteryReporting.md) | [Trouble Shooting](../TroubleShooting.md) | [Versions](../Versions.md)
# Actions
A simple example using a scene as a `tap`` menu item.
@ -21,6 +23,8 @@ Any menu item with an action (`tap`, `template`, or `toggle`), may have a confir
}
```
<img src="../images/confirmation_view.png" width="200" title="Confirmation View"/>
For example:
```json

View File

@ -1,3 +1,5 @@
[Home](../README.md) | Switches | [Actions](Actions.md) | [Templates](Templates.md) | [Battery Reporting](../BatteryReporting.md) | [Trouble Shooting](../TroubleShooting.md) | [Versions](../Versions.md)
# Switches
In order to facilitate custom switches at this time, you must create a template switch in HomeAssistant.
@ -31,7 +33,7 @@ Then you can use the following in your config:
}
```
## Example (covers)
## Example - Covers
```yaml
switch:
@ -50,6 +52,8 @@ switch:
entity_id: cover.cover
```
Then you can use the following in your config:
```json
{
"entity": "switch.cover",

View File

@ -1,3 +1,5 @@
[Home](../README.md) | [Switches](Switches.md) | [Actions](Actions.md) | Templates | [Battery Reporting](../BatteryReporting.md) | [Trouble Shooting](../TroubleShooting.md) | [Versions](../Versions.md)
# Templates
In order to provide the most functionality possible the content of the card is a user-defined template (i.e. you generate your own text). This allows you to do some pretty cool things. It also makes the config a bit more complicated. This page will help you understand how to use templates.
@ -131,4 +133,6 @@ An example of a dimmer light with 4 brightness settings 0..3. Here our light wor
## Warnings
Just remember, you have the ability to crash the application by creating an excessive menu definition. Older devices running as a widget can be limited in memory such that the JSON definition causes an "Out of Memory" error. Widgets have less memory than applications. Templates can require significant definition for highly customised text. Don't be silly. With the new template based sensor display, widgets are more likely to run out of memory. E.g. a Vivoactive 3 device has a memory limit of 60 kB runtime memory for widgets (compare with 124 kB for applications) and is likely to be ~90% used. This makes it very likely that a larger menu will crash the application. We cannot predict what will take the application "over the edge", but we can provide this feedback to users to raise awareness, hence the widget displays menu usage as a reminder. If the widget is crashing but the application variant is not, then your menu configuration is too big for the widget.
Just remember, you have the ability to crash the application by creating an excessive menu definition. Older devices running as a widget can be limited in memory such that the JSON definition causes an "Out of Memory" error. Widgets have less memory than applications. Templates can require significant definition for highly customised text. Don't be silly. With the new template based sensor display, widgets are more likely to run out of memory. E.g. a Vivoactive 3 device has a memory limit of 60 kB runtime memory for widgets (compare with 124 kB for applications) and is likely to be ~90% used. This makes it very likely that a larger menu will crash the application. We cannot predict what will take the application "over the edge", but we can provide this feedback to users to raise awareness, hence the widget displays menu usage as a reminder. If the widget is crashing but the application variant is not, then your menu configuration is too big for the widget.
<img src="../images/app_crash.png" width="200" title="Venu 2" style="margin:5px;border: 2px solid black;"/>