Skip to content

Commit b2b83a3

Browse files
Fix timeout argument types
The timeout argument is expected to be an int, not a float. Signed-off-by: Daniel Zullo <[email protected]>
1 parent 87b37b1 commit b2b83a3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/frequenz/sdk/microgrid/client/_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ async def components(self) -> Iterable[Component]:
241241
# but it is
242242
component_list = await self.api.ListComponents(
243243
microgrid_pb.ComponentFilter(),
244-
timeout=DEFAULT_GRPC_CALL_TIMEOUT, # type: ignore[arg-type]
244+
timeout=int(DEFAULT_GRPC_CALL_TIMEOUT),
245245
) # type: ignore[misc]
246246
except grpc.aio.AioRpcError as err:
247247
msg = f"Failed to list components. Microgrid API: {self.target}. Err: {err.details()}"
@@ -329,7 +329,7 @@ async def connections(
329329
Awaitable[microgrid_pb.ConnectionList],
330330
self.api.ListConnections(
331331
connection_filter,
332-
timeout=DEFAULT_GRPC_CALL_TIMEOUT, # type: ignore[arg-type]
332+
timeout=int(DEFAULT_GRPC_CALL_TIMEOUT),
333333
),
334334
),
335335
)
@@ -620,7 +620,7 @@ async def set_power(self, component_id: int, power_w: float) -> None:
620620
microgrid_pb.SetPowerActiveParam(
621621
component_id=component_id, power=power_w
622622
),
623-
timeout=DEFAULT_GRPC_CALL_TIMEOUT, # type: ignore[arg-type]
623+
timeout=int(DEFAULT_GRPC_CALL_TIMEOUT),
624624
) # type: ignore[misc]
625625
except grpc.aio.AioRpcError as err:
626626
msg = f"Failed to set power. Microgrid API: {self.target}. Err: {err.details()}"

0 commit comments

Comments
 (0)