1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-13 00:32:20 +01:00

play_folder bugfix and addition of play_mp3 (#4758)

This commit is contained in:
Luis Andrade
2023-05-01 00:01:24 -04:00
committed by GitHub
parent 76b6fcf554
commit c13e20643b
3 changed files with 36 additions and 2 deletions

View File

@@ -7,10 +7,10 @@ namespace dfplayer {
static const char *const TAG = "dfplayer";
void DFPlayer::play_folder(uint16_t folder, uint16_t file) {
if (folder < 100 && file < 256) {
if (folder <= 10 && file <= 1000) {
this->ack_set_is_playing_ = true;
this->send_cmd_(0x0F, (uint8_t) folder, (uint8_t) file);
} else if (folder <= 10 && file <= 1000) {
} else if (folder < 100 && file < 256) {
this->ack_set_is_playing_ = true;
this->send_cmd_(0x14, (((uint16_t) folder) << 12) | file);
} else {