Skip to content

Commit

Permalink
feat: make async_get_service_info available on the Zeroconf object
Browse files Browse the repository at this point in the history
Since the AsyncServiceBrowser will return a Zeroconf object, it was
not obvious how to do an async lookup because only get_service_info
was exposed on the Zeroconf object. async_get_service_info has been
moved to the Zeroconf object, and AsyncZeroconf.async_get_service_info
now wraps this method
  • Loading branch information
bdraco committed Apr 1, 2024
1 parent 7a39085 commit 06143e2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/test_asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,10 @@ async def test_service_info_async_request() -> None:
assert aiosinfo is not None
assert aiosinfo.addresses == [socket.inet_aton("10.0.1.3")]

aiosinfo = await aiozc.zeroconf.async_get_service_info(type_, registration_name)
assert aiosinfo is not None
assert aiosinfo.addresses == [socket.inet_aton("10.0.1.3")]

aiosinfos = await asyncio.gather(
aiozc.async_get_service_info(type_, registration_name),
aiozc.async_get_service_info(type_, registration_name2),
Expand Down

0 comments on commit 06143e2

Please sign in to comment.