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

Update lilygo_t5_47_display.h #3

Open
wants to merge 5 commits into
base: lilygo-t5-47-always-on
Choose a base branch
from

Conversation

idefxH
Copy link

@idefxH idefxH commented Jun 4, 2023

Make the always-on branch compatible with ESPHome 2022.6+

What does this implement/fix?

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other

Related issue or feature (if applicable): fixes

Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#

Test Environment

  • ESP32
  • ESP32 IDF
  • ESP8266
  • RP2040

Example entry for config.yaml:

# Example config.yaml

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

If user exposed functionality or configuration variables are added/changed:

Make it compatible with ESPHome 2022.6+
@mwxp06
Copy link

mwxp06 commented Jul 31, 2023

@ashald Please integrate changes.
After merge will be (hopefully) fixed error:
File "/config/esphome/.esphome/external_components/2851613f/esphome/components/lilygo_t5_47/display/__init__.py", line 45, in to_code config[CONF_LAMBDA], [(display.DisplayBufferRef, "it")], return_type=cg.void AttributeError: module 'esphome.components.display' has no attribute 'DisplayBufferRef'

Which now breaks compilations. :(

…ef, "it")], return_type=cg.void; AttributeError: module 'esphome.components.display' has no attribute 'DisplayBufferRef')
@tobivan
Copy link

tobivan commented Nov 26, 2023

Having same problems here with that error.

INFO ESPHome 2023.11.4
INFO Reading configuration /config/esphome/esphome-web-ce182c.yaml...
INFO Detected timezone 'Europe/Berlin'
INFO Generating C++ source...
Traceback (most recent call last):
  File "/usr/local/bin/esphome", line 33, in <module>
    sys.exit(load_entry_point('esphome', 'console_scripts', 'esphome')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/__main__.py", line 1040, in main
    return run_esphome(sys.argv)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/__main__.py", line 1027, in run_esphome
    rc = POST_CONFIG_ACTIONS[args.command](args, config)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/__main__.py", line 457, in command_run
    exit_code = write_cpp(config)
                ^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/__main__.py", line 192, in write_cpp
    generate_cpp_contents(config)
  File "/esphome/esphome/__main__.py", line 204, in generate_cpp_contents
    CORE.flush_tasks()
  File "/esphome/esphome/core/__init__.py", line 674, in flush_tasks
    self.event_loop.flush_tasks()
  File "/esphome/esphome/coroutine.py", line 246, in flush_tasks
    next(task.iterator)
  File "/esphome/esphome/__main__.py", line 184, in wrapped
    await coro(conf)
  File "/data/external_components/2851613f/esphome/components/lilygo_t5_47/display/__init__.py", line 45, in to_code
    config[CONF_LAMBDA], [(display.DisplayBufferRef, "it")], return_type=cg.void
                           ^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'esphome.components.display' has no attribute 'DisplayBufferRef'. Did you mean: 'DisplayBuffer'?`

@idefxH
Copy link
Author

idefxH commented Nov 26, 2023

My PR solved it normally…

@tobivan
Copy link

tobivan commented Nov 26, 2023

Thanks. Maybe there is a different (basic) mistake in my configuration?
So, this is my .yaml:

esphome:
  name: esphome-web-ce182c
  friendly_name: lilygo

esp32:
  board: esp32dev
  framework:
    type: arduino

api:
  encryption:
    key: "randomlyinserted"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

external_components:
  - source: github://ashald/esphome@lilygo-t5-47
    components:
      - lilygo_t5_47

time:
  - platform: homeassistant
    id: ntp

font:
  - id: large
    file: "fonts/calibri.ttf"
    size: 100

display:
  - platform: lilygo_t5_47
    id: eink
    update_interval: 10s
    full_update_every: 6
    lambda: |-
       it.printf(20, 20, id(large), id(ntp).now().strftime("%Y-%m-%dT%H:%M:%S").c_str());

Copied directly from esphome/feature-requests#1109 (comment)

My system is HA 2023.11.3 with OS 11.1 (generic-x86-64 on an SSD in an old Dell Wyse Thin Client)
ESPHome is 2023.11.4

No idea what's going wrong here.

@lukbe
Copy link

lukbe commented Nov 27, 2023

My PR solved it normally…

Hello,
I have same problem. Could you please help me how to fix it? Thank you very much

@idefxH
Copy link
Author

idefxH commented Nov 27, 2023

Replace

  • source: github://ashald/esphome@lilygo-t5-47
    With
  • source: github://idefxH/esphome@lilygo-t5-47

@joshcliffejones
Copy link

Hi @idefxH

Using your updated component, do you have any idea why I would get the following issue when trying to use the touchscreen platform "lilygo_t5_47"?

touchscreen:

  • platform: lilygo_t5_47
    id: lilygo_touchscreen
    interrupt_pin: GPIO13
    display: t5_display
    on_touch:
    • logger.log:
      format: Touch at (%d, %d)
      args: ["touch.x", "touch.y"]

ID 't5_display' of type lilygo_t5_47::LilygoT547Display doesn't inherit from display::Display. Please double check your ID is pointing to the correct value.

Many thanks in advance for the help! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants