From 3d9af2a67c3de1ff9761d099364c399f07a93803 Mon Sep 17 00:00:00 2001 From: croessi <87674139+croessi@users.noreply.github.com> Date: Mon, 4 Sep 2023 22:40:46 +0200 Subject: [PATCH] Added Handling for Nack "file not found" (#5338) --- esphome/components/dfplayer/dfplayer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/esphome/components/dfplayer/dfplayer.cpp b/esphome/components/dfplayer/dfplayer.cpp index a6339dc988..39a30d035e 100644 --- a/esphome/components/dfplayer/dfplayer.cpp +++ b/esphome/components/dfplayer/dfplayer.cpp @@ -101,6 +101,11 @@ void DFPlayer::loop() { ESP_LOGV(TAG, "Nack"); this->ack_set_is_playing_ = false; this->ack_reset_is_playing_ = false; + if (argument == 6) { + ESP_LOGV(TAG, "File not found"); + this->is_playing_ = false; + } + break; case 0x41: ESP_LOGV(TAG, "Ack ok"); this->is_playing_ |= this->ack_set_is_playing_;