diff --git a/docker/Dockerfile b/docker/Dockerfile index f6234235f7..36be700f55 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -101,7 +101,7 @@ RUN --mount=type=tmpfs,target=/root/.cargo if [ "$TARGETARCH$TARGETVARIANT" = "a && /platformio_install_deps.py /platformio.ini --libraries # Avoid unsafe git error when container user and file config volume permissions don't match -RUN git config --system --add safe.directory '/config/*' +RUN git config --system --add safe.directory '*' # ======================= docker-type image ======================= diff --git a/esphome/components/datetime/date_entity.cpp b/esphome/components/datetime/date_entity.cpp index 19399c1e59..b5bcef43af 100644 --- a/esphome/components/datetime/date_entity.cpp +++ b/esphome/components/datetime/date_entity.cpp @@ -80,6 +80,17 @@ void DateCall::validate_() { void DateCall::perform() { this->validate_(); + ESP_LOGD(TAG, "'%s' - Setting", this->parent_->get_name().c_str()); + + if (this->year_.has_value()) { + ESP_LOGD(TAG, " Year: %d", *this->year_); + } + if (this->month_.has_value()) { + ESP_LOGD(TAG, " Month: %d", *this->month_); + } + if (this->day_.has_value()) { + ESP_LOGD(TAG, " Day: %d", *this->day_); + } this->parent_->control(*this); } diff --git a/esphome/components/i2s_audio/media_player/i2s_audio_media_player.cpp b/esphome/components/i2s_audio/media_player/i2s_audio_media_player.cpp index 1890e27bdf..ef494fac2e 100644 --- a/esphome/components/i2s_audio/media_player/i2s_audio_media_player.cpp +++ b/esphome/components/i2s_audio/media_player/i2s_audio_media_player.cpp @@ -27,6 +27,11 @@ void I2SAudioMediaPlayer::control(const media_player::MediaPlayerCall &call) { this->start(); } } + + if (this->state == media_player::MEDIA_PLAYER_STATE_ANNOUNCING) { + this->is_announcement_ = true; + } + if (call.get_volume().has_value()) { this->volume = call.get_volume().value(); this->set_volume_(volume); @@ -171,9 +176,8 @@ void I2SAudioMediaPlayer::start_() { if (this->current_url_.has_value()) { this->audio_->connecttohost(this->current_url_.value().c_str()); this->state = media_player::MEDIA_PLAYER_STATE_PLAYING; - if (this->is_announcement_.has_value()) { - this->state = this->is_announcement_.value() ? media_player::MEDIA_PLAYER_STATE_ANNOUNCING - : media_player::MEDIA_PLAYER_STATE_PLAYING; + if (this->is_announcement_) { + this->state = media_player::MEDIA_PLAYER_STATE_ANNOUNCING; } this->publish_state(); } @@ -202,6 +206,7 @@ void I2SAudioMediaPlayer::stop_() { this->high_freq_.stop(); this->state = media_player::MEDIA_PLAYER_STATE_IDLE; this->publish_state(); + this->is_announcement_ = false; } media_player::MediaPlayerTraits I2SAudioMediaPlayer::get_traits() { diff --git a/esphome/components/i2s_audio/media_player/i2s_audio_media_player.h b/esphome/components/i2s_audio/media_player/i2s_audio_media_player.h index d7d9b1f74a..5afe778122 100644 --- a/esphome/components/i2s_audio/media_player/i2s_audio_media_player.h +++ b/esphome/components/i2s_audio/media_player/i2s_audio_media_player.h @@ -78,7 +78,7 @@ class I2SAudioMediaPlayer : public Component, public media_player::MediaPlayer, HighFrequencyLoopRequester high_freq_; optional current_url_{}; - optional is_announcement_{}; + bool is_announcement_{false}; }; } // namespace i2s_audio diff --git a/esphome/core/time.cpp b/esphome/core/time.cpp index add671701f..f7aa4fdddb 100644 --- a/esphome/core/time.cpp +++ b/esphome/core/time.cpp @@ -84,6 +84,16 @@ bool ESPTime::strptime(const std::string &time_to_parse, ESPTime &esp_time) { esp_time.hour = hour; esp_time.minute = minute; esp_time.second = second; + } else if (sscanf(time_to_parse.c_str(), "%04hu-%02hhu-%02hhu %02hhu:%02hhu %n", &year, &month, &day, // NOLINT + &hour, // NOLINT + &minute, &num) == 5 && // NOLINT + num == time_to_parse.size()) { + esp_time.year = year; + esp_time.month = month; + esp_time.day_of_month = day; + esp_time.hour = hour; + esp_time.minute = minute; + esp_time.second = 0; } else if (sscanf(time_to_parse.c_str(), "%02hhu:%02hhu:%02hhu %n", &hour, &minute, &second, &num) == 3 && // NOLINT num == time_to_parse.size()) { esp_time.hour = hour;