-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lvgl] Stage 4 #7166
Merged
Merged
[lvgl] Stage 4 #7166
Changes from 1 commit
Commits
Show all changes
95 commits
Select commit
Hold shift + click to select a range
a01a671
LVGL base implementation
clydebarrow 3f86537
CODEOWNERS
clydebarrow c49c113
script/custom-ci
clydebarrow cddc71d
Remove esp8266 test
clydebarrow 0e42141
Newline
clydebarrow b4c0d64
clang-tidy
clydebarrow 5c09226
Fix bug introduced by clang-tidy's suggestion.
clydebarrow 6cbba2f
Fix output of lv_scr_act()
clydebarrow f56b4b5
clang-tidy fixes
clydebarrow 5100695
clang-tidy
clydebarrow cfc13f0
Fix fonts
clydebarrow 034d7ec
Cleanup
clydebarrow 8678f9f
Add test for font
clydebarrow dcfb19b
CI fix
clydebarrow e72d4ec
Add touchscreens
clydebarrow caee7b0
Add test images
clydebarrow 7cf47e8
Add tests for all obj styles
clydebarrow 9d16c30
`ruff check --fix`
jesserockz b58a37e
`ruff format`
jesserockz 54ee3da
ruff
clydebarrow dc95aa8
ruff
clydebarrow abf823e
Ruff
clydebarrow 1d797ac
Merge branch 'dev' of https://github.com/esphome/esphome into lvgl-base
clydebarrow 24434d6
Review fixes
clydebarrow 07c3e2b
Fail hard when display mis-configured
clydebarrow b656fc1
Fix default_font for esphome font
clydebarrow 9b10ce8
Merge branch 'lvgl-base' into lvgl-input
clydebarrow 74de2a0
Implement btn.
clydebarrow 2428819
Add percent width
clydebarrow a3eb919
Review changes
clydebarrow 6c8b7cd
Review changes
clydebarrow b2a248d
Properly handle display list
clydebarrow 2b7782e
Properly handle display
clydebarrow 7dd4b47
Add btn.py
clydebarrow 38f4f36
Merge branch 'dev' of https://github.com/esphome/esphome into lvgl-base
clydebarrow e0bd889
Improve display schema
clydebarrow d5c29c6
Merge branch 'lvgl-base' into lvgl-input
clydebarrow de17834
Clean up touchscreen config
clydebarrow 61d66f6
Fix import
clydebarrow f253541
Merge remote-tracking branch 'upstream/dev' into lvgl-input
clydebarrow 7912d20
Remove unused function
clydebarrow 4e0898e
Use ESPHome image for test
clydebarrow 70efbd0
Fix add_flag
clydebarrow 2915d92
Ensure undefined fonts are found in id validation step
clydebarrow 9a33af2
Issue warning if touchscreen configured but not used.
clydebarrow 25aff25
Allow for case of ESPHOME_LOG_LEVEL_NONE
clydebarrow df58faa
Rotary encoder working
clydebarrow 322afc7
pages WIP
clydebarrow bff1b37
Rename `btn` to `button`
clydebarrow fd591b4
Add triggers and align_to
clydebarrow b11c82e
Rename automation.py to trigger.py
clydebarrow f150c56
Add tests for actions.
clydebarrow c90ece1
Rename bg_img to bg_image
clydebarrow 5d7eae1
add bg_image
clydebarrow 72637f6
CONF_BUTTON from esphome.const
clydebarrow 7fb8824
Address review:
clydebarrow cb878ef
Merge branch 'dev' of https://github.com/esphome/esphome into lvgl-3
clydebarrow a14495c
Add check for image type
clydebarrow c5271c5
Add update actions
clydebarrow fdb27dd
update tests
clydebarrow 55effa9
Added pause/resume actions, idle and paused conditions.
clydebarrow fb78eb1
Merge branch 'dev' of https://github.com/esphome/esphome into lvgl-3
clydebarrow c61f11d
comments on endifs
clydebarrow d3b6ec9
Add lvgl.widget.{hide,show,enable,disable} actions
clydebarrow 5148a97
Touchscreen listener add in main code
clydebarrow a8a51b1
Merge branch 'dev' of https://github.com/esphome/esphome into lvgl-3
clydebarrow 2d0d88b
Remove redundant define
clydebarrow c0e1a9f
Merge branch 'dev' of https://github.com/esphome/esphome into lvgl-3
clydebarrow b79a429
Revert lv_validation.py
clydebarrow 6e060e9
Fix CI failures.
clydebarrow 2670f49
CI fixes
clydebarrow 101e5fb
CI fix
clydebarrow 515ff15
Cleanup create_modify_schema
clydebarrow 7eaf438
Merge branch 'dev' of https://github.com/esphome/esphome into lvgl-3
clydebarrow f5bf2ef
Merge branch 'lvgl-3' into lvgl-4
clydebarrow d5e38e6
Added pages and associated actions
clydebarrow 3e2add8
Implement page wrap and skip
clydebarrow 3e7c36f
Review changes
clydebarrow ae02208
Merge branch 'dev' of https://github.com/esphome/esphome into lvgl-4
clydebarrow f58e015
Additional comments
clydebarrow 574fb2f
Added bar
clydebarrow 6e1076a
Add bar and slider
clydebarrow 52a9b8a
Add arc
clydebarrow 7d74d36
Allow lists of widgets on update/hide/show/enable/disable actions
clydebarrow 342e4e2
Merge branch 'dev' of https://github.com/esphome/esphome into lvgl-4
clydebarrow f19cc1f
Rationalise defines
clydebarrow bf4e778
Add widgets:
clydebarrow 3735074
Merge branch 'dev' of https://github.com/esphome/esphome into lvgl-4
clydebarrow 3260d3e
Fix imports
clydebarrow 6da6b42
Fix image modify schema
clydebarrow fcdabfa
Fix for config without pages
clydebarrow 198f040
Merge branch 'dev' of https://github.com/esphome/esphome into lvgl-4
clydebarrow 5cad98d
Backport changed files from lvgl-6
clydebarrow 68059a8
Code cleanup
clydebarrow bf1e1cd
Backport from lvgl-6
clydebarrow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add arc
- Loading branch information
commit 52a9b8a47edd3adad3e0fa19e75dea934e064271
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import esphome.config_validation as cv | ||
from esphome.const import ( | ||
CONF_MAX_VALUE, | ||
CONF_MIN_VALUE, | ||
CONF_MODE, | ||
CONF_ROTATION, | ||
CONF_VALUE, | ||
) | ||
|
||
from ...cpp_types import nullptr | ||
from .defines import ( | ||
ARC_MODES, | ||
CONF_ADJUSTABLE, | ||
CONF_ARC, | ||
CONF_CHANGE_RATE, | ||
CONF_END_ANGLE, | ||
CONF_INDICATOR, | ||
CONF_KNOB, | ||
CONF_MAIN, | ||
CONF_START_ANGLE, | ||
literal, | ||
) | ||
from .lv_validation import angle, get_start_value, lv_float | ||
from .lvcode import lv, lv_obj | ||
from .types import LvNumber | ||
from .widget import Widget, WidgetType | ||
|
||
ARC_SCHEMA = cv.Schema( | ||
{ | ||
cv.Optional(CONF_VALUE): lv_float, | ||
cv.Optional(CONF_MIN_VALUE, default=0): cv.int_, | ||
cv.Optional(CONF_MAX_VALUE, default=100): cv.int_, | ||
cv.Optional(CONF_START_ANGLE, default=135): angle, | ||
cv.Optional(CONF_END_ANGLE, default=45): angle, | ||
cv.Optional(CONF_ROTATION, default=0.0): angle, | ||
cv.Optional(CONF_ADJUSTABLE, default=False): bool, | ||
cv.Optional(CONF_MODE, default="NORMAL"): ARC_MODES.one_of, | ||
cv.Optional(CONF_CHANGE_RATE, default=720): cv.uint16_t, | ||
} | ||
) | ||
|
||
ARC_MODIFY_SCHEMA = cv.Schema( | ||
{ | ||
cv.Optional(CONF_VALUE): lv_float, | ||
} | ||
) | ||
|
||
|
||
class ArcType(WidgetType): | ||
def __init__(self): | ||
super().__init__( | ||
CONF_ARC, | ||
LvNumber("lv_arc_t"), | ||
parts=(CONF_MAIN, CONF_INDICATOR, CONF_KNOB), | ||
schema=ARC_SCHEMA, | ||
modify_schema=ARC_MODIFY_SCHEMA, | ||
) | ||
|
||
async def to_code(self, w: Widget, config): | ||
if CONF_MIN_VALUE in config: | ||
lv.arc_set_range(w.obj, config[CONF_MIN_VALUE], config[CONF_MAX_VALUE]) | ||
lv.arc_set_bg_angles( | ||
w.obj, config[CONF_START_ANGLE] // 10, config[CONF_END_ANGLE] // 10 | ||
) | ||
lv.arc_set_rotation(w.obj, config[CONF_ROTATION] // 10) | ||
lv.arc_set_mode(w.obj, literal(config[CONF_MODE])) | ||
lv.arc_set_change_rate(w.obj, config[CONF_CHANGE_RATE]) | ||
|
||
if config.get(CONF_ADJUSTABLE) is False: | ||
lv_obj.remove_style(w.obj, nullptr, literal("LV_PART_KNOB")) | ||
w.clear_flag("LV_OBJ_FLAG_CLICKABLE") | ||
|
||
value = await get_start_value(config) | ||
if value is not None: | ||
lv.arc_set_value(w.obj, value) | ||
|
||
|
||
arc_spec = ArcType() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a default value of 0 so its always going to be there.