Skip to content

Commit c498d14

Browse files
committed
Rename list_connections → list_electrical_component_connections
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
1 parent 816726e commit c498d14

4 files changed

Lines changed: 17 additions & 15 deletions

File tree

src/client/instruction.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ pub(super) enum Instruction {
2424
electrical_component_categories: Vec<i32>,
2525
response_tx: oneshot::Sender<Result<Vec<ElectricalComponent>, Error>>,
2626
},
27-
ListConnections {
28-
starts: Vec<u64>,
29-
ends: Vec<u64>,
27+
ListElectricalComponentConnections {
28+
source_electrical_component_ids: Vec<u64>,
29+
destination_electrical_component_ids: Vec<u64>,
3030
response_tx: oneshot::Sender<Result<Vec<ElectricalComponentConnection>, Error>>,
3131
},
3232
}

src/client/microgrid_client_actor.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,15 @@ async fn handle_instruction(
173173
.send(components)
174174
.map_err(|_| Error::internal("failed to send response"))?;
175175
}
176-
Some(Instruction::ListConnections {
176+
Some(Instruction::ListElectricalComponentConnections {
177177
response_tx,
178-
starts,
179-
ends,
178+
source_electrical_component_ids,
179+
destination_electrical_component_ids,
180180
}) => {
181181
let connections = client
182182
.list_electrical_component_connections(ListElectricalComponentConnectionsRequest {
183-
source_electrical_component_ids: starts,
184-
destination_electrical_component_ids: ends,
183+
source_electrical_component_ids,
184+
destination_electrical_component_ids,
185185
})
186186
.await
187187
.map_err(|e| Error::connection_failure(format!("list_connections failed: {e}")))

src/client/microgrid_client_handle.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,18 +115,18 @@ impl MicrogridClientHandle {
115115
/// * each `start` component ID is either `1`, `2`, OR `3`,
116116
/// AND
117117
/// * each `end` component ID is either `4`, `5`, OR `6`.
118-
pub async fn list_connections(
118+
pub async fn list_electrical_component_connections(
119119
&self,
120-
starts: Vec<u64>,
121-
ends: Vec<u64>,
120+
source_electrical_component_ids: Vec<u64>,
121+
destination_electrical_component_ids: Vec<u64>,
122122
) -> Result<Vec<ElectricalComponentConnection>, Error> {
123123
let (response_tx, response_rx) = oneshot::channel();
124124

125125
self.instructions_tx
126-
.send(Instruction::ListConnections {
126+
.send(Instruction::ListElectricalComponentConnections {
127127
response_tx,
128-
starts,
129-
ends,
128+
source_electrical_component_ids,
129+
destination_electrical_component_ids,
130130
})
131131
.await
132132
.map_err(|_| Error::internal("failed to send instruction"))?;

src/logical_meter/logical_meter_handle.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ impl LogicalMeterHandle {
3131
let (sender, receiver) = mpsc::channel(8);
3232
let graph = ComponentGraph::try_new(
3333
client.list_electrical_components(vec![], vec![]).await?,
34-
client.list_connections(vec![], vec![]).await?,
34+
client
35+
.list_electrical_component_connections(vec![], vec![])
36+
.await?,
3537
frequenz_microgrid_component_graph::ComponentGraphConfig {
3638
allow_component_validation_failures: true,
3739
allow_unconnected_components: true,

0 commit comments

Comments
 (0)