示例#1
0
def setup_platform(hass, config, add_devices, discovery_info=None):
    """Setup the Verisure platform."""
    alarms = []
    if int(hub.config.get('alarm', '1')):
        hub.update_alarms()
        alarms.extend([
            VerisureAlarm(value.id)
            for value in hub.alarm_status.values()
            ])
    add_devices(alarms)
示例#2
0
def setup_platform(hass, config, add_devices, discovery_info=None):
    """Setup the Verisure platform."""
    if not int(hub.config.get('smartplugs', '1')):
        return False

    hub.update_smartplugs()
    switches = []
    switches.extend([
        VerisureSmartplug(value.deviceLabel)
        for value in hub.smartplug_status.values()])
    add_devices(switches)
示例#3
0
    def update(self):
        """Update alarm status."""
        hub.update_alarms()

        if hub.alarm_status[self._id].status == 'unarmed':
            self._state = STATE_ALARM_DISARMED
        elif hub.alarm_status[self._id].status == 'armedhome':
            self._state = STATE_ALARM_ARMED_HOME
        elif hub.alarm_status[self._id].status == 'armed':
            self._state = STATE_ALARM_ARMED_AWAY
        elif hub.alarm_status[self._id].status != 'pending':
            _LOGGER.error(
                'Unknown alarm state %s',
                hub.alarm_status[self._id].status)
示例#4
0
def setup_platform(hass, config, add_devices, discovery_info=None):
    """Setup the Verisure platform."""
    sensors = []

    if int(hub.config.get('thermometers', '1')):
        hub.update_climate()
        sensors.extend([
            VerisureThermometer(value.id)
            for value in hub.climate_status.values()
            if hasattr(value, 'temperature') and value.temperature
            ])

    if int(hub.config.get('hygrometers', '1')):
        hub.update_climate()
        sensors.extend([
            VerisureHygrometer(value.id)
            for value in hub.climate_status.values()
            if hasattr(value, 'humidity') and value.humidity
            ])

    if int(hub.config.get('mouse', '1')):
        hub.update_mousedetection()
        sensors.extend([
            VerisureMouseDetection(value.deviceLabel)
            for value in hub.mouse_status.values()
            # is this if needed?
            if hasattr(value, 'amountText') and value.amountText
            ])

    add_devices(sensors)
示例#5
0
 def update(self):
     """Get the latest date of the smartplug."""
     hub.update_smartplugs()
示例#6
0
 def update(self):
     """Update the sensor."""
     hub.update_climate()
示例#7
0
 def update(self):
     """Update the sensor."""
     hub.update_mousedetection()