LIRC: fix in custom module & new hosts

This commit is contained in:
Martin Bauer 2019-11-30 16:56:49 +01:00
parent 5f82f10cfb
commit 53c93652c3
3 changed files with 10 additions and 2 deletions

View File

@ -1 +1 @@
0.100.2
0.102.3

View File

@ -130,6 +130,10 @@ lirc_network:
port: 2222
- host: bedroompi
port: 2222
- host: esszimmerradio
port: 8765
- host: musikserverWohnzimmerOben
port: 8765
media_player:

View File

@ -3,10 +3,12 @@
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.lirc import EVENT_IR_COMMAND_RECEIVED, BUTTON_NAME
from homeassistant.const import CONF_HOST, CONF_PORT
from ..reconnecting_client import ReconnectingClient
EVENT_IR_COMMAND_RECEIVED = "ir_command_received"
BUTTON_NAME = "button_name"
_LOGGER = logging.getLogger(__name__)
DOMAIN = 'lirc_network'
REMOTE_NAME = 'remote'
@ -23,8 +25,10 @@ CONFIG_SCHEMA = vol.Schema({
async def async_setup(hass, config):
for config_element in config[DOMAIN]:
_LOGGER.warning(f'Connecting to {config_element[CONF_HOST]} at {config_element[CONF_PORT]}')
connection = LircConnection(hass, config_element)
await connection.start()
_LOGGER.warning("About to return true in async_setup")
return True