mirror of
https://github.com/esphome/esphome.git
synced 2026-09-30 16:30:22 +00:00
Revert API compilation_time to old locale-dependent format
Keep the API DeviceInfo compilation_time field using the old get_compilation_time_ref() format for backward compatibility. The text sensor build_time_str continues to use the new ISO 8601 format.
This commit is contained in:
@@ -26,13 +26,12 @@ async def test_build_info(
|
||||
assert device_info.name == "build-info-test"
|
||||
|
||||
# Verify compilation_time from device_info is present and parseable
|
||||
# The format is ISO 8601 with timezone: "YYYY-MM-DD HH:MM:SS +ZZZZ"
|
||||
# The format is locale-dependent: "Dec 15 2025, 17:44:16"
|
||||
compilation_time = device_info.compilation_time
|
||||
assert compilation_time is not None
|
||||
|
||||
# Validate the ISO format: "YYYY-MM-DD HH:MM:SS +ZZZZ"
|
||||
parsed = datetime.strptime(compilation_time, "%Y-%m-%d %H:%M:%S %z")
|
||||
assert parsed.year >= time.localtime().tm_year
|
||||
# Validate the format (locale-dependent, so just check it's not empty)
|
||||
assert len(compilation_time) > 0
|
||||
|
||||
# Get entities
|
||||
entities, _ = await client.list_entities_services()
|
||||
@@ -110,8 +109,5 @@ async def test_build_info(
|
||||
f"build_time_str '{build_time_str}' should match timestamp '{expected_str}'"
|
||||
)
|
||||
|
||||
# Verify compilation_time matches build_time_str (they should be the same)
|
||||
assert compilation_time == build_time_str, (
|
||||
f"compilation_time '{compilation_time}' should match "
|
||||
f"build_time_str '{build_time_str}'"
|
||||
)
|
||||
# Note: compilation_time (from API) uses old locale-dependent format,
|
||||
# while build_time_str (text sensor) uses new ISO format
|
||||
|
||||
Reference in New Issue
Block a user