Skip to content

Commit 6a8452e

Browse files
Add protobuf definition for communication components (#292)
2 parents acba2c9 + 7d3901c commit 6a8452e

File tree

4 files changed

+93
-1
lines changed

4 files changed

+93
-1
lines changed

RELEASE_NOTES.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010

1111
## New Features
1212

13+
- Renamed `components` to `electrical_components` and related messages, fields, enums.
1314
- Added message linking microgrid and sensor IDs.
14-
- Rename `components` to `electrical_components` and related messages, fields, enums.
15+
- Added new message definitions for communication components.
1516

1617
## Bug Fixes
1718

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
// Frequenz microgrid communication components definitions.
2+
//
3+
// Copyright:
4+
// Copyright 2025 Frequenz Energy-as-a-Service GmbH
5+
//
6+
// License:
7+
// MIT
8+
9+
syntax = "proto3";
10+
11+
package frequenz.api.common.v1.microgrid.communication_components;
12+
13+
14+
// `CommunicationComponent` represents a communication component within a
15+
// microgrid.
16+
//
17+
// Communication components are networked devices responsible for enabling
18+
// communication between electrical components, sensors, controllers, and other
19+
// network devices.
20+
message CommunicationComponent {
21+
// Unique identifier of the communication component.
22+
uint64 id = 1;
23+
24+
// Unique identifier of the parent microgrid.
25+
uint64 microgrid_id = 2;
26+
27+
// Human-readable name of the communication component.
28+
string name = 3;
29+
30+
// Category identifying the type of the communication component.
31+
CommunicationComponentCategory category = 4;
32+
33+
// List of IP addresses assigned to this communication component.
34+
repeated string ip_addresses = 5;
35+
}
36+
37+
// `CommunicationComponentCategory` enumerates possible types of communication
38+
// components within the microgrid.
39+
//
40+
// Categories help distinguish communication devices according to their roles,
41+
// capabilities, and protocols they handle within the microgrid infrastructure.
42+
enum CommunicationComponentCategory {
43+
// Unspecified communication component category.
44+
//
45+
// !!! caution
46+
// This default value should never be used explicitly and indicates that
47+
// the category has not been properly defined.
48+
COMMUNICATION_COMPONENT_CATEGORY_UNSPECIFIED = 0;
49+
50+
// Modbus Gateway used for protocol translation and managing Modbus
51+
// communication.
52+
COMMUNICATION_COMPONENT_CATEGORY_MODBUS_GATEWAY = 1;
53+
54+
// LTE Router providing cellular connectivity (LTE, 4G, 5G) for the microgrid.
55+
COMMUNICATION_COMPONENT_CATEGORY_ROUTER = 2;
56+
57+
// Ethernet Switch enabling wired network connections within the microgrid.
58+
COMMUNICATION_COMPONENT_CATEGORY_ETHERNET_SWITCH = 3;
59+
60+
// Digital Input/Output (DIO) Gateway enabling communication and control
61+
// of digital signals between microgrid devices.
62+
COMMUNICATION_COMPONENT_CATEGORY_DIO_GATEWAY = 4;
63+
64+
// Programmable Logic Controller (PLC) used for automation tasks,
65+
// process control, and operational logic in the microgrid.
66+
COMMUNICATION_COMPONENT_CATEGORY_PLC = 5;
67+
68+
// Serial Gateway (RS-232, RS-485, etc.) facilitating serial communication
69+
// between legacy equipment and modern network infrastructures.
70+
COMMUNICATION_COMPONENT_CATEGORY_SERIAL_GATEWAY = 6;
71+
}

py/frequenz/api/common/v1/microgrid/communication_components/__init__.py

Whitespace-only changes.

pytests/test_common.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,26 @@ def test_module_import_microgrid_electrical_components() -> None:
189189
assert transformer_pb2_grpc is not None
190190

191191

192+
def test_module_import_microgrid_communication_components() -> None:
193+
"""Test that the modules can be imported."""
194+
# pylint: disable=import-outside-toplevel
195+
from frequenz.api.common.v1.microgrid import communication_components
196+
197+
assert communication_components is not None
198+
199+
from frequenz.api.common.v1.microgrid.communication_components import (
200+
communication_components_pb2,
201+
)
202+
203+
assert communication_components_pb2 is not None
204+
205+
from frequenz.api.common.v1.microgrid.communication_components import (
206+
communication_components_pb2_grpc,
207+
)
208+
209+
assert communication_components_pb2_grpc is not None
210+
211+
192212
def test_module_import_location() -> None:
193213
"""Test that the modules can be imported."""
194214
# pylint: disable=import-outside-toplevel

0 commit comments

Comments
 (0)