How to use pytautulli - 2 common examples

To help you get started, we’ve selected a few pytautulli examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github home-assistant / home-assistant / homeassistant / components / sensor / tautulli.py View on Github external
hass, config, async_add_entities, discovery_info=None):
    """Create the Tautulli sensor."""
    from pytautulli import Tautulli

    name = config.get(CONF_NAME)
    host = config[CONF_HOST]
    port = config.get(CONF_PORT)
    path = config.get(CONF_PATH)
    api_key = config[CONF_API_KEY]
    monitored_conditions = config.get(CONF_MONITORED_CONDITIONS)
    user = config.get(CONF_MONITORED_USERS)
    use_ssl = config.get(CONF_SSL)
    verify_ssl = config.get(CONF_VERIFY_SSL)

    session = async_get_clientsession(hass, verify_ssl)
    tautulli = TautulliData(Tautulli(
        host, port, api_key, hass.loop, session, use_ssl, path))

    if not await tautulli.test_connection():
        raise PlatformNotReady

    sensor = [TautulliSensor(tautulli, name, monitored_conditions, user)]

    async_add_entities(sensor, True)
github home-assistant / home-assistant / homeassistant / components / tautulli / sensor.py View on Github external
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
    """Create the Tautulli sensor."""

    name = config.get(CONF_NAME)
    host = config[CONF_HOST]
    port = config.get(CONF_PORT)
    path = config.get(CONF_PATH)
    api_key = config[CONF_API_KEY]
    monitored_conditions = config.get(CONF_MONITORED_CONDITIONS)
    user = config.get(CONF_MONITORED_USERS)
    use_ssl = config.get(CONF_SSL)
    verify_ssl = config.get(CONF_VERIFY_SSL)

    session = async_get_clientsession(hass, verify_ssl)
    tautulli = TautulliData(
        Tautulli(host, port, api_key, hass.loop, session, use_ssl, path)
    )

    if not await tautulli.test_connection():
        raise PlatformNotReady

    sensor = [TautulliSensor(tautulli, name, monitored_conditions, user)]

    async_add_entities(sensor, True)

pytautulli

Python API wrapper for Tautulli.

MIT
Latest version published 2 years ago

Package Health Score

46 / 100
Full package analysis

Popular pytautulli functions

Similar packages