(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 = b"\x00\x00\x00" + self._serialize_string(key)
        packet = b"\x00\x00\x00" + self._serialize_string(payload, True)

        logging.info("Sending control command: %s", key)
        self.connection.send(packet)
        self._read_response()
        time.sleep(self._key_interval)
def control ( self , key ) : if not self . connection : raise exceptions . ConnectionClosed ( ) payload = b"\x00\x00\x00" + self . _serialize_string ( key ) packet = b"\x00\x00\x00" + self . _serialize_string ( payload , True ) logging . info ( "Sending control command: %s" , key ) self . connection . send ( packet ) self . _read_response ( ) time . sleep ( self . _key_interval )