Skip to content

Commit 06143e2

Browse files
committed
feat: make async_get_service_info available on the Zeroconf object
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
1 parent 7a39085 commit 06143e2

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

tests/test_asyncio.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,10 @@ async def test_service_info_async_request() -> None:
680680
assert aiosinfo is not None
681681
assert aiosinfo.addresses == [socket.inet_aton("10.0.1.3")]
682682

683+
aiosinfo = await aiozc.zeroconf.async_get_service_info(type_, registration_name)
684+
assert aiosinfo is not None
685+
assert aiosinfo.addresses == [socket.inet_aton("10.0.1.3")]
686+
683687
aiosinfos = await asyncio.gather(
684688
aiozc.async_get_service_info(type_, registration_name),
685689
aiozc.async_get_service_info(type_, registration_name2),

0 commit comments

Comments
 (0)