Enable KNX tunnel auto_reconnect by default (#33387)

* Added tunnel reconnect functionality

* Code improvements

* Update homeassistant/components/knx/__init__.py

Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>

* Enable auto_reconnect for tunnels by default

Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
pull/33488/head
Ron Klinkien 2020-04-01 00:22:20 +02:00 committed by GitHub
parent 90dd796644
commit 774b1d1663
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -205,7 +205,7 @@ class KNXModule:
def connection_config_tunneling(self):
"""Return the connection_config if tunneling is configured."""
gateway_ip = self.config[DOMAIN][CONF_KNX_TUNNELING].get(CONF_HOST)
gateway_ip = self.config[DOMAIN][CONF_KNX_TUNNELING][CONF_HOST]
gateway_port = self.config[DOMAIN][CONF_KNX_TUNNELING].get(CONF_PORT)
local_ip = self.config[DOMAIN][CONF_KNX_TUNNELING].get(CONF_KNX_LOCAL_IP)
if gateway_port is None:
@ -215,6 +215,7 @@ class KNXModule:
gateway_ip=gateway_ip,
gateway_port=gateway_port,
local_ip=local_ip,
auto_reconnect=True,
)
def connection_config_auto(self):