Fix linter issues

This commit is contained in:
X-Ryl669 2024-04-05 14:57:13 +02:00
parent 0d21eca6c0
commit 29b7ad461d
4 changed files with 13 additions and 3 deletions

View file

@ -116,7 +116,9 @@ def _patch_idfi2cbus(config):
if "i2c" in fv.full_config.get(): if "i2c" in fv.full_config.get():
for i2c_inst in fv.full_config.get()["i2c"]: for i2c_inst in fv.full_config.get()["i2c"]:
i2c_inst["id"].type = MockObjClass( i2c_inst["id"].type = MockObjClass(
"i2c::ADFI2CBus", parents=i2c_inst["id"].type._parents "i2c::ADFI2CBus",
# pylint: disable=protected-access
parents=i2c_inst["id"].type._parents,
) )
return config return config

View file

@ -9,6 +9,10 @@
#include <cinttypes> #include <cinttypes>
namespace esphome { namespace esphome {
// Please the linter
namespace esp_adf {}
namespace i2c { namespace i2c {
static const char *const TAG = "i2c.adf"; static const char *const TAG = "i2c.adf";

View file

@ -12,6 +12,10 @@
#include <driver/i2c.h> #include <driver/i2c.h>
namespace esphome { namespace esphome {
// Please the linter
namespace esp_adf {}
namespace i2c { namespace i2c {
class ADFI2CBus : public I2CBus, public Component { class ADFI2CBus : public I2CBus, public Component {

View file

@ -174,12 +174,12 @@ void ESPADFSpeaker::player_task(void *params) {
xQueueSend(this_speaker->event_queue_, &event, portMAX_DELAY); xQueueSend(this_speaker->event_queue_, &event, portMAX_DELAY);
audio_pipeline_unregister(pipeline, i2s_stream_writer); audio_pipeline_unregister(pipeline, i2s_stream_writer);
audio_pipeline_unregister(pipeline, filter); // audio_pipeline_unregister(pipeline, filter);
audio_pipeline_unregister(pipeline, raw_write); audio_pipeline_unregister(pipeline, raw_write);
audio_pipeline_deinit(pipeline); audio_pipeline_deinit(pipeline);
audio_element_deinit(i2s_stream_writer); audio_element_deinit(i2s_stream_writer);
audio_element_deinit(filter); // audio_element_deinit(filter);
audio_element_deinit(raw_write); audio_element_deinit(raw_write);
event.type = TaskEventType::STOPPED; event.type = TaskEventType::STOPPED;