platypush/plugins/switch/tplink/__init__.py
def toggle(self, device, **kwargs):
        """
        Toggle the state of a device (on/off)

        :param device: Device IP, hostname or alias
        :type device: str
        """

        device = self._get_device(device)

        if device.is_on:
            device.turn_off()
        else:
            device.turn_on()

        return {
            'current_consumption': device.current_consumption(),
            'id': device.host,
            'ip': device.host,
            'host': device.host,
            'hw_info': device.hw_info,
            'name': device.alias,
            'on': device.is_on,
        }

        Toggle the state of a device (on/off)

        :param device: Device IP, hostname or alias
        :type device: str
        
Toggle the state of a device (on/off)
Toggle the state of a device ( on / off )
def toggle(self, device, **kwargs):
        device = self._get_device(device)
        if device.is_on:
            device.turn_off()
        else:
            device.turn_on()
        return {
            'current_consumption': device.current_consumption(),
            'id': device.host,
            'ip': device.host,
            'host': device.host,
            'hw_info': device.hw_info,
            'name': device.alias,
            'on': device.is_on,
        }
def toggle ( self , device , ** kwargs ) : device = self . _get_device ( device ) if device . is_on : device . turn_off ( ) else : device . turn_on ( ) return { 'current_consumption' : device . current_consumption ( ) , 'id' : device . host , 'ip' : device . host , 'host' : device . host , 'hw_info' : device . hw_info , 'name' : device . alias , 'on' : device . is_on , }
Toggle the state of a device (on/off)
Toggle the state of a device ( on / off )
"""
        Toggle the state of a device (on/off)

        :param device: Device IP, hostname or alias
        :type device: str
        """
self
device
Device IP, hostname or alias
Device IP hostname or alias