Skip to content

Commit fa073cc

Browse files
committed
Rename MicrogridClient::list_components → list_electrical_components
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
1 parent c67da70 commit fa073cc

4 files changed

Lines changed: 15 additions & 15 deletions

File tree

src/client/instruction.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ pub(super) enum Instruction {
1919
electrical_component_id: u64,
2020
response_tx: oneshot::Sender<broadcast::Receiver<ElectricalComponentTelemetry>>,
2121
},
22-
ListComponents {
23-
component_ids: Vec<u64>,
24-
categories: Vec<i32>,
22+
ListElectricalComponents {
23+
electrical_component_ids: Vec<u64>,
24+
electrical_component_categories: Vec<i32>,
2525
response_tx: oneshot::Sender<Result<Vec<ElectricalComponent>, Error>>,
2626
},
2727
ListConnections {

src/client/microgrid_client_actor.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,15 @@ async fn handle_instruction(
155155
Error::internal("failed to send response")
156156
})?;
157157
}
158-
Some(Instruction::ListComponents {
158+
Some(Instruction::ListElectricalComponents {
159159
response_tx,
160-
component_ids,
161-
categories,
160+
electrical_component_ids,
161+
electrical_component_categories,
162162
}) => {
163163
let components = client
164164
.list_electrical_components(ListElectricalComponentsRequest {
165-
electrical_component_ids: component_ids,
166-
electrical_component_categories: categories,
165+
electrical_component_ids,
166+
electrical_component_categories,
167167
})
168168
.await
169169
.map_err(|e| Error::connection_failure(format!("list_components failed: {e}")))

src/client/microgrid_client_handle.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,18 @@ impl MicrogridClientHandle {
7777
/// `ComponentCategory::COMPONENT_CATEGORY_BATTERY`.
7878
///
7979
/// If a filter list is empty, then that filter is not applied.
80-
pub async fn list_components(
80+
pub async fn list_electrical_components(
8181
&self,
82-
component_ids: Vec<u64>,
83-
categories: Vec<i32>,
82+
electrical_component_ids: Vec<u64>,
83+
electrical_component_categories: Vec<i32>,
8484
) -> Result<Vec<ElectricalComponent>, Error> {
8585
let (response_tx, response_rx) = oneshot::channel();
8686

8787
self.instructions_tx
88-
.send(Instruction::ListComponents {
88+
.send(Instruction::ListElectricalComponents {
8989
response_tx,
90-
component_ids,
91-
categories,
90+
electrical_component_ids,
91+
electrical_component_categories,
9292
})
9393
.await
9494
.map_err(|_| Error::internal("failed to send instruction"))?;

src/logical_meter/logical_meter_handle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ impl LogicalMeterHandle {
3030
) -> Result<Self, Error> {
3131
let (sender, receiver) = mpsc::channel(8);
3232
let graph = ComponentGraph::try_new(
33-
client.list_components(vec![], vec![]).await?,
33+
client.list_electrical_components(vec![], vec![]).await?,
3434
client.list_connections(vec![], vec![]).await?,
3535
frequenz_microgrid_component_graph::ComponentGraphConfig {
3636
allow_component_validation_failures: true,

0 commit comments

Comments
 (0)