airy10 / esphome-m5stickC

esphome components for the M5StickC
81 stars 75 forks source link

esp-idf support? #22

Closed alexruffell closed 9 months ago

alexruffell commented 10 months ago

I am using a fork of your repository - https://github.com/martydingo/esphome-axp192 - to enable my M5Stack Core2. As soon as I attempted to move from an arduino to the esp-idf framework required by voice_assistant, I got an error about ESP.h (no detail) related to the axp192 component.

Can your component be used with esp-idf? I believe ESPHome is working towards a permanent move to that framework so it is only a matter of time before this will be come a big problem :(

airy10 commented 10 months ago

I've not worked on this component since I've initially released it - and st7735 display support is now standard part of esphome

You might try this axp192 component which is more complete than mine, and that I'm now using for my projects : https://gitlab.com/geiseri/esphome_extras

Some basic sample config:

external_components:
  - source:
      type: git
      url: https://gitlab.com/geiseri/esphome_extras.git
    refresh: 0s

i2c:
   - id: bus_a
     sda: GPIO21
     scl: GPIO22
     scan: True

axp192:
  id: axp
  address: 0x34
  update_interval: 60s
  i2c_id: bus_a
  charge_voltage: 4150mV
  dcdc1_voltage: 3300mv
  dcdc3_voltage: 1.5V

binary_sensor:
  - platform: axp192
    axp192_id: axp
    type: charge_indicate
    id: axp_charger
    name: "Charger"
  - platform: axp192
    axp192_id: axp
    type: battery_present
    name: Battery

sensor:
  - platform: axp192
    axp192_id: axp
    type: battery_voltage
    name: "Voltage"
  - platform: axp192
    axp192_id: axp
    type: battery_charge_current
    name: "Current"
    filters:
      - sliding_window_moving_average:
          window_size: 15
          send_every: 15

light:
  - platform: monochromatic
    id: backlight
    output: axp_ldo2
    #restore_mode: ALWAYS_ON
    name: "Backlight"