Skip to content

Commit

Permalink
Add rate_limit argument to Management.connection.
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Pieters committed Nov 18, 2024
1 parent 615741e commit 4a79d19
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xknx/management/management.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def process(self, telegram: Telegram) -> None:
return

async def connect(
self, address: IndividualAddress, rate_limit: int = 0
self, address: IndividualAddress, rate_limit: int = 20
) -> P2PConnection:
"""Open a point-to-point connection to a KNX device."""
if address in self._connections:
Expand Down Expand Up @@ -123,10 +123,10 @@ async def disconnect(self, address: IndividualAddress) -> None:

@asynccontextmanager
async def connection(
self, address: IndividualAddress
self, address: IndividualAddress, rate_limit: int = 20
) -> AsyncIterator[P2PConnection]:
"""Provide a point-to-point connection to a KNX device."""
conn = await self.connect(address)
conn = await self.connect(address, rate_limit)
try:
yield conn
finally:
Expand Down

0 comments on commit 4a79d19

Please sign in to comment.