boverby / lc709203f

esphome support for lc709203f on ESP32_Bat_Pro
8 stars 12 forks source link

how to revise custom components? #4

Open bhouseski opened 3 months ago

bhouseski commented 3 months ago

Trying to implement this, but do not understand how to implement the revised code for sensor.py, lc709203f.h, lc709203f.cpp.

can you advise.

log below

INFO ESPHome 2024.6.6 INFO Reading configuration /config/esphome/waveshare-e-ink.yaml... ERROR Unable to load component sensor: Traceback (most recent call last): File "/esphome/esphome/loader.py", line 176, in _lookup_module module = importlib.import_module(f"esphome.components.{domain}") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1206, in _gcd_import File "", line 1178, in _find_and_load File "", line 1149, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "/config/esphome/components/sensor.py", line 18, in sensor.sensor_schema(UNIT_VOLT, ICON_EMPTY, 2).extend({ ^^^^^^^^^^^^^^^^^^^^ AttributeError: partially initialized module 'esphome.components.sensor' has no attribute 'sensor_schema' (most likely due to a circular import) Failed config

sensor: [source /config/esphome/waveshare-e-ink.yaml:47]

Component not found: sensor.

boverby commented 3 months ago

see issue 3