Add homematic host port config for HMIP-only CCUs (#30077)

* homematic: Add host port config for HMIP-only CCUs

When adding a host (CCU) to the homematic component currently the hardcoded port 2001 is used to communicate with it.
However that port is only available on the target if the target supports HM (wireless) protocol which is not the case e.g. for
the Hass.io Homematic CCU addon when running in HMIP-only mode with the HMIP-RFUSB stick.

This allows to change the port home assistant uses to talk to the CCU in order to provide services under hte homematic homain, e.g. homematic.set_variable_value

The default value for this option is the old hardcoded value this the change should be backwards compatible with existing configurations.

* Change style of config retrieval
This commit is contained in:
Steven Barth 2019-12-31 14:41:44 +01:00 committed by Charles Garwood
parent 72e97792bd
commit 4bfc7b9848

View File

@ -298,6 +298,7 @@ CONFIG_SCHEMA = vol.Schema(
vol.Optional(CONF_HOSTS, default={}): {
cv.match_all: {
vol.Required(CONF_HOST): cv.string,
vol.Optional(CONF_PORT, default=DEFAULT_PORT): cv.port,
vol.Optional(
CONF_USERNAME, default=DEFAULT_USERNAME
): cv.string,
@ -392,7 +393,7 @@ def setup(hass, config):
for sname, sconfig in conf[CONF_HOSTS].items():
remotes[sname] = {
"ip": sconfig.get(CONF_HOST),
"port": DEFAULT_PORT,
"port": sconfig[CONF_PORT],
"username": sconfig.get(CONF_USERNAME),
"password": sconfig.get(CONF_PASSWORD),
"connect": False,