示例#1
0
async def async_setup(opp, config):
    """Set up the versasense component."""
    session = aiohttp_client.async_get_clientsession(opp)
    consumer = pyv.Consumer(config[DOMAIN]["host"], session)

    opp.data[DOMAIN] = {KEY_CONSUMER: consumer}

    await _configure_entities(opp, config, consumer)

    # Return boolean to indicate that initialization was successful.
    return True
示例#2
0
文件: __init__.py 项目: rikroe/core
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
    """Set up the versasense component."""
    session = aiohttp_client.async_get_clientsession(hass)
    consumer = pyv.Consumer(config[DOMAIN]["host"], session)

    hass.data[DOMAIN] = {KEY_CONSUMER: consumer}

    await _configure_entities(hass, config, consumer)

    # Return boolean to indicate that initialization was successful.
    return True