Skip to content

Support temporal expressions#14

Merged
johanflint merged 4 commits into
mainfrom
feature/support-date-time-expressions
Oct 22, 2025
Merged

Support temporal expressions#14
johanflint merged 4 commits into
mainfrom
feature/support-date-time-expressions

Conversation

@johanflint

Copy link
Copy Markdown
Owner
  • Support setting the location in the config file
  • Supported expressions:
    • Is it a certain day, like "Monday" or "Wed"
    • Is it within a range of days, like "Mon-Fri"
    • Is it within a set of days, like ["Mon", "Wed"]
    • Is it a weekday
    • Is it weekend
    • Is before a certain time
    • Is after a certain time
    • Has the sun risen
    • Has the sun set
    • Is it daytime
    • Is it nighttime

Enables evaluation of temporal expressions, specifically checking if the current day matches a given weekday.

This allows flows to be triggered based on the day of the week.
Introduces a new `TemporalExpression` enum and a `Weekday` enum.
Also, adds a `now` field to the `Context` struct to provide the current time.
Adds `IsBeforeTime` and `IsAfterTime` temporal expressions to the flow engine,
allowing flows to trigger based on time-of-day comparisons.

Introduces a `Time` struct to represent a specific time, and a custom
deserializer to parse time strings in "HH:MM" format.

This enhances the flexibility of flow definitions by enabling time-based
conditions.
Adds location configuration to enable flow execution based on sunrise and sunset times.

This change introduces the `sunrise` crate for calculating solar events.
It also adds `GeoLocation` struct and integrates it into the application configuration.
Flow execution context is updated to include sunrise and sunset times.
New temporal expressions are added to check if the sun has risen/set, or if it's daytime/nighttime.

This enables flows to be triggered based on time of day relative to sunrise and sunset.
Adds `WeekdayCondition` to `TemporalExpression` to allow for more
flexible scheduling based on weekdays, ranges, sets, weekdays, or
weekends.

This simplifies flow definition and allows for more complex time-based
logic.
@johanflint johanflint merged commit 3f493c5 into main Oct 22, 2025
6 checks passed
@johanflint johanflint deleted the feature/support-date-time-expressions branch October 22, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant