Skip to content

Commit 5a701da

Browse files
authored
Rename objects returned by calls to response internally (#179)
2 parents 6840ced + 34d9578 commit 5a701da

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/frequenz/client/microgrid/_client.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ async def get_microgrid_info( # noqa: DOC502 (raises ApiClientError indirectly)
157157
most likely a subclass of
158158
[GrpcError][frequenz.client.microgrid.GrpcError].
159159
"""
160-
microgrid = await client.call_stub_method(
160+
response = await client.call_stub_method(
161161
self,
162162
lambda: self.stub.GetMicrogridMetadata(
163163
Empty(),
@@ -166,7 +166,7 @@ async def get_microgrid_info( # noqa: DOC502 (raises ApiClientError indirectly)
166166
method_name="GetMicrogridMetadata",
167167
)
168168

169-
return microgrid_info_from_proto(microgrid.microgrid)
169+
return microgrid_info_from_proto(response.microgrid)
170170

171171
async def list_components( # noqa: DOC502 (raises ApiClientError indirectly)
172172
self,
@@ -209,7 +209,7 @@ async def list_components( # noqa: DOC502 (raises ApiClientError indirectly)
209209
most likely a subclass of
210210
[GrpcError][frequenz.client.microgrid.GrpcError].
211211
"""
212-
component_list = await client.call_stub_method(
212+
response = await client.call_stub_method(
213213
self,
214214
lambda: self.stub.ListComponents(
215215
microgrid_pb2.ListComponentsRequest(
@@ -221,7 +221,7 @@ async def list_components( # noqa: DOC502 (raises ApiClientError indirectly)
221221
method_name="ListComponents",
222222
)
223223

224-
return map(component_from_proto, component_list.components)
224+
return map(component_from_proto, response.components)
225225

226226
async def list_connections( # noqa: DOC502 (raises ApiClientError indirectly)
227227
self,
@@ -263,7 +263,7 @@ async def list_connections( # noqa: DOC502 (raises ApiClientError indirectly)
263263
most likely a subclass of
264264
[GrpcError][frequenz.client.microgrid.GrpcError].
265265
"""
266-
connection_list = await client.call_stub_method(
266+
response = await client.call_stub_method(
267267
self,
268268
lambda: self.stub.ListConnections(
269269
microgrid_pb2.ListConnectionsRequest(
@@ -277,9 +277,7 @@ async def list_connections( # noqa: DOC502 (raises ApiClientError indirectly)
277277

278278
return (
279279
conn
280-
for conn in map(
281-
component_connection_from_proto, connection_list.connections
282-
)
280+
for conn in map(component_connection_from_proto, response.connections)
283281
if conn is not None
284282
)
285283

0 commit comments

Comments
 (0)