Skip to content
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

Fix for esphome 2023.12.x - remaining fix #5

Open
wants to merge 2 commits into
base: lilygo-t5-47
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions esphome/components/lilygo_t5_47/display/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
CONF_LAMBDA,
CONF_PAGES,
)
from esphome.const import __version__ as ESPHOME_VERSION

from .. import lilygo_t5_47_ns

Expand All @@ -33,7 +34,9 @@
async def to_code(config):
var = cg.new_Pvariable(config[CONF_ID])

await cg.register_component(var, config)
if cv.Version.parse(ESPHOME_VERSION) < cv.Version.parse("2023.12.0"):
await cg.register_component(var, config)

await display.register_display(var, config)

cg.add(var.set_full_update_every(config[CONF_FULL_UPDATE_EVERY]))
Expand All @@ -42,7 +45,7 @@ async def to_code(config):

if CONF_LAMBDA in config:
lambda_ = await cg.process_lambda(
config[CONF_LAMBDA], [(display.DisplayBufferRef, "it")], return_type=cg.void
config[CONF_LAMBDA], [(display.DisplayRef, "it")], return_type=cg.void
)
cg.add(var.set_writer(lambda_))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
namespace esphome {
namespace lilygo_t5_47 {

#if ESPHOME_VERSION_CODE >= VERSION_CODE(2023, 12, 0)
class LilygoT547Display : public display::DisplayBuffer {
#else
class LilygoT547Display : public PollingComponent, public display::DisplayBuffer {
#endif
public:
float get_setup_priority() const override;

Expand Down