libretiny-eu / libretiny

PlatformIO development platform for IoT modules
http://docs.libretiny.eu/
MIT License
383 stars 55 forks source link

Migrating from libretiny-esphome to stock esphome - ledc error #178

Closed DJBenson closed 9 months ago

DJBenson commented 9 months ago

I appreciate the libretiny platform is new so just giving a heads up on this - but when I migrate my yaml from the libretiny-esphome to stock esphome install, I get an error that ledc depends on esp32.

Code snippet;

output:
  - platform: ledc
    id: output_red
    pin: P26
  - platform: ledc
    id: output_green
    pin: P24
  - platform: ledc
    id: output_blue
    pin: P6
  - platform: ledc
    id: output_cold
    pin: P8
  - platform: ledc
    id: output_warm
    pin: P7

Compile error;

INFO ESPHome 2023.9.1
INFO Reading configuration /config/esphome/motion-night-light-landing.yaml...
Failed config

output.ledc: [source /config/esphome/.generic-motion-night-light.yaml:44]

  Component output.ledc requires component esp32.
  platform: ledc
  id: output_red
  pin: P26
output.ledc: [source /config/esphome/.generic-motion-night-light.yaml:47]

  Component output.ledc requires component esp32.
  platform: ledc
  id: output_green
  pin: P24
output.ledc: [source /config/esphome/.generic-motion-night-light.yaml:50]

  Component output.ledc requires component esp32.
  platform: ledc
  id: output_blue
  pin: P6
output.ledc: [source /config/esphome/.generic-motion-night-light.yaml:53]

  Component output.ledc requires component esp32.
  platform: ledc
  id: output_cold
  pin: P8
output.ledc: [source /config/esphome/.generic-motion-night-light.yaml:56]

  Component output.ledc requires component esp32.
  platform: ledc
  id: output_warm
  pin: P7

Not sure if this is related to #177 but I don't get the platform error.

Cossid commented 9 months ago

ledc was ranamed libretiny_pwm for the LibreTiny platform, as ledc is actually ESP32 specific. Just switch to libretiny_pwm and it will work fine. UPK config generators have also been updated with this change.