Convert zerproc to use new upstream async api (#44357)

This commit is contained in:
Emily Mills
2020-12-19 09:35:47 -06:00
committed by GitHub
parent 896f51fd82
commit 9de393d116
6 changed files with 32 additions and 42 deletions

View File

@@ -14,7 +14,7 @@ _LOGGER = logging.getLogger(__name__)
async def _async_has_devices(hass) -> bool:
"""Return if there are devices that can be discovered."""
try:
devices = await hass.async_add_executor_job(pyzerproc.discover)
devices = await pyzerproc.discover()
return len(devices) > 0
except pyzerproc.ZerprocException:
_LOGGER.error("Unable to discover nearby Zerproc devices", exc_info=True)