Compare commits

...
4 changed files with 11 additions and 3 deletions
+8
View File
@@ -9,6 +9,7 @@ from esphome import automation
from esphome.automation import Condition
import esphome.codegen as cg
from esphome.components.zephyr import zephyr_add_prj_conf
from esphome.config_helpers import filter_source_files_from_defines
import esphome.config_validation as cv
from esphome.const import (
CONF_AT,
@@ -475,3 +476,10 @@ async def to_code(config):
async def time_has_time_to_code(config, condition_id, template_arg, args):
paren = await cg.get_variable(config[CONF_ID])
return cg.new_Pvariable(condition_id, template_arg, paren)
# posix_tz.cpp is fully #ifdef'd on USE_TIME_TIMEZONE, set only when a
# timezone is configured or detected.
FILTER_SOURCE_FILES = filter_source_files_from_defines(
{"posix_tz.cpp": "USE_TIME_TIMEZONE"}
)
+1 -1
View File
@@ -4,6 +4,6 @@ from tests.testing_helpers import ComponentManifestOverride
def override_manifest(manifest: ComponentManifestOverride) -> None:
async def to_code(config):
cg.add_build_flag("-DUSE_TIME_TIMEZONE")
cg.add_define("USE_TIME_TIMEZONE")
manifest.to_code = to_code
+1 -1
View File
@@ -4,6 +4,6 @@ from tests.testing_helpers import ComponentManifestOverride
def override_manifest(manifest: ComponentManifestOverride) -> None:
async def to_code(config):
cg.add_build_flag("-DUSE_TIME_TIMEZONE")
cg.add_define("USE_TIME_TIMEZONE")
manifest.to_code = to_code
+1 -1
View File
@@ -1,7 +1,7 @@
// Tests for time conversion functions, DST detection, and ESPTime::strptime.
//
// These tests cover the permanent timezone functions: epoch_to_local_tm, is_in_dst,
// calculate_dst_transition, and the internal helper functions they depend on.
// calculate_dst_transition, and the internal helpers they depend on.
// Enable USE_TIME_TIMEZONE for tests
#define USE_TIME_TIMEZONE