From 7efb13893312e6f32c591e66a85c56df35f38f65 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Tue, 14 Jun 2022 10:34:59 +1200 Subject: [PATCH] Remove power_pin --- esphome/components/es8388/__init__.py | 11 +---------- esphome/components/es8388/es8388_component.cpp | 6 ------ 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/esphome/components/es8388/__init__.py b/esphome/components/es8388/__init__.py index 56113e980f..3884755cb1 100644 --- a/esphome/components/es8388/__init__.py +++ b/esphome/components/es8388/__init__.py @@ -3,20 +3,13 @@ import esphome.config_validation as cv from esphome.components import i2c from esphome.const import CONF_ID -from esphome import pins es8388_ns = cg.esphome_ns.namespace("es8388") ES8388Component = es8388_ns.class_("ES8388Component", cg.Component, i2c.I2CDevice) -CONF_POWER_PIN = "power_pin" CONFIG_SCHEMA = ( - cv.Schema( - { - cv.GenerateID(): cv.declare_id(ES8388Component), - cv.Required(CONF_POWER_PIN): pins.gpio_output_pin_schema, - } - ) + cv.Schema({cv.GenerateID(): cv.declare_id(ES8388Component)}) .extend(i2c.i2c_device_schema(0x10)) .extend(cv.COMPONENT_SCHEMA) ) @@ -26,5 +19,3 @@ async def to_code(config): var = cg.new_Pvariable(config[CONF_ID]) await cg.register_component(var, config) await i2c.register_i2c_device(var, config) - pin = await cg.gpio_pin_expression(config[CONF_POWER_PIN]) - cg.add(var.set_power_pin(pin)) diff --git a/esphome/components/es8388/es8388_component.cpp b/esphome/components/es8388/es8388_component.cpp index 5ddf86c313..5e929be7c4 100644 --- a/esphome/components/es8388/es8388_component.cpp +++ b/esphome/components/es8388/es8388_component.cpp @@ -4,9 +4,6 @@ namespace esphome { namespace es8388 { void ES8388Component::setup() { - this->power_pin_->setup(); - this->power_pin_->digital_write(false); - // reset this->write_bytes(0x00, {0x80}); this->write_bytes(0x00, {0x00}); @@ -47,9 +44,6 @@ void ES8388Component::setup() { this->write_bytes(0x04, {0x30}); // unmute this->write_bytes(0x19, {0x00}); - - // Turn on amplifier - this->power_pin_->digital_write(true); } } // namespace es8388 } // namespace esphome