Skip to content

Commit b6493eb

Browse files
Add enum ElectricalComponentControlMode
This enum is used to explicitly define whether an electrical component is intended to be active (enabled) or inactive (disabled). This intention directly determines the component's availability to downstream services and applications. Note that this enum differs from the `ElectricalComponentStatus` enum, which is used to report the actual operational state of the component. Signed-off-by: Tiyash Basu <[email protected]> # Conflicts: # RELEASE_NOTES.md # proto/frequenz/api/common/v1/microgrid/electrical_components/electrical_components.proto
1 parent 997959c commit b6493eb

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
- Added new message definitions for streaming events (Deleted, Created, Updated)
2525
- Remove unnecessary gap in numbering in the `ElectricalComponentCategory` enum.
2626
- Renumber variants in the `Metric` enum to remove unnecessary gaps.
27+
- Added a new enum `ElectricalComponentControlMode` to define control modes for electrical components.
2728

2829
## Bug Fixes
2930

proto/frequenz/api/common/v1/microgrid/electrical_components/electrical_components.proto

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,54 @@ enum ElectricalComponentStateCode {
182182
ELECTRICAL_COMPONENT_STATE_CODE_PRECHARGER_CLOSED = 42;
183183
}
184184

185+
// `ElectricalComponentControlMode` explicitly defines whether an electrical
186+
// component is intended to be active (enabled) or inactive (disabled). This
187+
// intentional setting directly determines component availability to downstream
188+
// agents, applications, and services.
189+
//
190+
// !!! note "Control Mode & Component Availability"
191+
// The Control Mode explicitly represents the user's or automation's
192+
// intention to make the component either ACTIVE or INACTIVE. This directly
193+
// impacts availability:
194+
// - ACTIVE indicates the component is intended to be available and usable
195+
// by downstream agents and services.
196+
// - INACTIVE indicates the component is intended to be unavailable for use
197+
// by downstream agents and services.
198+
//
199+
// !!! note "Relationship with Operational State"
200+
// Control Mode explicitly represents intention, distinct from the
201+
// component's actual internal Operational State.
202+
// Operational State is independently reported by the component hardware
203+
// (e.g., READY, CHARGING, DISCHARGING, ERROR).
204+
//
205+
// !!! caution "Immediate Operational Impact"
206+
// Changing the Control Mode of an electrical component (e.g., via the
207+
// Microgrid API) takes immediate effect on its availability to downstream
208+
// agents and services. Setting a component to `INACTIVE` can thus instantly
209+
// interrupt ongoing operations or cause service disruptions. Setting a
210+
// component to `ACTIVE` may immediately connect it with other components,
211+
// potentially causing electrical damage. Therefore, ensure changes are
212+
// coordinated or planned appropriately to avoid unintended impact and/or
213+
// damages.
214+
//
215+
// !!! example "Control Mode Change Impact"
216+
// If a battery component's Control Mode is switched from `ACTIVE` to
217+
// `INACTIVE`, it immediately becomes unavailable to downstream
218+
// services and agents, potentially disrupting scheduled
219+
// charging/discharging cycles.
220+
enum ElectricalComponentControlMode {
221+
// The control mode is unspecified (should never be explicitly used).
222+
ELECTRICAL_COMPONENT_CONTROL_MODE_UNSPECIFIED = 0;
223+
224+
// The component is explicitly enabled and intended to be available for
225+
// downstream usage.
226+
ELECTRICAL_COMPONENT_CONTROL_MODE_ACTIVE = 1;
227+
228+
// The component is explicitly disabled and intended to be unavailable for
229+
// downstream usage.
230+
ELECTRICAL_COMPONENT_CONTROL_MODE_INACTIVE = 2;
231+
}
232+
185233
// A representation of all possible diagnostic codes that can occur for
186234
// electrical component, across all their categories. These diagnostic codes
187235
// can be used to refer to warnings or errors that are reported by the

0 commit comments

Comments
 (0)