(self, key)
Send a control command.
Send a control command.
Send a control command .
def control(self, key):
        """Send a control command."""
        if not self.connection:
            raise exceptions.ConnectionClosed()

        payload = json.dumps({
            "method": "ms.remote.control",
            "params": {
                "Cmd": "Click",
                "DataOfCmd": key,
                "Option": "false",
                "TypeOfRemote": "SendRemoteKey"
            }
        })

        logging.info("Sending control command: %s", key)
        self.connection.send(payload)
        time.sleep(self._key_interval)
def control ( self , key ) : if not self . connection : raise exceptions . ConnectionClosed ( ) payload = json . dumps ( { "method" : "ms.remote.control" , "params" : { "Cmd" : "Click" , "DataOfCmd" : key , "Option" : "false" , "TypeOfRemote" : "SendRemoteKey" } } ) logging . info ( "Sending control command: %s" , key ) self . connection . send ( payload ) time . sleep ( self . _key_interval )