<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 async def async_execute(self, command: Command, password: str = '', timeout: int = EXECUTE_TIMEOUT_SECS) -> Response: """ Execute a command and return response. command: the command instance to be executed password: if specified, will be used to execute this command (overriding any global password that may have been assigned to the property) timeout: maximum number of seconds to wait for a response """

        if not self._is_connected:
            raise ConnectionError("Client is not connected to the server")
        state = {
            'command': command,
            'event': asyncio.Event(loop=self._loop)
        } # type: Dict[str, Any]
        self._executing[command.name] = state
        try:
            self._send(command, password)
            await asyncio.wait_for(state['event'].wait(), timeout)
            return state['response']
        finally:
            self._executing[command.name] = None