"""Support for Verisure devices."""
from datetime import timedelta

from jsonpath import jsonpath
import verisure
import voluptuous as vol

from homeassistant.const import (
    CONF_PASSWORD,
    CONF_SCAN_INTERVAL,
    CONF_USERNAME,
    EVENT_HOMEASSISTANT_STOP,
    HTTP_SERVICE_UNAVAILABLE,
)
from homeassistant.helpers import discovery
import homeassistant.helpers.config_validation as cv
from homeassistant.util import Throttle

from .const import (
    ATTR_DEVICE_SERIAL,
    CONF_ALARM,
    CONF_CODE_DIGITS,
    CONF_DEFAULT_LOCK_CODE,
    CONF_DOOR_WINDOW,
    CONF_GIID,
    CONF_HYDROMETERS,
    CONF_LOCKS,
    CONF_MOUSE,
    CONF_SMARTCAM,
    CONF_SMARTPLUGS,
    CONF_THERMOMETERS,
    DEFAULT_SCAN_INTERVAL,
    DOMAIN,
    LOGGER,
    MIN_SCAN_INTERVAL,
    SERVICE_CAPTURE_SMARTCAM,
    SERVICE_DISABLE_AUTOLOCK,
    SERVICE_ENABLE_AUTOLOCK,
)

HUB = None

CONFIG_SCHEMA = vol.Schema(
    {