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

    switches = []

    switches.extend([
        VerisureSmartplug(value)
        for value in verisure.get_smartplug_status().values()
        if verisure.SHOW_SMARTPLUGS
    ])

    add_devices(switches)
def setup_platform(hass, config, add_devices, discovery_info=None):
    """ Sets up the Arduino platform. """

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

    switches = []

    switches.extend([
        VerisureSmartplug(value)
        for value in verisure.get_smartplug_status().values()
        if verisure.SHOW_SMARTPLUGS
        ])

    add_devices(switches)
Example #3
0
 def is_on(self):
     """ Returns True if on """
     plug_status = verisure.get_smartplug_status()[self._id].status
     return plug_status == self.status_on
Example #4
0
 def name(self):
     """ Get the name (location) of the smartplug. """
     return verisure.get_smartplug_status()[self._id].location
 def is_on(self):
     """ Returns True if on """
     plug_status = verisure.get_smartplug_status()[self._id].status
     return plug_status == self.status_on
 def name(self):
     """ Get the name (location) of the smartplug. """
     return verisure.get_smartplug_status()[self._id].location