[time][homeassistant] Fix timezone handling (#16583)

This commit is contained in:
Clyde Stubbs
2026-05-26 06:51:15 +10:00
committed by GitHub
parent dcc30f8651
commit 0b780f1fd2
7 changed files with 414 additions and 20 deletions
+1 -1
View File
@@ -1169,7 +1169,7 @@ void APIConnection::on_camera_image_request(const CameraImageRequest &msg) {
void APIConnection::on_get_time_response(const GetTimeResponse &value) {
if (homeassistant::global_homeassistant_time != nullptr) {
homeassistant::global_homeassistant_time->set_epoch_time(value.epoch_seconds);
#ifdef USE_TIME_TIMEZONE
#if defined(USE_HOMEASSISTANT_TIMEZONE) && defined(USE_TIME_TIMEZONE)
if (!value.timezone.empty()) {
// Check if the sender provided pre-parsed timezone data.
// If std_offset is non-zero or DST rules are present, the parsed data was populated.