Example #1
0
def setup_platform(hass, config, add_devices, discovery_info=None):
    """ Sets up the Verisure platform. """

    if not verisure.MY_PAGES:
        _LOGGER.error('A connection has not been made to Verisure mypages.')
        return False

    sensors = []

    sensors.extend([
        VerisureThermometer(value)
        for value in verisure.get_climate_status().values()
        if verisure.SHOW_THERMOMETERS and hasattr(value, 'temperature')
        and value.temperature
    ])

    sensors.extend([
        VerisureHygrometer(value)
        for value in verisure.get_climate_status().values()
        if verisure.SHOW_HYGROMETERS and hasattr(value, 'humidity')
        and value.humidity
    ])

    sensors.extend([
        VerisureAlarm(value) for value in verisure.get_alarm_status().values()
        if verisure.SHOW_ALARM
    ])

    add_devices(sensors)
Example #2
0
def setup_platform(hass, config, add_devices, discovery_info=None):
    """ Sets up the Verisure platform. """

    if not verisure.MY_PAGES:
        _LOGGER.error('A connection has not been made to Verisure mypages.')
        return False

    sensors = []

    sensors.extend([
        VerisureThermometer(value)
        for value in verisure.get_climate_status().values()
        if verisure.SHOW_THERMOMETERS and
        hasattr(value, 'temperature') and value.temperature
        ])

    sensors.extend([
        VerisureHygrometer(value)
        for value in verisure.get_climate_status().values()
        if verisure.SHOW_HYGROMETERS and
        hasattr(value, 'humidity') and value.humidity
        ])

    sensors.extend([
        VerisureAlarm(value)
        for value in verisure.get_alarm_status().values()
        if verisure.SHOW_ALARM
        ])

    add_devices(sensors)
Example #3
0
def setup_platform(hass, config, add_devices, discovery_info=None):
    """ Sets up the Verisure platform. """

    if not verisure.MY_PAGES:
        _LOGGER.error('A connection has not been made to Verisure mypages.')
        return False

    alarms = []

    alarms.extend([
        VerisureAlarm(value) for value in verisure.get_alarm_status().values()
        if verisure.SHOW_ALARM
    ])

    add_devices(alarms)
Example #4
0
def setup_platform(hass, config, add_devices, discovery_info=None):
    """ Sets up the Verisure platform. """

    if not verisure.MY_PAGES:
        _LOGGER.error('A connection has not been made to Verisure mypages.')
        return False

    alarms = []

    alarms.extend([
        VerisureAlarm(value)
        for value in verisure.get_alarm_status().values()
        if verisure.SHOW_ALARM
        ])

    add_devices(alarms)