Esempio n. 1
0
def setup_platform(hass, config, add_entities, discovery_info=None):
    """Set up the Verisure switch platform."""
    if not int(hub.config.get(CONF_SMARTPLUGS, 1)):
        return False

    hub.update_overview()
    switches = []
    switches.extend([
        VerisureSmartplug(device_label)
        for device_label in hub.get('$.smartPlugs[*].deviceLabel')])
    add_entities(switches)
def setup_platform(hass, config, add_devices, discovery_info=None):
    """Set up the Verisure binary sensors."""
    sensors = []
    hub.update_overview()

    if int(hub.config.get(CONF_DOOR_WINDOW, 1)):
        sensors.extend([
            VerisureDoorWindowSensor(device_label) for device_label in hub.get(
                "$.doorWindow.doorWindowDevice[*].deviceLabel")
        ])
    add_devices(sensors)
Esempio n. 3
0
def setup_platform(hass, config, add_entities, discovery_info=None):
    """Set up the Verisure binary sensors."""
    sensors = []
    hub.update_overview()

    if int(hub.config.get(CONF_DOOR_WINDOW, 1)):
        sensors.extend([
            VerisureDoorWindowSensor(device_label)
            for device_label in hub.get(
                "$.doorWindow.doorWindowDevice[*].deviceLabel")])
    add_entities(sensors)
Esempio n. 4
0
def setup_platform(hass, config, add_entities, discovery_info=None):
    """Set up the Verisure lock platform."""
    locks = []
    if int(hub.config.get(CONF_LOCKS, 1)):
        hub.update_overview()
        locks.extend([
            VerisureDoorlock(device_label)
            for device_label in hub.get(
                "$.doorLockStatusList[*].deviceLabel")])

    add_entities(locks)
Esempio n. 5
0
def setup_platform(hass, config, add_entities, discovery_info=None):
    """Set up the Verisure platform."""
    locks = []
    if int(hub.config.get(CONF_LOCKS, 1)):
        hub.update_overview()
        locks.extend([
            VerisureDoorlock(device_label)
            for device_label in hub.get("$.doorLockStatusList[*].deviceLabel")
        ])

    add_entities(locks)
Esempio n. 6
0
def setup_platform(hass, config, add_entities, discovery_info=None):
    """Set up the Verisure platform."""
    sensors = []
    hub.update_overview()

    if int(hub.config.get(CONF_THERMOMETERS, 1)):
        sensors.extend([
            VerisureThermometer(device_label)
            for device_label in hub.get(
                '$.climateValues[?(@.temperature)].deviceLabel')])

    if int(hub.config.get(CONF_HYDROMETERS, 1)):
        sensors.extend([
            VerisureHygrometer(device_label)
            for device_label in hub.get(
                '$.climateValues[?(@.humidity)].deviceLabel')])

    if int(hub.config.get(CONF_MOUSE, 1)):
        sensors.extend([
            VerisureMouseDetection(device_label)
            for device_label in hub.get(
                "$.eventCounts[?(@.deviceType=='MOUSE1')].deviceLabel")])

    add_entities(sensors)
Esempio n. 7
0
def setup_platform(hass, config, add_entities, discovery_info=None):
    """Set up the Verisure Camera."""
    if not int(hub.config.get(CONF_SMARTCAM, 1)):
        return False
    directory_path = hass.config.config_dir
    if not os.access(directory_path, os.R_OK):
        _LOGGER.error("file path %s is not readable", directory_path)
        return False
    hub.update_overview()
    smartcams = []
    smartcams.extend([
        VerisureSmartcam(hass, device_label, directory_path)
        for device_label in hub.get(
            "$.customerImageCameras[*].deviceLabel")])
    add_entities(smartcams)
Esempio n. 8
0
def setup_platform(hass, config, add_devices, discovery_info=None):
    """Set up the Verisure platform."""
    sensors = []
    hub.update_overview()

    if int(hub.config.get(CONF_THERMOMETERS, 1)):
        sensors.extend([
            VerisureThermometer(device_label) for device_label in hub.get(
                '$.climateValues[?(@.temperature)].deviceLabel')
        ])

    if int(hub.config.get(CONF_HYDROMETERS, 1)):
        sensors.extend([
            VerisureHygrometer(device_label) for device_label in hub.get(
                '$.climateValues[?(@.humidity)].deviceLabel')
        ])

    if int(hub.config.get(CONF_MOUSE, 1)):
        sensors.extend([
            VerisureMouseDetection(device_label) for device_label in hub.get(
                "$.eventCounts[?(@.deviceType=='MOUSE1')].deviceLabel")
        ])

    add_devices(sensors)
Esempio n. 9
0
def setup_platform(hass, config, add_devices, discovery_info=None):
    """Set up the Verisure Camera."""
    if not int(hub.config.get(CONF_SMARTCAM, 1)):
        return False
    directory_path = hass.config.config_dir
    if not os.access(directory_path, os.R_OK):
        _LOGGER.error("file path %s is not readable", directory_path)
        return False
    hub.update_overview()
    smartcams = []
    smartcams.extend([
        VerisureSmartcam(hass, device_label, directory_path)
        for device_label in hub.get("$.customerImageCameras[*].deviceLabel")
    ])
    add_devices(smartcams)