Skip to content

Commit 33ae915

Browse files
authored
2 parents 59dcdc0 + 2238577 commit 33ae915

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Added new message `SensorDiagnostic` to represent warnings and errors in microgrid sensors.
1919
- The enum `SensorErrorCode` has now been renamed to `SensorDiagnosticCode` to better reflect its shared usage with warnings and errors.
2020
- Added warnings to sensor `SensorState`.
21+
- Added a common `TimeIntervalFilter` message in `frequenz.api.common.v1.types` to standardize time interval filtering across APIs. This uses `start_time` (inclusive) and `end_time` (exclusive) fields, aligning with ISO 8601 and common programming conventions.
2122

2223
## Bug Fixes
2324

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// A time interval filter.
2+
//
3+
// Copyright 2025 Frequenz Energy-as-a-Service GmbH
4+
//
5+
// Licensed under the MIT License (the "License");
6+
// you may not use this file except in compliance with the License.
7+
8+
syntax = "proto3";
9+
10+
package frequenz.api.common.v1.types;
11+
12+
import "google/protobuf/timestamp.proto";
13+
14+
15+
// Represents a time interval filter.
16+
//
17+
// The interval includes the start time and excludes the end time.
18+
// This follows the convention used in ISO 8601 for time intervals,
19+
// Pandas slicing, and Python slicing: [start_time, end_time).
20+
//
21+
// * If `start_time` is omitted, the interval is
22+
// considered unbounded at the start.
23+
// * If `end_time` is omitted, the interval is
24+
// considered unbounded at the end.
25+
message TimeIntervalFilter {
26+
// The beginning of the time interval (inclusive).
27+
//
28+
// Must be a UTC timestamp.
29+
google.protobuf.Timestamp start_time = 1;
30+
31+
// The end of the time interval (exclusive).
32+
//
33+
// Must be a UTC timestamp.
34+
google.protobuf.Timestamp end_time = 2;
35+
}

0 commit comments

Comments
 (0)