Enable KNX routing optional local_ip (#46133)
This commit is contained in:
parent
c6c0e2416c
commit
2cf46330b1
2 changed files with 7 additions and 4 deletions
|
@ -298,9 +298,12 @@ class KNXModule:
|
||||||
|
|
||||||
def connection_config_routing(self):
|
def connection_config_routing(self):
|
||||||
"""Return the connection_config if routing is configured."""
|
"""Return the connection_config if routing is configured."""
|
||||||
local_ip = self.config[DOMAIN][CONF_KNX_ROUTING].get(
|
local_ip = None
|
||||||
ConnectionSchema.CONF_KNX_LOCAL_IP
|
# all configuration values are optional
|
||||||
)
|
if self.config[DOMAIN][CONF_KNX_ROUTING] is not None:
|
||||||
|
local_ip = self.config[DOMAIN][CONF_KNX_ROUTING].get(
|
||||||
|
ConnectionSchema.CONF_KNX_LOCAL_IP
|
||||||
|
)
|
||||||
return ConnectionConfig(
|
return ConnectionConfig(
|
||||||
connection_type=ConnectionType.ROUTING, local_ip=local_ip
|
connection_type=ConnectionType.ROUTING, local_ip=local_ip
|
||||||
)
|
)
|
||||||
|
|
|
@ -38,7 +38,7 @@ class ConnectionSchema:
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
ROUTING_SCHEMA = vol.Schema({vol.Optional(CONF_KNX_LOCAL_IP): cv.string})
|
ROUTING_SCHEMA = vol.Maybe(vol.Schema({vol.Optional(CONF_KNX_LOCAL_IP): cv.string}))
|
||||||
|
|
||||||
|
|
||||||
class CoverSchema:
|
class CoverSchema:
|
||||||
|
|
Loading…
Add table
Reference in a new issue