xbeaudouin / esphome-axp192

axp192 esphome component (to be used with esp-idf framework)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pionizer AXP192 Component

AXP192 power management library for ESPHome adopted for a custom ESPHome library for AI and related edge devices.

Installation

Copy the components to a custom_components directory next to your .yaml configuration file, or include directly from this repository.

Configuration

Sample configurations are found in the /sample-config folder.

This component adds a new model configuration to the AXP192 sensor which determines which registers are needed for each device. Available models are model: m5core2, model: m5stickc and model: m5tough.

Include axp192 component

external_components:
  - source: github://xbeaudouin/pionizer-axp192
    components: [axp192]

M5Stick-C

sensor:
  - platform: axp192
    model: m5stickc
    id: power_mgmt
    address: 0x34
    i2c_id: i2c_bus
    update_interval: 60s
    brightness: 100%
    battery_level:
      name: ${device} Battery Level
      id: batterylevel

M5Stack Core2

sensor:
  - platform: axp192
    model: m5core2
    id: power_mgmt
    address: 0x34
    i2c_id: i2c_bus
    update_interval: 60s
    brightness: 100%
    battery_level:
      name: ${device} Battery Level
      id: batterylevel

M5Tough

sensor:
  - platform: axp192
    model: m5tough
    id: power_mgmt
    address: 0x34
    i2c_id: i2c_bus
    update_interval: 60s
    brightness: 100%
    battery_level:
      name: ${device} Battery Level
      id: batterylevel

The display component required for the M5Tough is as follows:

display:
  - platform: ili9341
    # 320x240
    model: M5STACK
    cs_pin: GPIO5
    dc_pin: GPIO15
    lambda: |-
      it.print(160, 0, id(title_font), id(color_white), TextAlign::TOP_CENTER, "Hello World");

Credits and Disclaimers

This library is built on prior work published by @M5Stack as well as individual contributors like @airy10, @apolselli, @abmantis, @geiseri, @martydingo, @gonzalop, @shish, @cmet7, @JensGuckenbiehl, @leoedin, @rolloo, @paulchilton amongst others.

License

The original work by @M5STack that most or all of this is based on was originally licensed under MIT License. However, the various Github projects failed to specify the proper license and given this is currently an active fork of several of these repos, the license cannot be set at the repo level. Anyone leveraging this work should consider this to be derived work from the original MIT licensed code.

TODO

  • Additional contributions from @JensGuckenbiehl and @rolloo to review and merge into this code base

About

axp192 esphome component (to be used with esp-idf framework)


Languages

Language:C++ 85.5%Language:Python 14.5%