platypush/plugins/switch/__init__.py
def switch_status(self, device=None) -> Union[dict, List[dict]]:
        """
        Get the status of a specified device or of all the configured devices (default).

        :param device: Filter by device name or ID.
        :return: .. schema:: switch.SwitchStatusSchema(many=True)
        """
        devices = self.switches
        if device:
            devices = [d for d in self.switches if d.get('id') == device or d.get('name') == device]
            return devices[0] if devices else []

        return devices

        Get the status of a specified device or of all the configured devices (default).

        :param device: Filter by device name or ID.
        :return: .. schema:: switch.SwitchStatusSchema(many=True)
        
Get the status of a specified device or of all the configured devices (default).
Get the status of a specified device or of all the configured devices ( default ) .
def switch_status(self, device=None) -> Union[dict, List[dict]]:
        devices = self.switches
        if device:
            devices = [d for d in self.switches if d.get('id') == device or d.get('name') == device]
            return devices[0] if devices else []
        return devices
def switch_status ( self , device = None ) -> Union [ dict , List [ dict ] ] : devices = self . switches if device : devices = [ d for d in self . switches if d . get ( 'id' ) == device or d . get ( 'name' ) == device ] return devices [ 0 ] if devices else [ ] return devices
Get the status of a specified device or of all the configured devices (default).
Get the status of a specified device or of all the configured devices ( default ) .
"""
        Get the status of a specified device or of all the configured devices (default).

        :param device: Filter by device name or ID.
        :return: .. schema:: switch.SwitchStatusSchema(many=True)
        """
None
self
device
Filter by device name or ID.
Filter by device name or ID .