Lirc: sensor showing connected hosts
This commit is contained in:
@@ -14,6 +14,7 @@ DOMAIN = 'lirc_network'
|
||||
REMOTE_NAME = 'remote'
|
||||
REPEAT_COUNTER = 'repeat_counter'
|
||||
LIRC_HOST = 'host'
|
||||
DATA_LIRC_NETWORK = 'data_lirc_network'
|
||||
|
||||
CONFIG_SCHEMA = vol.Schema({
|
||||
DOMAIN: vol.Schema(vol.All([{
|
||||
@@ -24,9 +25,10 @@ CONFIG_SCHEMA = vol.Schema({
|
||||
|
||||
|
||||
async def async_setup(hass, config):
|
||||
hass.data[DATA_LIRC_NETWORK] = []
|
||||
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)
|
||||
hass.data[DATA_LIRC_NETWORK].append(connection)
|
||||
await connection.start()
|
||||
_LOGGER.warning("About to return true in async_setup")
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user