mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Pass configured host string instead of always forcing an ip-address (#23164)
* Pass host string instead of forcing an ip-address Pass the configured host (https://www.home-assistant.io/components/homematic/#host) instead of always forcing an ip-address. This is required to get SSL certificate validation working. * Remove unused 'socket' import
This commit is contained in:
parent
723d00d33a
commit
0afa01609c
@ -2,7 +2,6 @@
|
|||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from functools import partial
|
from functools import partial
|
||||||
import logging
|
import logging
|
||||||
import socket
|
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
@ -263,7 +262,7 @@ def setup(hass, config):
|
|||||||
# Create hosts-dictionary for pyhomematic
|
# Create hosts-dictionary for pyhomematic
|
||||||
for rname, rconfig in conf[CONF_INTERFACES].items():
|
for rname, rconfig in conf[CONF_INTERFACES].items():
|
||||||
remotes[rname] = {
|
remotes[rname] = {
|
||||||
'ip': socket.gethostbyname(rconfig.get(CONF_HOST)),
|
'ip': rconfig.get(CONF_HOST),
|
||||||
'port': rconfig.get(CONF_PORT),
|
'port': rconfig.get(CONF_PORT),
|
||||||
'path': rconfig.get(CONF_PATH),
|
'path': rconfig.get(CONF_PATH),
|
||||||
'resolvenames': rconfig.get(CONF_RESOLVENAMES),
|
'resolvenames': rconfig.get(CONF_RESOLVENAMES),
|
||||||
@ -279,7 +278,7 @@ def setup(hass, config):
|
|||||||
|
|
||||||
for sname, sconfig in conf[CONF_HOSTS].items():
|
for sname, sconfig in conf[CONF_HOSTS].items():
|
||||||
remotes[sname] = {
|
remotes[sname] = {
|
||||||
'ip': socket.gethostbyname(sconfig.get(CONF_HOST)),
|
'ip': sconfig.get(CONF_HOST),
|
||||||
'port': DEFAULT_PORT,
|
'port': DEFAULT_PORT,
|
||||||
'username': sconfig.get(CONF_USERNAME),
|
'username': sconfig.get(CONF_USERNAME),
|
||||||
'password': sconfig.get(CONF_PASSWORD),
|
'password': sconfig.get(CONF_PASSWORD),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user