Skip to content

Commit

Permalink
Merge pull request #32 from marsman7/0.7.0
Browse files Browse the repository at this point in the history
Add qrcode disign object
  • Loading branch information
fvanroie authored Jun 7, 2024
2 parents 51734ff + d99063b commit 28dd597
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/design/objects/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ nav:
- spinner.md
- switch.md
- tabview.md
- qrcode.md
Binary file added docs/design/objects/images/lv_ex_qrcode_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions docs/design/objects/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ There are two ways to create an object on the screen:
| arc | Range | [Arc](#arc) | indicator, knob
| linemeter | Range | [Line Meter](#line-meter) |
| gauge | Range | [Gauge](#gauge) | indicator, ticks
| qrcode | Visual | [Qrcode](#qrcode) |


## Common Parameters

Expand Down Expand Up @@ -724,6 +726,24 @@ Either PNG or BIN image files are supported, from flash:
{"page":1,"id":34,"obj":"img","src":"L:/image.png","auto_size":0,"w":50}
```

# QR-Code
**obj:`qrcode`**

![lv_qrcode](images/lv_ex_qrcode_1.png)

| Property | Value | Default | Description
|----------|--------------|---------|--------------------------
| text | [string][10] | "" | The text to encode to QR code
| size | [int16][9] | 140 | The object is always a square with a width and a height that correspond to size.


???+ example "Example `jsonl`"
```json linenums="1"
{"page":1,"id":42,"obj":"qrcode","text":"www.openhasp.com/0.7.0/design/objects/","x":520,"y":20,"size":200}
```

!!! note :
The maximum text length depends on the QR code version. By default, the maximum version 7 is used, which corresponds to a maximum text length of 122 characters.

## Base Object
**obj:`obj`**
Expand Down
38 changes: 38 additions & 0 deletions docs/design/objects/qrcode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# QR-Code
**obj:`qrcode`**

![lv_qrcode](images/lv_ex_qrcode_1.png)

| Property | Value | Default | Description
|----------|------------|---------|--------------------------
| text | [string][10] | "" | The text to encode to QR code
| size | [int16][9] | 140 | The object is always a square with a width and a height that correspond to size.


???+ example "Example `jsonl`"
```json linenums="1"
{"page":1,"id":42,"obj":"qrcode","text":"www.openhasp.com/0.7.0/design/objects/","x":520,"y":20,"size":200}
```

!!! note :
The maximum text length depends on the QR code version. By default, the maximum version 7 is used, which corresponds to a maximum text length of 122 characters.


[1]: ../../data-types/#colors
[2]: ../../data-types/#boolean
[3]: ../../../configuration/gpio/#groupid
[4]: ../../styling/#general
[5]: ../../styling/#image
[6]: ../../styling/#value
[7]: ../../styling/#line
[8]: ../../styling/#scale
[9]: ../../data-types/#integer
[10]: ../../data-types/#string
[11]: ../../data-types/#json-object
[12]: ../../styling/
[13]: ../../styling/#padding-and-margin
[14]: ../../styling/#text
[15]: ../../data-types/#variables
[16]: https://lvgl.io/tools/imageconverter
[17]: ../../../integrations/home-assistant/sampl_conf/#using-tags
[18]: ../../styling/#parts

0 comments on commit 28dd597

Please sign in to comment.