mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
Resolve hostnames (#11160)
This commit is contained in:
parent
a63658d583
commit
a7c8e202aa
@ -5,10 +5,11 @@ For more details about this component, please refer to the documentation at
|
|||||||
https://home-assistant.io/components/homematic/
|
https://home-assistant.io/components/homematic/
|
||||||
"""
|
"""
|
||||||
import asyncio
|
import asyncio
|
||||||
import os
|
|
||||||
import logging
|
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
import logging
|
||||||
|
import os
|
||||||
|
import socket
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
@ -254,7 +255,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': rconfig.get(CONF_HOST),
|
'ip': socket.gethostbyname(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),
|
||||||
@ -267,7 +268,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': sconfig.get(CONF_HOST),
|
'ip': socket.gethostbyname(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