Simplify sun condition schema by re-using an existing type (#161894)

Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
Mark Jansen
2026-02-06 12:27:16 +01:00
committed by GitHub
parent 95a58252cf
commit 286730165d

View File

@@ -26,9 +26,7 @@ from homeassistant.util import dt as dt_util
_OPTIONS_SCHEMA_DICT: dict[vol.Marker, Any] = {
vol.Optional("before"): cv.sun_event,
vol.Optional("before_offset"): cv.time_period,
vol.Optional("after"): vol.All(
vol.Lower, vol.Any(SUN_EVENT_SUNSET, SUN_EVENT_SUNRISE)
),
vol.Optional("after"): cv.sun_event,
vol.Optional("after_offset"): cv.time_period,
}