How to use the amcrest.Http function in amcrest

To help you get started, we’ve selected a few amcrest 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 / amcrest / __init__.py View on Github external
),
            vol.Optional(CONF_SWITCHES): vol.All(cv.ensure_list, [vol.In(SWITCHES)]),
            vol.Optional(CONF_CONTROL_LIGHT, default=True): cv.boolean,
        }
    ),
    _deprecated_switches,
)

CONFIG_SCHEMA = vol.Schema(
    {DOMAIN: vol.All(cv.ensure_list, [AMCREST_SCHEMA], _has_unique_names)},
    extra=vol.ALLOW_EXTRA,
)


# pylint: disable=too-many-ancestors
class AmcrestChecker(Http):
    """amcrest.Http wrapper for catching errors."""

    def __init__(self, hass, name, host, port, user, password):
        """Initialize."""
        self._hass = hass
        self._wrap_name = name
        self._wrap_errors = 0
        self._wrap_lock = threading.Lock()
        self._unsub_recheck = None
        super().__init__(
            host, port, user, password, retries_connection=1, timeout_protocol=3.05
        )

    @property
    def available(self):
        """Return if camera's API is responding."""

amcrest

Python wrapper implementation for Amcrest cameras.

GPL-2.0
Latest version published 7 months ago

Package Health Score

68 / 100
Full package analysis