1
mirror of https://github.com/home-assistant/core synced 2024-09-15 17:29:45 +02:00

Reinstate passing loop to DSMR (#24127)

* Reinstate passing loop

* Also pass loop into other part
This commit is contained in:
Paulus Schoutsen 2019-05-29 11:13:29 -07:00 committed by GitHub
parent bebfc3d16e
commit 4b256f3466
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -183,11 +183,12 @@ async def async_setup_platform(hass, config, async_add_entities,
if CONF_HOST in config:
reader_factory = partial(
create_tcp_dsmr_reader, config[CONF_HOST], config[CONF_PORT],
config[CONF_DSMR_VERSION], update_entities_telegram)
config[CONF_DSMR_VERSION], update_entities_telegram,
loop=hass.loop)
else:
reader_factory = partial(
create_dsmr_reader, config[CONF_PORT], config[CONF_DSMR_VERSION],
update_entities_telegram)
update_entities_telegram, loop=hass.loop)
async def connect_and_reconnect():
"""Connect to DSMR and keep reconnecting until Home Assistant stops."""