Skip to content

Commit

Permalink
Zeroconf browser (which we use to find the ess) seems to run more rel…
Browse files Browse the repository at this point in the history
…iably when called synchronously.
  • Loading branch information
gluap committed Jan 1, 2022
1 parent 0a88353 commit 9f94e8c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pyess/essmqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ def main(arguments=None):
# .run(_main, arguments)


async def _main(arguments=None):
async def _main( arguments=None):
loop = asyncio.get_event_loop()
parser = configargparse.ArgumentParser(prog='essmqtt', description='Mqtt connector for pyess',
add_config_file_help=True,
default_config_files=['/etc/essmqtt.conf', '~/.essmqtt.conf'],
Expand All @@ -130,7 +131,7 @@ async def _main(arguments=None):

args = parser.parse_args(arguments)
if args.ess_host is None:
ip, name = autodetect_ess()
ip, name = await loop.run_in_executor(None, autodetect_ess)
else:
ip, name = args.ess_host, args.ess_host

Expand Down

0 comments on commit 9f94e8c

Please sign in to comment.