Add components/es8388/audio_dac.py

This commit is contained in:
uncarvedblock committed 2026-10-31 12:55:54 -04:00
1 parent 94b2410a20
commit 21929ef554
1 file changed
+27
+27
View File
@@ -0,0 +1,27 @@
import esphome.codegen as cg
from esphome.components import i2c
from esphome.components.audio_dac import AudioDac
import esphome.config_validation as cv
from esphome.const import CONF_ID
from esphome.types import ConfigType
CODEOWNERS = ["@P4uLT"]
CONF_ES8388_ID = "es8388_id"
es8388_ns = cg.esphome_ns.namespace("es8388")
ES8388 = es8388_ns.class_("ES8388", AudioDac, cg.Component, i2c.I2CDevice)
DEPENDENCIES = ["i2c"]
CONFIG_SCHEMA = (
cv.Schema({cv.GenerateID(): cv.declare_id(ES8388)})
.extend(cv.COMPONENT_SCHEMA)
.extend(i2c.i2c_device_schema(0x10))
)
async def to_code(config: ConfigType) -> None:
var = cg.new_Pvariable(config[CONF_ID])
await cg.register_component(var, config)
await i2c.register_i2c_device(var, config)