mirror of
https://github.com/esphome/esphome.git
synced 2026-10-01 17:00:21 +00:00
Harden track_presence generator option and fix test fixtures
Set the presence flag after the submessage decode, dump it in verbose protobuf dumps, and raise at generation time when track_presence is set on a field where it has no effect. Retire the absent-field expectation in the integration test so the UTC phase sees the first matching state, and align the Sydney TZ strings with the 03:00 fall-back the struct helper uses.
This commit is contained in:
@@ -84,7 +84,7 @@ static ParsedTimezone make_new_zealand() {
|
||||
return tz;
|
||||
}
|
||||
|
||||
// Helper to build Australia/Sydney timezone (AEST-10AEDT,M10.1.0,M4.1.0)
|
||||
// Helper to build Australia/Sydney timezone (AEST-10AEDT,M10.1.0,M4.1.0/3)
|
||||
static ParsedTimezone make_australia_sydney() {
|
||||
ParsedTimezone tz{};
|
||||
tz.std_offset_seconds = -10 * 3600;
|
||||
@@ -674,9 +674,9 @@ TEST(RecalcTimestampLocal, FallBackRepeatedHour) {
|
||||
}
|
||||
|
||||
TEST(RecalcTimestampLocal, SouthernHemisphereDST) {
|
||||
// Set timezone to Australia/Sydney (AEST-10AEDT,M10.1.0,M4.1.0)
|
||||
// Set timezone to Australia/Sydney (AEST-10AEDT,M10.1.0,M4.1.0/3)
|
||||
// DST starts first Sunday of October, ends first Sunday of April
|
||||
const char *tz_str = "AEST-10AEDT,M10.1.0,M4.1.0";
|
||||
const char *tz_str = "AEST-10AEDT,M10.1.0,M4.1.0/3";
|
||||
setenv("TZ", tz_str, 1);
|
||||
tzset();
|
||||
auto tz = make_australia_sydney();
|
||||
@@ -817,7 +817,7 @@ TEST(RecalcTimestampLocal, MinimalFieldsNoDST) {
|
||||
TEST(RecalcTimestampLocal, YearBoundaryDST) {
|
||||
// Test southern hemisphere DST across year boundary
|
||||
// Australia/Sydney: DST active from October to April (spans Jan 1)
|
||||
const char *tz_str = "AEST-10AEDT,M10.1.0,M4.1.0";
|
||||
const char *tz_str = "AEST-10AEDT,M10.1.0,M4.1.0/3";
|
||||
setenv("TZ", tz_str, 1);
|
||||
tzset();
|
||||
auto tz = make_australia_sydney();
|
||||
|
||||
Reference in New Issue
Block a user