Add QR Code information to markdown (#34981)

* Add QR Code information to markdown

the ha-rq-code tag is undocumented. This should be added

* Update markdown.markdown

typos corrected

* Apply suggestions from code review

* Apply suggestions from code review

---------

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
This commit is contained in:
sevorl 2024-09-30 19:33:33 +02:00 committed by GitHub
parent b637b73810
commit a5f45eafc0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -150,3 +150,28 @@ content: |
<ha-alert alert-type="success">This is a success alert — check it out!</ha-alert> <ha-alert alert-type="success">This is a success alert — check it out!</ha-alert>
<ha-alert title="Test alert">This is an alert with a title</ha-alert> <ha-alert title="Test alert">This is an alert with a title</ha-alert>
``` ```
## ha-qr-code
You can also create QR-Codes in the Markdown card.
Available parameters:
- data: The actual data to encode in the QR-Code
- scale: A scale factor for the QR code, default is 4
- width: Width of the QR code in pixels
- margin: A margin around the QR code
- error-correction-level: low; medium; quartile; high)
- center-image: An image to place on top of the qr code (might need a higher error-correction-level)
```yaml
type: markdown
content: >-
<ha-qr-code data='hallo' width="180"></ha-qr-code>
<ha-qr-code data='hallo' scale="6" margin="0"
center-image="/static/icons/favicon-192x192.png"></ha-qr-code>
<ha-qr-code data='hallo' error-correction-level="quartile" scale="6"
center-image="https://brands.home-assistant.io/_/tuya/icon@2x.png"></ha-qr-code>
```