How to use the pyhik.watchdog.Watchdog function in pyHik

To help you get started, we’ve selected a few pyHik 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 mezz64 / pyHik / pyhik / hikvision.py View on Github external
def __init__(self, host=None, port=DEFAULT_PORT,
                 usr=None, pwd=None):
        """Initialize device."""

        _LOGGING.debug("pyHik %s initializing new hikvision device at: %s",
                       __version__, host)

        self.event_states = {}

        self.watchdog = Watchdog(300.0, self.watchdog_handler)

        self.namespace = XML_NAMESPACE
        self.temp_namespace = None

        if not host:
            _LOGGING.error('Host not specified! Cannot continue.')
            return

        self.host = host
        self.usr = usr
        self.pwd = pwd
        self.cam_id = 0
        self.name = ''
        self.device_type = None
        self.motion_detection = None
        self._motion_detection_xml = None