How to use pyEmby - 1 common examples

To help you get started, we’ve selected a few pyEmby 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 / emby / media_player.py View on Github external
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
    """Set up the Emby platform."""

    host = config.get(CONF_HOST)
    key = config.get(CONF_API_KEY)
    port = config.get(CONF_PORT)
    ssl = config.get(CONF_SSL)
    auto_hide = config.get(CONF_AUTO_HIDE)

    if port is None:
        port = DEFAULT_SSL_PORT if ssl else DEFAULT_PORT

    _LOGGER.debug("Setting up Emby server at: %s:%s", host, port)

    emby = EmbyServer(host, key, port, ssl, hass.loop)

    active_emby_devices = {}
    inactive_emby_devices = {}

    @callback
    def device_update_callback(data):
        """Handle devices which are added to Emby."""
        new_devices = []
        active_devices = []
        for dev_id in emby.devices:
            active_devices.append(dev_id)
            if (
                dev_id not in active_emby_devices
                and dev_id not in inactive_emby_devices
            ):
                new = EmbyDevice(emby, dev_id)

pyEmby

Provides a python interface to interact with a Emby media server.

MIT
Latest version published 2 months ago

Package Health Score

63 / 100
Full package analysis

Popular pyEmby functions