Delete an LVGL widget from a page
esphome_lvgl_delete_widgetDelete a specific LVGL widget by ID from an ESPHome page and save the full config. A .bak backup is created before the YAML rewrite.
Instructions
Delete an LVGL widget by id from a page on an ESPHome device and save the whole config.
Removes the matching widget from the page's widgets list, then
rewrites the entire device YAML file via yaml.dump — comments, blank
lines and YAML anchors/aliases elsewhere in the file are NOT preserved.
A <file>.bak copy of the previous content is written first so the
original formatting can be recovered manually.
Use when: removing one widget from an existing LVGL page.
Not for: adding a widget — use esphome_lvgl_add_widget. After
deleting, run esphome_lvgl_validate/esphome_validate_config, then
esphome_compile_device and esphome_upload_device to deploy.
Returns: {"success": True, "name": ..., "bytes": ..., "backup": ..., "deleted": <widget_id>, "from_page": <page_id>} on success.
Errors: {"error": "..."} when the file can't be found/parsed, when
there is no lvgl: section, when page_id/widget_id doesn't exist,
or when the save itself fails ({"success": False, "error": ...}).
Limits: rewrites and overwrites the whole file; only the pre-write
content is recoverable, via the .bak copy.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page_id | Yes | LVGL page ID the widget belongs to, from `esphome_lvgl_get_pages`. | |
| widget_id | Yes | Widget `id` to delete, from `esphome_lvgl_get_page_widgets`. | |
| device_name | Yes | Device name, with or without the '.yaml' suffix, e.g. 'kitchen_display'. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||