Skip to content

Commit

Permalink
Resolve hostnames (home-assistant#11160)
Browse files Browse the repository at this point in the history
  • Loading branch information
pvizeli authored and fabaff committed Dec 17, 2017
1 parent ec9638f commit 5860267
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions homeassistant/components/homematic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
https://home-assistant.io/components/homematic/
"""
import asyncio
import os
import logging
from datetime import timedelta
from functools import partial
import logging
import os
import socket

import voluptuous as vol

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

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

0 comments on commit 5860267

Please sign in to comment.