1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-15 15:18:16 +00:00
Clyde Stubbs 3920029aff
[lvgl] PR stage 3 (#7160)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-07-31 16:31:15 +12:00

26 lines
582 B
Python

from esphome.const import CONF_BUTTON
from esphome.cpp_generator import MockObjClass
from .defines import CONF_MAIN
from .types import LvBoolean, WidgetType
class BtnType(WidgetType):
def __init__(self):
super().__init__(CONF_BUTTON, LvBoolean("lv_btn_t"), (CONF_MAIN,))
def obj_creator(self, parent: MockObjClass, config: dict):
"""
LVGL 8 calls buttons `btn`
"""
return f"lv_btn_create({parent})"
def get_uses(self):
return ("btn",)
async def to_code(self, w, config):
return []
btn_spec = BtnType()