Skip to content

Commit

Permalink
Pass configured host string instead of always forcing an ip-address (#…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
itn3rd77 authored and pvizeli committed Apr 17, 2019
1 parent 723d00d commit 0afa016
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions homeassistant/components/homematic/__init__.py
Expand Up @@ -2,7 +2,6 @@
from datetime import timedelta
from functools import partial
import logging
import socket

import voluptuous as vol

Expand Down Expand Up @@ -263,7 +262,7 @@ def setup(hass, config):
# Create hosts-dictionary for pyhomematic
for rname, rconfig in conf[CONF_INTERFACES].items():
remotes[rname] = {
'ip': socket.gethostbyname(rconfig.get(CONF_HOST)),
'ip': rconfig.get(CONF_HOST),
'port': rconfig.get(CONF_PORT),
'path': rconfig.get(CONF_PATH),
'resolvenames': rconfig.get(CONF_RESOLVENAMES),
Expand All @@ -279,7 +278,7 @@ def setup(hass, config):

for sname, sconfig in conf[CONF_HOSTS].items():
remotes[sname] = {
'ip': socket.gethostbyname(sconfig.get(CONF_HOST)),
'ip': sconfig.get(CONF_HOST),
'port': DEFAULT_PORT,
'username': sconfig.get(CONF_USERNAME),
'password': sconfig.get(CONF_PASSWORD),
Expand Down

0 comments on commit 0afa016

Please sign in to comment.