Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async def async_setup(hass, config):
"""Set up the asuswrt component."""
conf = config[DOMAIN]
api = AsusWrt(
conf[CONF_HOST],
conf.get(CONF_PORT),
conf.get(CONF_PROTOCOL) == "telnet",
conf[CONF_USERNAME],
conf.get(CONF_PASSWORD, ""),
conf.get("ssh_key", conf.get("pub_key", "")),
conf.get(CONF_MODE),
conf.get(CONF_REQUIRE_IP),
)
await api.connection.async_connect()
if not api.is_connected:
_LOGGER.error("Unable to setup asuswrt component")
return False
hass.data[DATA_ASUSWRT] = api